OnClipEvent Does Not Work
OK I have a line of coding that works but I keep getting an output error that says;
"1: Clip events are permitted only for movie clip instances".
I need to change the "onClipEvent" to something else to get it to play.
this is the code that I have now:
onClipEvent (load) { if (_parent.getBytesTotal() == _parent.getBytesLoaded()) { quickPlay = true; } else { preLoad = (_parent.getBytesTotal() * 0.75); //percent to preload } _parent.stop(); }
What am I supposed to type in to make this all work.
FlashKit > Flash Help > Flash MX
Posted on: 05-23-2006, 01:51 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
HELP HitTest Doesn't Work When OnClipEvent(load) But OnClipEvent(enterFrame)?
Somehow it works for my embedded xml links (coz of using hitTesting) but some of the actions don't run.
Is there anyway to resolve this ?? Coz I want to have clickable xml links embedded within flash. Along with other effects that run at the same time.
I realised that I can only use onClipEvent(enterFrame) instead of onClipevent(load) to trigger the actions. But why is this so???
Hope I'm making sense here...
PS: I tried using only on(rollOver) and on(rollOut), simple button to trigger all the actions and they did. But I can't use buttons as there are xml links embedded within.
ActionScript Code:
onClipEvent(enterFrame){
if (this.hitTest(_root._xmouse, _root._ymouse, true)){
_root.button01_mc.gotoAndStop("over");
_root.image01bg.setMask(_root.blindOpen02);
_root.blindOpen01.gotoAndPlay(1);
_root.image01bg.tween("_x",10,0.75,"easeOutExpo");
_root.lines_mc.alphaTo(100,0.25,"easeOutExpo");
}else{
_root.button01_mc.gotoAndStop("up");
_root.image01bg.setMask(_root.blindClose01);
_root.blindClose01.gotoAndPlay(1);
_root.image01bg.tween("_x",760,0.75,"easeOutExpo");
_root.lines_mc.alphaTo(0,0.25,"easeOutExpo");
}
This Should Work...right? (onClipEvent Problem)
-I have a 10 frame intro.
On the first frame I've set var buttviz = "1".
-I have two nav buttons that appear on the last frame (stopped).
- Both of these buttons are in a seperate movie clip, the first named "back" the second, "forward".
-The first button in it's clip is set to on (release){_root.buttviz = _root.buttviz -1}
-The second: on release {_root.buttviz = _root.buttviz +1}
-On the main time line, at frame 10 when the buttons are key framed to appear, the "back" button's clip has a script attached
to it:
onClipEvent (enterframe) {
if (buttviz == 1) {
back._visible = false;
} else if (buttviz>1) {
back._visible = true;
}
}
and the "forward" button clip:
onClipEvent (mouseUp) {
if (buttviz == 5) {
back._visible = false;
} else if (buttviz>5) {
back._visible = true;
}
}
By this I'm trying to make it so the first button is not visible upon enter frame, but when the "forward" button is pressed the first time, it will be be.
As soon as buttviz = 5 the "forward button disapears until the "back" button is pressed.
In theory this should work right? So why doesn't it. Where have I gone wrong?
Anyone please!
Call() Does Not Work With OnClipEvent()?
I am trying to call a function to the onClipEvent feature on a mc, and it appears as though it does not work at all!
I try the same call() on a button, and it works fine...
Any suggestions, or workarounds?
thanks
Can OnClipEvent Be Placed Outside A Symbol To Work
can onClipEvent be placed outside a symbol to work?
I have an object with the action inside
onClipEvent (load) {
//this sets the initial x position of our clip
this._x = 50;
}
onClipEvent (enterFrame) {
//this moves our clip 5 pixels to the right every frame
this._x = this._x+5;
}
I wanna place this script outside of the symbol because the code will be loaded externally from an as file. Or put the script on frame 1 empty frame. I definitely need to give my instance a new name much flash to refer to it. That much i know. Any help will be great!
OnClipevent Doesn't Work When I Loadmovie
Anyone have any experience with loading a movieclip that contains onClipevent(enterFrame) commands that stop working..
I have a slider-type interface that uses clip events. Works fine when ran by itself but if I load it into another movie it doesnt seem to recognize the event commands.
GotoAndPlay On A OnClipEvent(data) Does Not Work
onClipEvent(data){
trace("before");
gotoAndPlay(3);
trace("after");
}
The data is getting in but the gotoAndPlay(3); does not work.
I put a trace "before" and "after" which gets picked up but it seems to ignore gotoAndPlay().
Help!!!
Why Does My OnclipEvent Load Pop Up , Not Work On Safari?
I'm using the following code...and it automatically launches a pop up with firefox and IE, but on safari, it don't work. What is going on? Any work around for this?
onClipEvent (load) {getURL ("javascript:NewWindow=window.open('southafrican.h tml','newWin','width='+screen.availWidth+',height= '+screen.availHeight+',left=0,top=0,toolbar=No,loc ation=No,scrollbars=No,status=No,resizable=No,full screen=No'); NewWindow.focus(); void(0);");
}
on (release) {
getURL ("javascript:NewWindow=window.open('southafrican.h tml','newWin','width='+screen.availWidth+',height= '+screen.availHeight+',left=0,top=0,toolbar=No,loc ation=No,scrollbars=No,status=No,resizable=No,full screen=No'); NewWindow.focus(); void(0);");
}
Why Does My OnClipEvent Load Pop Up, Not Work On Safari?
I'm using the following code...and it automatically launches a pop up with firefox and IE, but on safari, it don't work. What is going on? Any work around for this?
onClipEvent (load) {getURL ("javascript:NewWindow=window.open('southafrican.h tml','newWin','width='+screen.availWidth+',height= '+screen.availHeight+',left=0,top=0,toolbar=No,loc ation=No,scrollbars=No,status=No,resizable=No,full screen=No'); NewWindow.focus(); void(0);");
}
on (release) {
getURL ("javascript:NewWindow=window.open('southafrican.h tml','newWin','width='+screen.availWidth+',height= '+screen.availHeight+',left=0,top=0,toolbar=No,loc ation=No,scrollbars=No,status=No,resizable=No,full screen=No'); NewWindow.focus(); void(0);");
}
OnClipEvent(data) Or OnData Does Not Work All The Way...
I am trying to load a jpeg or swf file into a movie clip (Pic) on my stage.
_root.cont.Pic & root.cont.fail - "Pic" for Movie Clip that I load a jpeg/swf file into, "fail" to show that the movie has loaded/failed to load
On the movieclip code i have:
onClipEvent(data) {
trace(this);
trace(_parent);
_parent.fail._visible = false;
}
When I load a swf file, this code works once onClipEvent(data) is called, but when I load a jpeg file: 1. debugging does not work, 2. "this" command works but "_parent" and everything else is undefined...
when I define (code located in: _root.cont)
Pic.onData = function () {
trace(Pic);
trace(this);
trace(_parent);
_parent.fail._visible = false;
}
Once I load anything into Pic - that code is no functioning (at all)
Is there any way that i can check the result of the loadMovie without using onClipEvent(data), onData
How should I correctly use onClipEvent(data) or onData so it works?
.fla files would be really helpful!
I appreciate any suggestions...
Sincerely,
Simon
OnClipEvent(data) Doesn't Work In Flash 8?
Hi all,
I've got a swf exported in Flash 8, and I've got some images loading into it using this code within the movie clip:
this.loadMovie(_root.image1,1);
And I'm trying to preload using this code on the movie clip:
onClipEvent(data)
{
this.gotoAndPlay(3);
}
... and a 'Stop()' on that frame. But it's not working. It just stops at that frame and doesn't load the image.
Can anyone tell me why?
OnClipEvent(keyUp) And OnClipEvent(keyDown): Misbe
Hi,
We are trying to trap the keypresses in an input text box, which is placed inside a Movie Clip, using the onClipEvent(keyUp) and onClipEvent(keyDown) events.
We have also disabled the tabEnabled properties for the button, movieclip, and textFields.
The problem:
The Flash player 7 is unable to detect the onClipEvent(keyUp) event when the Tab key is pressed. The movieClip has the focus since the type is Input Text. Interestingly, the problem only occurs in Flash player 7 (OCX version). The same code (written in Flash MX) works absolutely fine in Flash player 6 (both stand alone and OCX) and the Flash 7 stand-alone version.
What could be going here? Is this a Flash player issue? Has Macromedia changed the event behaviors or are we missing something here! What surprises us is the fact that the Flash 7 stand-alone and OCX player behavior is different!
We would be delighted to have any solution/fix that doesn’t require us to modify/recompile the code.
All suggestions are welcome!
Regards,
Varun
OnClipEvent(load) And OnClipEvent(enterFrame)
Hi all,
I'm using the code contains onClipEvent(load) and onClipEvent(enterFrame) and duplicateMovieClip() to make the snowing effect in the 2 first movie-clips but then, i cannot stop them in the next movie-clips. (All of my movie-clips in 1 scene only.)
Please help!
OnClipEvent(load) And OnClipEvent(enterFrame)
Hi all,
I'm using the code contains onClipEvent(load) and onClipEvent(enterFrame) and duplicateMovieClip() to make the snowing effect in the 2 first movie-clips but then, i cannot stop them in the next movie-clips. (All of my movie-clips in 1 scene only.)
Please help!
Script Don't Work "onClipEvent Load" But On "on Release"
Hi folks,
quick question to the pros. I have a problem with an action that I use to load an external SWF file in.
The script I use works great on a button but not onClipEvent (load).. Why?
WORKS:
on (release){
loadMovie("floorplans/301.swf","targetMc")
}
DON'T WORK:
onClipEvent (load) {
loadMovie("floorplans/301.swf", "targetMc");
}
Thanks,
David
OnClipEvent?
i'm trying to make a seceret link;
ie. hold down 4 keys and this will load another movie
any clues???
OnClipEvent
anyone know why the following script works with the loadMovieNum but not with the gotoAndPlay??
very frustrating -
onClipEvent (enterFrame) {
if ((Key.isDown(82)) && (Key.isDown(83)) && (Key.isDown(85)) && (Key.isDown(75))) {
loadMovieNum ("rubicon.swf", 0);
}
}
onClipEvent (enterFrame) {
if ((Key.isDown(82)) && (Key.isDown(83)) && (Key.isDown(85)) && (Key.isDown(75))) {
gotoAndPlay ("rubicon", 1);
}
}
thanx in advance, nick
OnClipEvent .......help
I have a ball that is following my mouse. I would like the ball no to go outside a bounding box. I almost have it working. The below code works. Only thing is, once the ball hits any part of the bounding box it sticks to the edge and the else statement won't execute. Any help on getting the ball not to stick to the edge? Thanx in advance guys!
onClipEvent (enterFrame) {
if (this._x>570 || this._y>349 || this._x<248 || this._y<247) {
} else {
xDistance = _root._xmouse-_x;
yDistance = _root._ymouse-_y;
this._x += (xDistance)*.015;
this._y += (yDistance)*.015;
}
}
OnClipEvent
Im having a problem with onClipEvent. Whe ni try to put it in i cant type anything after it. Im using flash 5. Please help.
OnClipEvent Bug?
I have a movie clip which uses onClipEvent(enterFrame) to check the state of a variable loaded from an asp file to determine if a visitor has logged in. It was working peacefully until I added a pre-loader scene to the main movie timeline with the if FrameLoaded loop. Now the onClipEvent movie clip is not working. Help!
OnClipEvent.......what Does It Do?
Are there any tutes out there that explains the different functions of the OnClipEvent? I'm not sure how/why it is used or what the different events mean. ie: What is enterframe vs. load?
Thanks
OnclipEvent ?
I have two mc's. Instance names are box1 and box2. I also have a dynamic text box named test. Here is the code on box2. All elements are on the _root, but the text is not showing up in the textbox. Do I have this code in the wrong place? Is enterframe wrong? Thanks for your help.
Code:
onClipEvent (enterFrame) {
if (hitTest(box1)) {
var test = "This is where the box stops.";
} else {
var test = "keep going.";
}
}
OnClipEvent
I have an
onClipEvent (mouseDown) {
-->some actions
}
the question: Is it possible to have the "some actions loop, inside the onClipEvent? So when the mouse is down the actions inside the onClipEvent will loop. Thanks.
OnClipEvent
Is the onClipEvent only used in SmartClips??
I can't get it from being dim???
Thanks for any help
OnClipEvent Fun
I have a vertical nav bar that I've attached some actions to:
onClipEvent (mouseDown) {
targetX = _root._xmouse;
targetY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (targetX-_x)/5;
_y += (targetY-_y)/5;
}
this code tells the nav bar to move to the point where the mouse was clicked, and to gradually come to a stop while doing so.
What's wrong with this, is that when the user clicks one of the buttons, it moves ever so slightly, because of the code above.
Basically, what I'm looking for is some code that tells the onClipEvent code attached to the MC of the nav bar to stop executing the code if the mouse gets pressed on one of the buttons.
Thanks for your help.
-A
OnClipEvent
When do I have to use "onClipEvent" and when only "on"?
OnClipEvent
I was trying to do something like this:
onClipEvent(enterFrame)
{
i=Random(100);
if(i==5)
{
//do some stuff
}
}
Its on a movie clip, but the code is only executing once. I wanted to have it execute at every frame. Any ideas? Thanks.
OnClipEvent (key.Down)?
I have 4 Movie Clips and each one has a sound file that starts in the middle of the movie. Using the onClipEvent(key.Down) I have tellTarged each movie to Play.
If I hit the buttons too fast, the current movies sound file won't stop and it will overlap the new movies sound file.....How can I stop this from happening??
Also the new movie won't start either till the sound from the previous movie stops. This wasn't happening till I added the sounds files?
Any help would be appreciated......Thanks
Onclipevent Help
hi can anyone me :
Take a look at this
http://www24.brinkster.com/markdawson/
As you can see from the swf file on click of the buttons
the box scales but is there away to on click of a button to check if the movie is scaled if so then scale down to show all boxes and then back up to the new position.
thanks in advanced
OnClipEvent
I am wondering how does onClipEvent work?
THe thing is I put a action keyframe on an mc instance, telling it, and another mc instance to play when it arrives to that frame.
Within these mc, there are STOP actions, but how come when the onClipEvent triggers them to play, they keep playing THROUGH the Stop actions?
OnClipEvent
Hi,
Is there a way to use more options with the onClipEvent?
e.g. I want to move the movie forward with mouseDown but also with every other key (keyDown).. is there a way to trigger both??
OnClipEvent ......
Hi,
I have a movie clip, with several movie clips inside. Each movie clip inside is used as a 'button'; but is set as a movie clip for more control.
so,
---------------------------------------------------------------
Home Portfolio Services Clients
__________________________________________________ _____________
each of the text headers is a separate movie within the box -which is also a movie- .... what I'm doing is controlling the movies inside with something like :
// CODE
onClipEvent(enterFrame)
{
if (home.hitTest(_root._xmouse, _root._ymouse, true))
{
home.gotoAndPlay(2);
}
}
//
On mouse over, it goes to frame 2 of the movie home and plays the 'on mouse over' effect I want. Now what I need, is a way to take it back to frame 1 of movie home and stop when the mouse exits the area. In sum, I need the REVERSE of the code above ...
Anybody know!??
Thanks!!
Onclipevent Of Just If?
ok im working on a very simple rpg. if i want to run a script at the beginning at a battle, that would constantly check both players HPs for >0. can i just put an if statement on frame 1 thru the end of the battle?
OnClipEvent
how do you do a onClipEvent for flash 4 or something similar to it.
If anyone knows anything remotely close to it please let me know ASAP, have a project due tommorrow and it has to play in flash 4, right now it only plays in 5 and 6.
Please help.
OnClipEvent SOS
Hi!
I'm using loadVariablesNum("vars.txt", 0 ) and loadVariables("vars.txt", "_level0/myClip") but can't seem to access any of the defined variable names in the onClipEvent(load) using the trace method.
However, if I add a button on my movie clip and trap the on(press) event I can see my variable using the trace method.
Please help,
Thanks!!
Onclipevent
What's the deal with "onClipEvent (load)" or "onClipEvent (keyDown)"? I do it just as the tutorial says to but I get this error message: "Clip events are permitted only for movie clip instances". Help?
OnClipEvent
when I using the onClipEvent in FlashMX it says -- You must export your movie as Flash 5 to use this action. There are several other actions highlighted this way. What does it all mean?????
What does this mean and how can I get around it?
DD
OnClipEvent?
This Flash MX is driving me Crazy!!! I'm trying to use this code to do something very basic.
onClipEvent (mouseDown) {
nextScene();
}
It will not work!!! What am i doing wrong? I have another scene and it's place in the action script (F9) of a movie.
OnClipEvent..........help
ok,
i wanna make a short game in flash by using actionscript (daaaa)
and i wanna make it so when i press left on the keyboard that it plays the movie clip of a person walking left.
then if i wanna turn right i press right and then it plays the movie clip that has the person walking right.
if ya get what im saying then plz help me with the best tutorial that you know of or anyinfo that you know.
thnx
if ya wanna send me anything here is me email:
stick_death@hotmail.com
thnx again
later!!!!!!!!!!!!!!!!!!!!
OnClipEvent
I have the following attached to a movie clip (Flash MX):
onClipEvent (load) {
var oneY = _y+_height+-101;
var twoY = _y+-60;
var velocity = 2;
_y = twoY+-10;
}
onClipEvent (enterFrame) {
if (hitTest(_root._xmouse, _root._ymouse)) {
_y += (twoY-_y)/1.5;
} else {
_y += (oneY-_y)/velocity;
}
}
Everything is working fairly well... just a couple of things.
When I move under the movie and out of the Flash file actually it doesn't close - any thoughts on why that would happen?
Help With OnClipEvent
I have a piece of code written to make a movie clip pop out of the side when the mouse rolls over it, and then go back when the mouse leaves the menu. The only problem seems to be that within my if statement only gets executed once. I have it set to execute the if when the mouse moves. But it only does it once. After it completes the if statement, when the mouse moves again, it never re execute the if statement. Here is the code, which is attached to the menu movie clip which is on the main stage.
onClipEvent (mouseMove) {
if (_root.menu.currentframe == 10) {
gotoAndPlay("_root.menu", 13);
} else if (_root.menu._currentframe == 1 & _xmouse<-140 & _ymouse>-310 & _ymouse<310) {
gotoAndPlay("_root.menu", 1);
}
}
Anyone know what I can do to make it rerun this if statement every time the mouse moves?
_x And _y OnClipEvent(?)
How would I go about making the lines following the mouse found here at the top of the page ??
Thanks.
Onclipevent
Hey what is the purpose of loading using the onClipEvent(Load) if you want to load variables. Why not just write them out from the beginning rather than wait. What benefit could be derived from that? Thanks
OnClipEvent
Does anyone know why this code dosen´t work?
onClipEvent (loadMovieNum ("klipp1.swf", 1))
OnClipEvent() Help Please
hi, i know that when you use the onclipevent handler with enterFrame, it works at the movie frame rate. but what about the others, i have read a few books but they do not explain it very well. can some1 give me a link to a good site that explains then, or if possible can some1 explain it to me. thanks
---Sri---
OnClipEvent
Hello! I was wondering if someone could help me. I am using the script below and what I want to do is have SEVERAL buttons with the same instance name ["inner"] driving the movieclip. I have tried but what happens is only one (the one drawn earliest) of the instances will be able to drive the clip at a time. Any suggestions?
Thanks in advance!
onClipEvent(load)
{
dir = 0;
speed = 7;
original._alpha = 0
_root.inner.onRollOver = function()
{
dir = 1;
}
_root.outer.onRollOut = function()
{
dir = -1;
}
useHandCursor = false;
}
onClipEvent(enterFrame)
{
temp = original._alpha + speed*dir;
original._alpha = Math.min(100,Math.max(temp,0));
}
OnClipEvent
hi
i'm playing with the below code:
// ON the movieclip
onClipEvent (mouseDown) {
_root.xscale = 200;
_root.yscale = 200;
}
onClipEvent (enterFrame) {
this._xscale += (_root.xscale-this._xscale)/7;
this._yscale += (_root.yscale-this._yscale)/7;
}
(courtesy of a pellepiano thread)
and would love to know how you can go back and forth from 200%
(written in the code) to 100% via a mouse press.
any help would be much appreciated.
thanks
jeff
OnClipEvent
Hi,
how can i write this in actionscript 2.0?? so i can run it from a frame and not on a movie clip?
onClipEvent (load) {
// do something
}
cheers.
G
OnClipEvent (help)
Modifying a template. Navigation menu is made of movie clips with actionscript applied. They are all the same except for the onClipEvent... those are
Code:
onClipEvent(load) {
num=1;
}
each one has a different number after num=(1 2 3 4) I have figured out these go to timeline frames marked as instances. example, num=3 goes to the frame on the timeline marked as p3.
I have added a new item in this navigation menu and need to link it
BUT this new link is in a new scene. I labeled a frame in that new scene p6. How do I write the code to got to frame p6 of the new scene?
If I do that then I'll have to change the code in all of them in scene2 in order to go back to scene1- correct?
OnClipEvent ?
The saga continues....
In the latest installment, i am still trying to get the piano working with both and upstate and downstate and the appropriate sound playing for the duration of the key press.
Here is the error flash is throwing out:
**Error** Scene=Scene 1, layer=keys, frame=1:Line 1: Statement must appear within on/onClipEvent handler
stop();
**Error** Scene=Scene 1, layer=keys, frame=1:Line 2: Statement must appear within on/onClipEvent handler
var soundkey1:Sound = new Sound();
**Error** Scene=Scene 1, layer=keys, frame=1:Line 3: Statement must appear within on/onClipEvent handler
soundkey1.attachSound("C");
Total ActionScript Errors: 3 Reported Errors: 3
I know this is probably something simple or atleast i hope so.
The code that i have entered on the first key is the new code i was recommended to try out to get it working:
stop();
var soundkey1:Sound = new Sound();
soundkey1.attachSound("C");
on (press) {
this.gotoAndStop("downstate");
//
soundkey1.start();
}
on (releaseOutside, release) {
this.gotoAndStop("upstate");
stopAllSounds();
}
on(dragOut) {
this.gotoAndStop("upstate");
stopAllSounds();
}
If i can just get the upstate/downstate + sound working i will be a very happy man!
I have put the flash file here (I apologize for the size, 3.75mb this is due to the sound clips i have imported for the first octave):
http://s39.yousendit.com/d.aspx?id=0...60WDZ8VKW75CQZ
~angrymice
|