Page 1 of 1

Error Message

Posted: 07 Apr 2010, 13:20
by mrnothersan
Hello,

When I try and make an object for my room and attach this ActionScript code to it: myContainer.loadMovie("test.swf"); --it comes up with this Compiler Error message: Statement must appear within on/onClipEvent handler.

Could somebody help me with this error?

Thanks
Dominic

Timeline?

Posted: 07 Apr 2010, 17:33
by ParkerJ
This is on the time line no?

Or is it on a movieclip somewhere.?

~Parker

Posted: 07 Apr 2010, 17:45
by mrnothersan
Hello,

I have inserted a square on Flash and converted it to a Movieclip. When I test the file, It is giving the error as a compiler error.

Thanks
Dominic

Re: Error Message

Posted: 08 Apr 2010, 06:39
by mrnothersan
mrnothersan wrote:Hello,

When I try and make an object for my room and attach this ActionScript code to it: myContainer.loadMovie("test.swf"); --it comes up with this Compiler Error message: Statement must appear within on/onClipEvent handler.

Could somebody help me with this error?

Thanks
Dominic
Could somebody please answer this?

Posted: 08 Apr 2010, 08:30
by rjgtav
where did you put the script? in the timeline or in the movieclip?

Posted: 08 Apr 2010, 16:21
by mrnothersan
rjgtav wrote:where did you put the script? in the timeline or in the movieclip?
I clicked on the movieclip (square) and put the script into there.

Thanks
Dominic

Posted: 09 Apr 2010, 18:51
by coolboy714cp
I assume it is in the MovieClip. That error just means you have to put a handler into the coding.

Try this code:

Code: Select all

onClipEvent (load) {
myContainer.loadMovie("test.swf")
}
Make sure the files are located in the same exact directory.

~Cool Boy 714

Posted: 10 Apr 2010, 06:04
by mrnothersan
Thanks CoolBoy, I will try that now.

Posted: 10 Apr 2010, 06:24
by mrnothersan
coolboy714cp wrote:I assume it is in the MovieClip. That error just means you have to put a handler into the coding.

Try this code:

Code: Select all

onClipEvent (load) {
myContainer.loadMovie("test.swf")
}
Make sure the files are located in the same exact directory.

~Cool Boy 714
That doesn't work :( --Any other ideas? :)