PDA

View Full Version : Call a function


slen
07-17-2005, 03:13 PM
Hello:

I am new to flash as well as actionscript. I have a question about function/method.

I have 2 movieclip, A and B. I would like to call a function from A to B. Can I do that? I tried several time. My code complaint or function was not being called. I don't know how I call a function in actionscript. I am very confused with this. Can anyone help? Please give me some direction

Thanks

slen
07-18-2005, 01:33 AM
Hello:

Can anyone help me with the problem above?

Thanks

Rebel7284
07-18-2005, 04:51 AM
if the functions are inside the movie clips, you need to call them by giving the full path to the movie clip instance.
for example _root.clipA.functionA(); or _parent.clipA.functionA();

slen
07-21-2005, 03:26 AM
Thanks for your reply.

I tried your method, but it doesn't work

This is how I call a function ... in ClipA
_root.image_mc.loadingPicture(myname);

This is how the function written in another image_mc
function loadingPicture(myname) {
trace(Myname);
image_scroll.contentPath = Myname;
}

Note: image_scroll is a scrollPane component in the image_mc

Please help me ...

Any suggestion

csdstudio
07-21-2005, 09:52 PM
Did you name the instances of the movie clips with unique names?

slen
07-22-2005, 01:57 AM
Yes .. it is a unique name