Error Message

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Post Reply
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Error Message

Post 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
ParkerJ
Posts: 30
Joined: 31 Aug 2009, 23:14

Timeline?

Post by ParkerJ »

This is on the time line no?

Or is it on a movieclip somewhere.?

~Parker
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post 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
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Re: Error Message

Post 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?
User avatar
rjgtav
Posts: 2813
Joined: 19 Apr 2009, 11:31
Location: Lisbon, Portugal

Post by rjgtav »

where did you put the script? in the timeline or in the movieclip?
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post 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
coolboy714cp
Posts: 323
Joined: 06 Feb 2010, 02:45
Contact:

Post 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
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post by mrnothersan »

Thanks CoolBoy, I will try that now.
mrnothersan
Posts: 226
Joined: 24 Jan 2010, 18:38

Post 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? :)
Post Reply