Yes, you can do that, but you need to pass the scope address of the
movie clip (the one which) has the function to the class. Usually, just
pass the scope as a movie clip through the constructor function:
class TheClass{
public function TheClass(target:MovieClip){
target.doSomething();
}
}
In your timeline:
var myClass:TheClass = new TheClass(myClip_mc)
Jason Merrill
Bank of America
Learning & Organization Effectiveness - Technology Solutions
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:flashcoders-
>>[EMAIL PROTECTED] On Behalf Of ilteris kaplan
>>Sent: Wednesday, August 16, 2006 6:22 PM
>>To: Flash Lists
>>Subject: [Flashcoders] timeline function call from inside of a class
>>
>>Hi List,
>>
>>I am trying to call a function I have created on the timeline of some
>>movieclip from inside of a class I have created. It looks like I
>>cannot do that, as it is giving me undefined when I trace the
>>function. Is this doable in AS2.0 or not? Is there workaround I
>>should follow and please enlighten me if I am missing something!
>>
>>as a code example:
>>
>>in my _root.main :
>>function foo() {
>> trace("foo");
>>}
>>
>>and in my class I am trying to access this function by;
>>_root.main.foo();
>>
>>***
>>is this doable?
>>
>>
>>
>>thanks in advance
>>ilteris kaplan
>>
>>_______________________________________________
>>[email protected]
>>To change your subscription options or search the archive:
>>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>>Brought to you by Fig Leaf Software
>>Premier Authorized Adobe Consulting and Training
>>http://www.figleaf.com
>>http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com