A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: gotoAndPlay any movieClips timeline in Library

  1. #1
    Member
    Join Date
    Nov 2010
    Posts
    51

    gotoAndPlay any movieClips timeline in Library

    Hello

    I was wondering if there is a way to tell flash to navigate to a movieclips timeline without that movie clip being on stage or having an instance...

    For example i have MovieClip1 in my Library and its named MovieClip1...but its not located on the stage...

    Can my button gotoAndPlay MovieClip1 frame 20?

    I tried it but it doesnt work....

    Is this even possible? Thanks

  2. #2
    Senior Member hts5000's Avatar
    Join Date
    Oct 2007
    Posts
    160
    No this is not possible. Without an instance name you can’t reference the movie clip. Maybe there is another way to do what you want. I am curious why you would want to play a movie clip that can’t be viewed.

  3. #3
    Member
    Join Date
    Nov 2010
    Posts
    51
    Hi thanks for your time...

    I will upload the file to understand what i mean and explain clearer

    I got a Website.as file that loads 4 library's movie clip's on the stage in certain positions.. Clip_A, Middle, Menu, Clip_D

    Clip_A loads on the top left side , Menu on top right , Middle in Middle and Clip_D low right position.

    What i need to do and understand is how can i tell this class to find a button inside Menu and play a certain frame in Middle?
    I added this code in Website.as but i get errors

    menu.menu_buttons.about_us.addEventListener(MouseE vent.CLICK, about_us_onClick);
    function about_us_onClick(event:MouseEvent):void
    {
    middle.gotoAndPlay(215);
    }


    the error i get is this

    1046: Type was not found or was not a compile-time constant: MouseEvent.

  4. #4
    Member
    Join Date
    Nov 2010
    Posts
    51
    file
    Last edited by Code_is_Insane; 11-24-2010 at 04:37 PM.

  5. #5
    Member
    Join Date
    Nov 2010
    Posts
    51
    Hi ..i fixed the error

    i forgot to import flash.events in the .as file .... but i still cant get that button to work!

  6. #6
    Senior Member hts5000's Avatar
    Join Date
    Oct 2007
    Posts
    160
    Unfortunately I cannot open your fla (I only have CS3). I should have asked this first but are you using AS2 or AS3? Also, maybe you could save your fla as an older CS version?

  7. #7
    Member
    Join Date
    Nov 2010
    Posts
    51
    Hi buddy...thanks again for your feedback

    I resolved it!

    Im using AS3 and CS5... the issue was that i had to import the mousevent.as in my .as file, i forgot to do that! Deadly mistake

    And then used Protected function on the button

    It all works fine...thank you so much for your time!

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