dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Access timeline functions from inside a class

  1. #1
    Junior Member
    Join Date
    Oct 2010
    Posts
    13

    Access timeline functions from inside a class

    As above is there a way to access any function written inside main timeline from a class ?

    for example:
    main timeline frame 4:

    PHP Code:
    function foo()
    {
        
    trace("foo");

    Class

    PHP Code:
    package{

    import flash.display.*;

    public class 
    SomeDisplayObjectClass extends MovieClip
    {

        public function 
    SomeDisplayObjectClass()
        {
        
    stage.foo(); /*error 1061: Call to a possibly undefined method foo through     a reference with static type flash.display:Stage.*/

        
    }

    }


    Is there any other way to do this?

  2. #2
    Member
    Join Date
    Sep 2009
    Posts
    57
    I am not exactly sure what you are trying to achieve but you can call a function after a tween using the onMotionFinished code. This helps play or toggle a function in the main timeline. Hope this helps out at least at a remote level.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center