Welcome to TalkGraphics.com
Results 1 to 10 of 33

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Location
    Israel
    Posts
    2,538

    Default Assigning Actions Withing a MovieClip

    Hello,

    Is it possible to create an action withing a movie clip that, when it reaches it's final frame will play another the next frame withing the scene, OUTSIDE the movie clip?

    I mean that instead of making one long frameset file, or using the LoadMovie command, I want to place several movie clips on my scene on different frames (example: MC1 on frame 1, MC2 on frame 2 etc...) and I want to create a code withing each MC (for example each will have animation of 25 frames) that when it reaches it's final (25th) frame it will stop and go to the second frame on the scene which contains MC 2. I want it to be without user interaction.

    I've tried to use the string:

    onClipEvent (enterFrame) {
    gotoAndStop ("scene1", "instanceframe");
    }

    OR

    onClipEvent (enterFrame) {
    gotoAndStop (_root.2);
    }

    Something like that. But it doesn't work.... any ideas?

    Regards,


    Availor
    IP

  2. #2
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    8,659

    Default Re: Assigning Actions Withing a MovieClip

    It's not usual to do what you are trying, because the best way to approach this would be to set an interval on the main timeline,which would move the time line on after a set period (when the nested movieClip has played to the end). Your current method makes every nested movieclip responsible for controlling the parent.

    Anyway, try using _parent.nextframe() .

    Let me know how you're getting on. If it proves difficullt I'll make an example.

    Paul
    IP

  3. #3
    Join Date
    Nov 2004
    Location
    Israel
    Posts
    2,538

    Default Re: Assigning Actions Withing a MovieClip

    Hello pauland, thanks for your reply.

    The _parent.nextframe (); synthax does not seem to work. The whole idea was to create as few frames as possible. For example, Make a project out of 4 frames while each frame on the scene will contain a movie clip. Now if I have a large file with several movie clips, if I decide to shorten the MC then I need to delete frames in the main scene. Moreover the timeline becomes too long and clumsy to work with. It's like giving a keyframe it's name, so instead of using gotoAndStop (1) it's better to use an instance name, so if you decide to move this frame it will no longer be 1 and we are into a long find&replace...

    Anyway, I am sure it is possible. I've searched in the help file with no use.
    It can be done inwards, so there must be a way to do so outwards as well....

    Thanks again,

    Availor.
    IP

  4. #4
    Join Date
    Mar 2006
    Posts
    1,570

    Default Re: Assigning Actions Withing a MovieClip

    Sounds like a game function with animated sprites. Will have to ponder that bit.
    IP

  5. #5
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,932

    Default Re: Assigning Actions Withing a MovieClip

    Hi Availor

    This is easy using Pauls setInterval example.

    There's a great example of using setInterval on learnflash.com/ this week. You have to register, but it's an excellent resource that sends yo a free tutorial every week. They don't seem to mind if you never purchase their courses, just keep sending you a tutorial a week.

    You could also place each MC on an individual frame on the main time line (as you've alreadty suggested) but give each frame a stop action.

    Now in each individual MC, on the last frame of the mc

    _root.play();

    I think this should work, but I haven't checked it out.

    EDIT: Yes that does work, just tested it.


    Pauls next frame should work as well, but the syntax should be

    _parent.nextFrame();

    With an uppercase F


    onClipEvent (enterFrame) executes as soon as the mc is loaded so it's not the way to go here.
    Last edited by Egg Bramhill; 04 June 2006 at 02:00 AM.
    Egg

    Minis Forum UM780XTX AMD Ryzen7 7840HS with AMD Radeon 780M Graphics + 32 GB Ram + MSI Optix Mag321 Curv monitor
    + 1Tb SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host
    IP

  6. #6
    Join Date
    Sep 2000
    Location
    Bracknell, UK
    Posts
    8,659

    Default Re: Assigning Actions Withing a MovieClip

    IP

 

 

Bookmarks

Posting Permissions

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