Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Calling function within movieclip from _root level

Posted on 2006-06-09
5
Medium Priority
?
166 Views
Last Modified: 2010-04-03
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
0
Comment
Question by:butterhook
  • 2
4 Comments
 
LVL 14

Expert Comment

by:trigger-happy
ID: 16869965
seems perfectly fine to me, i suggest you check your publish settings (file menu). Try to see if the "omit trace actions" check box is checked, if so, uncheck it.

--trigger-happy
0
 
LVL 1

Author Comment

by:butterhook
ID: 16870020
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
0
 
LVL 14

Expert Comment

by:trigger-happy
ID: 16870035
good to know that you solved your problem :)

--trigger-happy
0
 
LVL 1

Accepted Solution

by:
DarthMod earned 0 total points
ID: 17642140
PAQed with points refunded (500)

DarthMod
Community Support Moderator
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to how to record live broadcast.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question