butterhook
asked on
Calling function within movieclip from _root level
Seems like a stupid question but.....
1. I have created a movie clip
2. Inside that movie clip I have defined a function, in this case call it this
function TestDemo(ImageURL:String): Void {
trace(ImageURL);
}
3. I have created two instances on the _root level, named 'ClipOne' and 'ClipTwo'
4. When I call my function from the _root level like this:
ClipOne.TestDemo("credits/ 1.jpg");
ClipTwo.TestDemo("credits/ 2.jpg");
Nothing seems to happen at all, I don't get the trace result at all.
Is there something stupid I have done, or can I not call a function like this in Studio 8? I did it all the time in Flash 5.....
Cheers,
Butterhook
1. I have created a movie clip
2. Inside that movie clip I have defined a function, in this case call it this
function TestDemo(ImageURL:String):
trace(ImageURL);
}
3. I have created two instances on the _root level, named 'ClipOne' and 'ClipTwo'
4. When I call my function from the _root level like this:
ClipOne.TestDemo("credits/
ClipTwo.TestDemo("credits/
Nothing seems to happen at all, I don't get the trace result at all.
Is there something stupid I have done, or can I not call a function like this in Studio 8? I did it all the time in Flash 5.....
Cheers,
Butterhook
ASKER
Found the problem - I was attempting to call the function in the first frame of the _root timeline. Moved it to the second frame and it worked perfectly. Thanks
good to know that you solved your problem :)
--trigger-happy
--trigger-happy
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
--trigger-happy