A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: changing timeline variables from movie clip

  1. #1
    Registered User
    Join Date
    Jul 2022
    Posts
    3

    Red face changing timeline variables from movie clip

    Untitled-4.png

    uh this is probably a really easy fix but i cant figure it out for the life of me i have a movie on the normal uh root timeline and it has a boolean with it called movement and the movie clip has got 2 more movie clips in it so like 3 timelines i need to make so it on the last frame of the last movie clip its sets the boolean back on the the begining movie clip on the root timeline to true but i dont know how ive tried

    MovieClip(this.parent).movement = true;
    root.movement = true;
    _parent._parent.movement = true;

    i dont know what the hell im doing some one help me out
    thanks in advance to anyone who respods

  2. #2
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,284
    I have it for AS3 here:

    Ok the root movieclip is called main_mc

    Inside of the main_mc movieclip is 1 keyframe with this line:
    PHP Code:
    var BALLS=false
    Inside of the main_mc movieclip is 1 movieclip called mc1

    Inside of mc1 is 2 keyframes, the second keyframe has a stop();

    The second keyframe of mc1 has a movieclip in it called mc2

    mc2 has 6 keyframes, the first keyframe has this line:
    PHP Code:
    MovieClip(MovieClip((root).stage.getChildAt(0)).getChildByName("main_mc")).BALLS=true 
    The 6th keyframe of mc2 has this line:
    PHP Code:
    MovieClip(MovieClip((root).stage.getChildAt(0)).getChildByName("main_mc")).BALLS=false
    MovieClip
    (MovieClip((root).stage.getChildAt(0)).getChildByName("main_mc")).mc1.gotoAndStop(1
    Hope that helps.


    Here is another thing I did to set up a sequence, on the root timeline I wrote this:
    PHP Code:
    stage.addEventListener(Event.ENTER_FRAME,loop);
    function 
    loop(e:*){
    trace(main_mc.BALLS)

    For mc2 you can put this on the 6th keyframe:
    PHP Code:
    MovieClip(MovieClip((root).stage.getChildAt(0)).getChildByName("main_mc")).mc1.gotoAndPlay(1
    The output will look like this:

    HTML Code:
    false
    true
    true
    true
    true
    true
    false
    true
    true
    true
    true
    true
    false
    true
    true
    true
    true
    true

    download 0.1
    Last edited by AS3.0; 07-30-2022 at 03:36 PM.

  3. #3
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,284
    I have an AS2.0 version here:

    Ok the _root movieclip is called main_mc

    Inside of the main_mc movieclip is 1 keyframe with this line:
    PHP Code:
    var BALLS:Boolean=false
    Inside of the main_mc movieclip is 1 movieclip called mc1

    Inside of mc1 is 2 keyframes, the second keyframe has a stop(); command

    The second keyframe of mc1 has a movieclip in it called mc2

    mc2 has 6 keyframes, the first keyframe has this line:
    PHP Code:
    _root.main_mc.BALLS=true 
    The 6th keyframe of mc2 has this line:
    PHP Code:
    _root.main_mc.BALLS=false
    _root
    .main_mc.mc1.gotoAndStop(1); 
    Hope that helps.


    Here is another thing I did to set up a sequence, on the _root timeline I wrote this:
    PHP Code:
    onEnterFrame=function (){
    trace(main_mc.BALLS)

    For mc2 you can put this on the 6th keyframe:
    PHP Code:
    _root.main_mc.BALLS=false
    _root
    .main_mc.mc1.gotoAndPlay(1); 
    The output will look like this:
    HTML Code:
    true
    true
    true
    true
    true
    false
    true
    true
    true
    true
    true
    false
    true
    true
    true
    true
    true
    download 0.1 for as2

    Sorry I initially thought you asked for it in AS3 as you wrote root , this should be what you needed.
    Last edited by AS3.0; 07-30-2022 at 04:05 PM.

  4. #4
    Registered User
    Join Date
    Jul 2022
    Posts
    3
    Thnak you so much ive been looking this up for ages with no asnwe
    youre a legend

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