Controll the ROOT timeline from externally loaded movie clip?

does anyone know how to controll the root timeline from an
externally loaded movie clip?
I have loaded a movie clip, which has buttons on it that I
would like to controll the main original website timeline with.
something like this.parent.parent?
thanks a lot
harky

feedmeapples <[email protected]> wrote:
> does anyone know how to controll the root timeline from
an externally
> loaded movie clip?
>
> I have loaded a movie clip, which has buttons on it that
I would like
> to controll the main original website timeline with.
>
> something like this.parent.parent?
_root.doStuff;
Freundliche Grüße,
Franz Marksteiner

Similar Messages

  • Controlling the root timeline from inside a MovieClip

    [preface] I'll apologize in advance. I'm a designer, not a
    developer. I know very little about actionscript so if you
    can help me out, please pretend like I know nothing.
    [/ preface]
    I just need actionscript to check the value of a variable
    when the end of a movie clip is reached and then call an action.
    Here's what I've got and it doesn't work. Please don't laugh.
    if (p == 1){
    tellTarget (_root) {
    play();
    else if (p == 0){
    stop();
    (the "stop" on the "else if"
    is referring to the movie clip's timeline, not the root
    timeline... in case you're wondering)
    Any help would be greatly appreciated. Thanks!

    No it's not a school project. Good guess though. It's
    actually a self-promo piece for the ad agency I work for. I'm an
    art director expanding my horizons. I would take a class or run
    through one of the good actionscript books but unfortunately, I
    don't have time.
    Thanks for the help again kglad.
    btw, I've used tellTarget successfully in a few projects in
    the last few months. I'm using Flash 8.

  • Controlling a Movie Clip on the Main Timeline from a loaded SWF?

    Is it possible to control a MovieClip on the main timelne from another loaded clip?
    I see posts that control loaded clips, but most are all from the loader in the main timeline.  I have a moviclip on the main timeline that I want to make visible or invisible depending on what keyframe is playing in another loaded swf.
    If I try to call the movieClip from the loaded SWF I get "error #1119.  Access of possibly undefined property...." because it doesn't exist in the loaded SWF, just the main timeline. 
    The old AS2 way just used "_root".  Since "_root" doesn't exist any more, how do you control items on the main TimeLine from a loaded SWF?

    I am not clear what you mean because you are saying you are trying to target a movieclip that does not exist where you are trying to target it.
    Try using a trace to see what you are targeting when you you target the MovieClip(parent.parent)....
    trace(MovieClip(parent.parent));
    The other approach I mentioned earlier is the more OOP-correct approach if you would rather try that way.  Here's a rough outline of it...
    AS3 - Dispatch Event
    http://forums.adobe.com/thread/470135?tstart=120
    Example:
    Add something to trigger the event in the child (your loaded swf):
    dispatchEvent(new Event("eventTriggered")); (
    if dispatchEvent problem, see: http://www.kirupa.com/forum/showthread.php?p=1899603#post1899603)
    In your loading/parent swf, listen for the complete event on the Loader.contentLoaderInfo.  In the complete event handler, add a listener for the event on the loaded swf.
    // event handler triggered when external swf is loaded
    function loaderCompleteHandler(event:Event) {
        MovieClip(event.currentTarget.content).addEventListener("eventTriggered", eventHandler);
    function eventHandler(event:Event):void {
        trace("event dispatched in loaded swf");
       // this is where your main file can set the visible property of your movieclip

  • Remove child on the root timeline from within a movieclip

    Hi
    How do I remove a child from the root timeline from within a separate movieclip?
    I've tried
    MovieClip(parent).removeChild(mc1);
    But I get this error
    1120: Access of undefined property mc1.
    I could write a function in the root timeline that just removes child and then run that from within the movieclip but is there a better way?
    Thanks in advance.

    Thanks for replying.
    I asked on Kirupa but I couldn't access the site so I asked here.
    I guy answered with this
    MovieClip(parent).removeChild(MovieClip(parent).getChildByName("mc1"));
    It works fine, is this the best way to do it?
    Not sure if I understand what you meant?
    Just to be clear I have to movie clips on the stage mc1 and mc2 and i want to remove mc1 from within mc2's timeline.
    Thanks again

  • Toolkit for CreateJS: How to control the main timeline from outside the canvas.

    Hey Everyone,
    I'm currently trying to do something simple, but my animation breaks whenever I attempt to change my code. I have created a basic animation in Flash where an object moves from the left side of the canvas, to the right, and then loops from the last frame to the first frame. Nothing else. The animation is simply put on the main timeline. I exported the animation with Toolkit for CreateJS through Flash's extension and the animation runs as it should. I am trying to start and stop (restarting from the first frame) the animation with mouse over and mouse off events. I want the events to fire when moused over/off a div OUTSIDE the animation's canvas tag. Is this possible with CreateJS? I'm trying to figure out how to control the main timeline without being inside the canvas tag.
    Example HTML:
    http://www.thephotoncore.com/testing/example_test.html
    Example Code:
    <section id="container">
      <canvas id="canvas" width="550" height="400" style="background-color:#cccccc"></canvas>
      <section id="animation_control">
        <p>Roll over to start and stop animation.</p>
      </section>
    </section>
    Thanks again for the help!
    -DJ

    Hi DjPhantasy5,
    All movieclips on the stage are children of the stage,
    So on the "mouseover" all movieclips on the stage could be stopped with stop and on the "mouseout" all children could be restarted with gotoAndPlay like this:
    function Stop()
              if (stage && stage.children)
                        var i, l = stage.children.length;
                        for (i = 0; i < l; i++)
                                  var child = stage.children[i];
                                  if ("stop" in child)
                                            child.stop();
    function Restart()
              if (stage && stage.children)
                        var i, l = stage.children.length;
                        for (i = 0; i < l; i++)
                                  var child = stage.children[i];
                                  if ("gotoAndPlay" in child)
                                            child.gotoAndPlay(0);
    See http://www.liauw.nl/forums/adobe/djfantasy5/index.html
    But it is also possible to expose "ball1", for example, by adding it to the document.
    This can be done by adding code to "ball1" like so:
    /* js
    document.ball1 = this;
    Then the stopping of the animation would look like:
    function Stop()
         if ("ball1" in document)
              document.ball1.stop();
    etc.
    Have fun!
    Ronald

  • Going Back to the main frame, from inside a movie clip time line.

    In flash CS5 I want to go back to the main time line, from inside a movie clip button, so when i click the the movie clip it goes to another frame on the main time line..
    Can anyone help me?
    Thanks
    Daniel Derrick

    your can use _root to reference the main timeline from anywhere though that can lead to problems if your swf is loaded by another swf.  because of that eventuality, it would be better to use a relative path back to the main timeline.
    so, from a movieclip's timeline (when the movieclip is on the main timeline), you can use _parent to reference the main timeline.
    but even better would be to use no code on that movieclip's timeline and keep all your code on one timeline (the main one).

  • How do i get an externally loaded movie clip to inherit the playhead position of the main timeline?

    Hi Flash experts, i'm hoping that someone can help me with this annoying problem.....
    I have been approached to design a configurator for a new television product. The Application will let users specify the colours of certain parts of the product and also attach addons, which then updates a cost total.
    In the main interface i have a looping animation of the product slowly rotating around 360 degrees that i rendered in 3ds max. When a user clicks a button on the interface i need to load an external movieclip on top of the main animation so it looks as though a certain part has changed colour, this i have acheived. The problem is that when i load the external clip over the original, the loaded clip starts playing from frame 1 and i need it to inherit the playhead position of the main animation so the two layered pieces look as though they are rotating as one. I'm sure this must be possible, unless i need to approach the problem in a different way?
    I hope this makes sense,
    Any help on this subject would be hugely appreciated.
    Many Thanks
    Matt

    Hi again Ned,
    I've almost got it i think, my code now looks like this....
    on (release) {
             var loader:MovieClipLoader = new MovieClipLoader();
             loader.loadClip("Bezel/Bezel_Red/Bezel_Red.swf",Empty_MC);
             var loadListener:Object = new Object();
             loader.addListener(loadListener);
             loadListener.onLoadComplete = function() {
             Empty_MC.gotoAndPlay(_root._currentframe);
    This code loads the external clip fine and i know the onLoadComplete listener is working because if i change the last line to: Empty_MC.gotoAndStop(1);
    it works. I think its just that last line: Empty_MC.gotoAndPlay(_root._currentframe); that is causing the problem?
    Many Thanks for all your help, it is greatly appreciated
    Matt

  • How to control the main timeline from within a symbol?

    I have a small world map as a symbol called "verden" and I want the user to click Europe, Asia, or Africa and jump to named labels in the main timeline.
    http://www.dagbladet.no/grafikk/neshorn/neshorn.html
    On the main timeline a have the label "intro" with a Stop action and the label "europa". At label "europa" I have a symbol also called "europa" which has a display of None at label "intro" and On at the label "europa".
    The animation never goes to label "europa"
    I have this code on europa in the symbol "verden" :
    // insert code for mouse click here
    sym.getComposition().getStage().getSymbol("europa").play("europa");
    The files are on Dropbox here
    Update, now it works:
    sym.getComposition().getStage().play("europa");

    Hi Bill,
    There are plenty of threads on here about scope, but here's one way to create a global variable:
    // code on Stage.compositionReady
    sym.myGlobalVar = 1;
    Then, anywhere in your project, you can check/set that var like so:
    sym.getComposition().getStage().myGlobalVar = 2;
    And here's one way to create a global function:
    // code on Stage.compositionReady
    sym.myGlobalFunction = function(){
              console.log('myGlobalFunction');
    Then, anywhere in your project, you can call that function like so:
    sym.getComposition().getStage().myGlobalFunction();

  • Attempt to move main timeline from inside a movie clip breaks menu buttons.

    I am attempting to have the main timeline move from a stopped position over a movie clip to frame 1, where my start menu is.
    The code I'm using does move the timeline but in doing so it somehow breaks the 4 buttons I have in frame 1.
    My code in the movie clip:
    stop()
    function replayMovie(event:MouseEvent):void
    MovieClip(parent).gotoAndStop(1);
    Menu.addEventListener(MouseEvent.CLICK, replayMovie);
    My code in frame 1 of the main timeline:
    stop();
    function bo(event:MouseEvent):void
    gotoAndPlay(21)
    SoundMixer.stopAll()
    espesp.addEventListener(MouseEvent.CLICK, bo);
    function ho(event:MouseEvent):void
    gotoAndPlay(31)
    SoundMixer.stopAll()
    espeng.addEventListener(MouseEvent.CLICK, ho);
    function yo(event:MouseEvent):void
    gotoAndPlay(41)
    SoundMixer.stopAll()
    engesp.addEventListener(MouseEvent.CLICK, yo);
    function go(event:MouseEvent):void
    gotoAndPlay(51)
    SoundMixer.stopAll()
    engeng.addEventListener(MouseEvent.CLICK, go);
    The error output when I use my Menu button at the end of the movie clip.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at SSubjunctiveProjNewgrounds_fla::MainTimeline/frame1()
    at flash.display::MovieClip/gotoAndStop()
    at SSubjunctiveProjNewgrounds_fla::Esp_5/replayMovie()
    Any help would be greatly appreciated.

    For the sake of space, I'll leave out all the package declarations and class declarations and just talk about the functions.
    First, the Game class, it has two functions.  The first one is the constructor function and it launches at the beginning of the game:  First the Game function:
    public function Game():void
    //Game code goes here
    }//Game
    We want to listen for someone to click the mouse on the MenuPage, so lets create a new MenuPage and add a listener to the button contiained within it.
    public function Game():void
    menuPage = new MenuPage;
    menuPage.startButton.addEventListener(MouseEvent.CLICK, startGame);
    addChild(menuPage);
    }//Game
    You will notice that before I declared a variable var menuPage:MenuPage, but that's all I did was declare it.  I didn't really make a new instance of it, I just set aside space for it.  In the first line within the Game function, I'm actually turning that variable into a new instance of a MenuPage.
    We don't have a picture of this imaginary menuPage instance, but lets' assume that in our MenuPage MovieClip in the library, we created a SimpleButton called startButton.  Here, I'm adding an EventListener that patiently waits for someone to click that button.  Once we receive that event, Flash is told to call the startGame function.
    As you get better at this, you'll get into custom events, and the eventListener for the button will exist in the MenuPage class file, or even in another class file that you create just for the button.  Something like StartButton.as  But for now, we can do it as above.
    Now the startGame function:
              public function startGame(evt:MouseEvent):void
    //Remove the start Page
    //Add the zombie
    //Add the gun
    }//startGame
    And we'll replace those comments with real code.  It follows along with what we just did above.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    And we also want to clean up some by removing the menuPage, and throwing out the eventListener.
    public function startGame(evt:MouseEvent):void
    zombie = new Zombie;
    addChild(zombie);
    gun = new Gun;
    addChild(gun);
    menuPage.startButton.removeEventListener(MouseEvent.Click,startGame);
    removeChild(menuPage);
    }//startGame
    Now our Game class is complete.
    The Zombie Class
    public function zombieWalk(evt:Event):void
    this.addEventListener(Event.ENTER_FRAME,zombieWalk);
    this.x = this.x + 10;
    }//zombieWalk
    Notice we've added a function to the Zombie Class.
    The first function adds an EventListener to the zombie.  We can use the word this and actionScript knows we're talking about the zombie that the class is written for.  This listener fires off every frame.  If our FLA file is set to 12fps, then 12 times every second it will call on the zombieWalk function.
    The zombie walk function moves the zombie 10 pixels to the right every time the function is called.
    On a more advanced level, you'll want to add animation in the MovieClip to move the zombie legs.  You'll also want to use Timer events to space out how often the funtion fires and not ENTER_FRAME events.  And you'll want to use a static constant to establish how far the zombie moves.  We have it now set to 10 pixels, but that can get irritating if we want to change that value later.  But again, baby steps.
    And finally, the Gun class
    public function Gun():void
    this.addEventListener(MouseEvent.CLICK, fireGun);
    }//function
    public function fireGun(evt:MouseEvent):void
    this.gotoAndPlay(2);
    }//fireGun
    First we add an EventListener for when someone clicks on the gun.  Once this happens, the listener calls on the fireGun function.
    The fireGun function takes advantage of the frames within the Gun MovieClip.  Say we have three frames in the Gun MovieClip.  The first is just a picture of the gun.  The second is the gun with a flash coming out of the nozzle.  And the third is the gun at rest again.  The line this.gotoAndPlay(2) sends the gun to the second frame with the flash graphic.
    For this to work, each frame in the Gun MovieClip has to have some stop and play commands.
    But.. you said no code on our timeline!! Liar!
    I know.  This is the exception.  You will need basic stop() commands and gotoAndPlay commands to loop animations.  Any MovieClip that has more than one frame will need something to control it.
    So our Gun MovieCLip has the following:
    Frame 1: stop();
    Frame 2: no actionScript... and I mean nothing, not even the words, "no actionScript"
    Frame 3: gotoAndStop(1);
    This will loop the gun to the beginning and wait for the next time the user clicks the gun.
    Advanced features of the Gun class might include a Bullet.as sub-class that creates a bullet MovieClip to fly across the screen.  Sound to play when the shooting takes place.  Object collision detection to see if the bullet hits the target.  And a means by which a custom event will tell the Game.as class that a zombie has been hit and it should be removed from the stage.
    As you go down the rabbit hole of ActionScript 3, you will find yourself at a point where it's just a matter of getting the syntax right for all the built in functions and classes.  Arrays, Loaders, casting variable types.. all that stuff will come.
    I hope this has been helfpul.  It's been on my to-do list for a long time.  When I first started out, no one could provide me with basic answers for how all these classes and whatnot worked.  After teaching myself AS3 for 2 years and reading a gabillion books, I think I've gotten to a point where I'm pretty comfortable with it all.

  • Seamless transitions between externally loaded movie clips

    I'm building a flash player that loads various movie clips in succession  depending on user input. The player should continue to play seamlessly  when one clip ends and another starts playing, however there is always a  slight noticeable delay between the COMPLETE event for one clip and the  actual playing of the next clip. I am using the FLVPlayback component to  load the video clips, with successive clips loaded in different players in the component.
    I've tried playing the next video a short duration before the current video finishes by adding a cue point just before the end of the currently running clip (about 200 - 300 ms before the end). This improves matters somewhat, but it is not a reliable method as the timings are different for different browsers and computer specs.
    I was wondering if anyone here has any experience with smooth  transitions between external video clips and could suggest possible  optimizations I could use to improve the transitions.

    Thank you for replying.
    The video clips basically continues the same shot only with different directions, so I can't fade out between transitions. It needs to appear as though it's playing a single video clip in that respect (a one-shot scene).
    Another major issue is that there is music playing for each video which should continue playing without interuptions. Even a small gap is noticeable with audio. I thought about separating the audio and video streams but that could mean they could go out of sync as the more transitions occur.

  • Menus - how do i go to a frame in  the main scene from a loaded movie?

    hi...
    need help... i actually have done this beofre but dont know
    what ia doing worng now..
    i created an intro. this into is a seperte movie loaded into
    my main movie.
    in the intro there is a skip button so that the user can skip
    intor and go to a a frame on the main scene i loaded the movie
    into...
    i tried _root.gotoAndPlay(10) it doenst work...
    i trird )level0gotoANdPlay(10) it doent work...
    please help !
    thanks

    Hi there,
    Normally you use something like:
    loadMovie("intro.swf", intro_mc);
    And then you have to say:
    _root.intro_mc.gotoAndPlay(10);
    The movie that you loaded is in the movieclip. So this should
    work.
    Greeting Guido
    Creation site internet |
    Radin
    |
    Jeux
    Concours |
    Echantillons

  • CONTROLLING THE TIMELINE FROM EXTERNAL MC

    I have a website
    http://www.charlesmarsden-smedley.com/index1.html
    that I am building.
    In the projects section, if you navigate to Projects >
    Museum > Tower of London. You will see 'more information' link.
    This loads an external Movie clip for the text feild. I would
    like to make the 'more information' dissappear when it is clicked
    and the text appears in the target. The way I thought is best is to
    move the timeline on one frame and just remove the link, but when I
    click on 'back to images' link it reloads the images (external MC)
    but the 'more information' link is still hidden.
    How can I control the main timeline from an extrernal movie
    clip?
    Am i being rediculously long about this operation?
    thanks
    Harky

    maybe you didnt understand correctly.
    the 'more information' link loads an external movie clip (the
    text) into the right side of the page.
    At the bottom of this movie clip is a green link 'back to
    images' this button sits within the movie clip. So my problem is
    making this button controll the main timeline (as its root is the
    movie clip root, not the main web page root)

  • Controlling parent movie from a loaded movie

    > This message is in MIME format. Since your mail reader
    does not understand
    this format, some or all of this message may not be legible.
    --B_3264494197_595630
    Content-type: text/plain;
    charset="US-ASCII"
    Content-transfer-encoding: 7bit
    Hi!
    I have a swf file which I call "Stage" and it contains 3
    scenes.
    In scene 1 of Stage, I have another swf- "Info1." loaded on
    level 10. I know
    how to get Info1 to unload and load Info2 but what I am
    trying to accomplish
    is when I click on Info1, it loads Info2 and it also go to
    Scene 2 of Stage.
    Is there anyway I can do this?
    I appreciate any input.
    Thank you.
    K.
    --B_3264494197_595630
    Content-type: text/html;
    charset="US-ASCII"
    Content-transfer-encoding: quoted-printable
    <HTML>
    <HEAD>
    <TITLE>Controlling parent movie from a loaded
    movie</TITLE>
    </HEAD>
    <BODY>
    <FONT FACE=3D"Arial"><SPAN
    STYLE=3D'font-size:12.0px'>Hi!<BR>
    <BR>
    I have a swf file which I call &quot;Stage&quot; and
    it contains 3 scenes. =
    <BR>
    <BR>
    In scene 1 of Stage, I have another swf-
    &quot;Info1.&quot; loaded on level=
    10. I know how to get Info1 to unload and load Info2 but
    what I am trying t=
    o accomplish is when I click on Info1, it loads Info2 and it
    also go to Scen=
    e 2 of Stage. Is there anyway I can do this? <BR>
    <BR>
    I appreciate any input. <BR>
    <BR>
    Thank you.<BR>
    <BR>
    K. </SPAN></FONT>
    </BODY>
    </HTML>
    --B_3264494197_595630--

    Never mind - I was doing something very stupid and wasn't
    calling the function as a method of a movie clip. I was simply
    calling checkTarget(event) rather than
    event.currentTarget.checkTarget(event); which seems to work.

  • Could I connect the lap top to TV and watch movies and control the lap top from a distance?

    could I connect the Apple lap top to my TV to watch movies and control the lap top from a distance just like the Window lap top???

    Check out Apple TV.  It is a wireless interface to your TV.  It may be the best $99 investment you can make for entertainment on your TV.  It simply requires a standard $10 HDMI cable, not supplied with the Apple TV unit.  Through Apple TV, with Mavericks, you can use the TV as a standard OS X monitor or for entertainment.  Also check out the Beamer software to stream videos to it from your Mac.
    Apple TV requires a Mid 2011 or newer MacBook Air with OS X Lion v10.7.5 or later.
    If your MBA is not new enough you can use the AirParrot application but the video quality is not as high as with a newer MBA.  It also streams from iOS devices.
    http://www.apple.com/appletv/
    http://www.apple.com/appletv/airplay/
    http://store.apple.com/us/ipod/ipod-accessories/apple-tv
    http://www.apple.com/osx/whats-new/features.html#displays
    http://www.amazon.com/AmazonBasics-High-Speed-HDMI-Cable-Meters/dp/B003L1ZYYM/re f=sr_1_1?ie=UTF8&qid=1385514116&sr=8-1&keywords=hdmi+cable
    AirPlay is available on all devices running iOS 4.3 or later. Some features require the latest software. Second-generation Apple TV or later required.
    AirPlay Mirroring is available with iPhone 4s or later; iPad 2 or later; iPad mini; iPod touch (5th generation); and iMac (Mid 2011 or newer), Mac mini (Mid 2011 or newer), MacBook Air (Mid 2011 or newer), MacBook Pro (Early 2011 or newer), and Mac Pro (Late 2013) with OS X Mountain Lion or later.

  • I cannot control the sensor on my Mac, it moves by itself, and opens different pages. What can cause this problem? please help me.

    I cannot control the sensor on my Mac, it moves by itself, and opens different pages. What can cause this problem? please help me.

    There are several possible causes for this issue. Take each of the following steps until it's resolved.
    1. Follow the instructions in this support article.
    2. Reset the System Management Controller.
    3. If you're using a Bluetooth trackpad, investigate potential sources of interference, including USB 3 devices.
    4. A swollen battery in a MacBook Pro or Air can impinge on the trackpad from below and cause erratic behavior. If you have trouble clicking the trackpad, this is likely the reason. The battery must be replaced.
    5. There's a report that a (possibly defective) Thunderbolt Ethernet adapter can cause the built in trackpad of a MacBook to  behave erratically. If you're using such an adapter, disconnect it and test.
    6. There's also a report of erratic cursor movements caused by an external display that was connected but not turned on.
    7. If none of the above applies, or if you have good reason to think your computer is being controlled remotely, remove it from the network by turning off Wi-Fi, disconnecting from a Bluetooth network link, and unplugging the Ethernet cable or USB modem, whichever is applicable. If the cursor movements stop immediately, you should suspect an intrusion.

Maybe you are looking for