|  | error: Statement must appear within on/onClipEvent handler |  | |
| | | webhildutza |  |
| Posted: Mon Jun 23, 2008 5:38 pm Post subject: error: Statement must appear within on/onClipEvent handler |  |
I'm getting this error Scene=Scene1, Layer=Layer 3, frame=1, Line1 Statement must appear within on/onClipEvent handler shape.swapDepths(_root.getNextHighestDepth());
i'm using this code: shape.swapDepths(_root.getNextHighestDepth()); //shape is a movie clip
stop(); this.attachMovie('bcPlayer','bcPlayerInstance',this.getNextHighestDepth()); //bcPlayerInstance._xscale = 75; //bcPlayerInstance._yscale = 75; bcPlayerInstance._y = -50; bcPlayerInstance._x = -5; //bcPlayerInstance is a movie clip
please help anyone knows what i'm doing wrong |
| |
| | | DMennenoh **AdobeCommunit |  |
| Posted: Mon Jun 23, 2008 5:40 pm Post subject: Re: error: Statement must appear within on/onClipEvent handl |  |
| Quote: | shape.swapDepths(_root.getNextHighestDepth());
|
swapDepths does not take a number, it takes another movieClip reference.
-- Dave - LINK Head Developer LINK Adobe Community Expert LINK |
| |
| | | Rothrock |  |
| Posted: Mon Jun 23, 2008 9:35 pm Post subject: Re: error: Statement must appear within on/onClipEvent handl |  |
Actually swapDepths can take either a moveclip or a number. That isn't the problem.
The problem is that you put the code directly on a movie clip and not on a timeline. Select the "shape" instance and bring up your Actionscript window. Then click off the shape (and make sure you don't click on anything else except empty stage.) Then select the frame in your timeline where you want the code. You will know it is correct because at the top of the actionscript window it will say Frame. Then paste your code. |
| |
| | | DMennenoh **AdobeCommunit |  |
| Posted: Tue Jun 24, 2008 6:07 pm Post subject: Re: error: Statement must appear within on/onClipEvent handl |  |
| Quote: | Actually swapDepths can take either a moveclip or a number. That isn't the problem.
|
So it can! Sorry, just never used it with anything besides a clip ref, and even then I really don't use it much as I like to keep track of things myself.
Thanks
-- Dave - LINK Head Developer LINK Adobe Community Expert LINK |
| |
|
|