Access the main time line function

Hi all,
In as2 we can use _root to access the main timeline function from the inside some movieclip or button.
In as3 how to access the main timeline function from inside the movieclip or button.can any one please tell me.

"root" is the AS3 equivalent, but using it alone will often not wortk.  You more often need to cast it as some form of object before the compiler will recognize it.  Using "MovieClip(root)" will usually do the trick.

Similar Messages

  • Can I access a label inside of an MC and then go back to the main time line

    Here is my current set up.
    I have a labeled section on main time line which has icons of 12 different videos. Each icon acts as a button and brings a user to a labeled section with a FLV Video Playback component impemented to play the corresponding video. These labeled sections are located on the main time.
    This methog makes my main time line very long. Is there a way to make an additional MC which will hold all the video buttons and then have this MC separated into labeled sections.
    In other words can I access a label inside of an MC and then go back to the main time line?
    My present code for accessing the label located on the main timeline is:
    HowTo_maininfo_mc.theArrangement_btn.addEventListener(MouseEvent.CLICK, theArrangement_btn_amimated_btnDown);
    function theArrangement_btn_amimated_btnDown(event:MouseEvent):void {
    gotoAndPlay("theArrangement");
    How would it look if my label "theArrangement" would be located inside of an MC?
    Is there any specific code if I want to have a close button located on the label inside of an MC and it needs to fire out to a label located on the main timeline?

    Oh, WOW! It is working perfectly now.
    My mistake was that I was specifiying the var sourceVar:String;
    for every single button. It was not clear to me from the first example that it has to be specified only once.
    I made a small test Flash file and everything works now. It still doesn't work on my big flash file, I guess some other code messes it up and I can' not figure what it is exactly.
    I would like to include the OUTPUT error message in hopes that you can spot right away what a mistake could be:
    VideoError: 1000: Unable to make connection to server or to find FLV on server
              at fl.video::VideoPlayer/stop()
              at fl.video::FLVPlayback/stop()
              at acolyteVideos_fla::mainsite_mc_2/stopF2()[acolyteVideos_fla.mainsite_mc_2::frame484:21]
              at flash.display::MovieClip/gotoAndPlay()
              at acolyteVideos_fla::mainsite_mc_2/onClick_GoBackToHowTo2()[acolyteVideos_fla.mainsite_mc_2 ::frame484:13]
    If there is no immediate cure for it, I will go through code line by line. Since it is working on the test it must be something wrong with my main file.
    Additiona question (please let me know if I should paste it as a new thread)
    I have similar set up with UILoader. Where different buttons set up to bring a user to individual labeled sections with individual UILoader. Should it be arranged in the same way that it is only one loader and "var sourceVar:String;" code is the one which brings up different content for each button?

  • How do I acces a var from the main time line in to a movieclip?

    I'm making a quiz-type animation, since I'm new with ActionScript I had developed my own way to make this work.
    I want to add like a meter that shows one out three position depending on the answer given, I had made this animation as a movieclip but now I need it to react according to the answer, so it changes on every question to do that I need to access the variables I'm using in the main time line, how can I access the the main time line variables from the movie clip?
    The movie clip (meter) is basically the background and the questions will change and advance on top of that movie clip so it'll change with each answer until you get the final result.
    Since I cant attached my FLA file here I could email my it to whom may want to help me, THANK YOU!!!

    I kinda of make it work using what you suggested: var meterVar = MovieClip(this.root).userAnswer;, but I have different problems now I'm getting this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
         at divameter2_fla::MovieClip_1/frame1() and the meter movieclip only change from the original position to the second and stays there even if the first answer supose to sent it to the third or four position. here is the code for the main and movie clip:
    Main:
    The following code I have it in separate frames, I know is probbably not the best way to do it but I'm new with AS.
    Frame 1:
    stop();
    messageBox.text = "";
    var userAnswer:int;
    var rbg:Object = rbA.group;
    var finalScore:int;
    btnCheck.addEventListener(MouseEvent.CLICK, nextBtn);
    function nextBtn(evt:MouseEvent):void {
                 userAnswer = int(rbg.selectedData);
                 if(userAnswer == 0) {messageBox.text = "Please select an option";
                 }else{
                     finalScore = userAnswer;
                     gotoAndPlay(2);
    Frame 2:
    stop();
    messageBox.text = "";
    var rbbg:Object = rbbA.group;
    btnCheckTwo.addEventListener(MouseEvent.CLICK, nextBtnTwo);
    function nextBtnTwo (evt:MouseEvent):void {
                 userAnswer = int(rbbg.selectedData);
                 if(userAnswer == 0) {messageBox.text = "Please select an option";
                 }else{
                     finalScore = finalScore + userAnswer;
                     gotoAndPlay(3);
    Frame 3:
    stop();
    messageBox.text = "";
    var rbcg:Object = rbcA.group;
    btnCheckThree.addEventListener(MouseEvent.CLICK, nextBtnThree);
    function nextBtnThree (evt:MouseEvent):void {
                 userAnswer = int(rbcg.selectedData);
                 if(userAnswer == 0) {messageBox.text = "Please select an option";
                 }else{
                     finalScore = finalScore + userAnswer;
                     gotoAndPlay(4);
    Frame 4:
    stop();
    messageBox.text = "";
    var rbdg:Object = rbdA.group;
    btnCheckFour.addEventListener(MouseEvent.CLICK, nextBtnFour);
    function nextBtnFour (evt:MouseEvent):void {
                 userAnswer = int(rbdg.selectedData);
                 if(userAnswer == 0) {messageBox.text = "Please select an option";
                 }else{
                     finalScore = finalScore + userAnswer;
                     gotoAndPlay(5);
    Frame 5:
    stop();
    messageBox.text = "";
    var rbeg:Object = rbeA.group;
    btnCheckFinish.addEventListener(MouseEvent.CLICK, finishBtn);
    function finishBtn (evt:MouseEvent):void {
                 userAnswer = int(rbdg.selectedData);
                 if(userAnswer == 0) {messageBox.text = "Please select an option";
                 }else{
                     finalScore = finalScore + userAnswer;
                     if (finalScore > 4) gotoAndPlay(6);
                     if (finalScore > 9) gotoAndPlay(7);
                     if (finalScore > 13) gotoAndPlay(8);
    The las theree frames are the 3 different results and the code they have is only a stop();
    The following is the movieclip code:
    stop();
    var meterVar = MovieClip(this.root).userAnswer;
    var btnCheck = MovieClip(this.root).btnCheck;
    var btnCheckTwo = MovieClip(this.root).btnCheckTwo;
    var btnCheckThree = MovieClip(this.root).btnCheckThree;
    var btnCheckFour = MovieClip(this.root).btnCheckFour;
    btnCheck.addEventListener(MouseEvent.CLICK, nextBtn);
         function nextBtn (evt:MouseEvent):void {
                 if (meterVar == 1) {gotoAndPlay(2);
                     if (meterVar == 2) gotoAndPlay(3);
                     if (meterVar == 3) gotoAndPlay(4);
                 }else{ gotoAndPlay (1);
    btnCheckTwo.addEventListener(MouseEvent.CLICK, nextBtnTwo);
         function nextBtnTwo (evt:MouseEvent):void {
                 if (meterVar == 1) {gotoAndPlay(2);
                     if (meterVar == 2) gotoAndPlay(3);
                     if (meterVar == 3) gotoAndPlay(4);
                 }else{ gotoAndPlay (1);
    btnCheckThree.addEventListener(MouseEvent.CLICK, nextBtnThree);
         function nextBtnThree (evt:MouseEvent):void {
                 if (meterVar == 1) {gotoAndPlay(2);
                     if (meterVar == 2) gotoAndPlay(3);
                     if (meterVar == 3) gotoAndPlay(4);
                 }else{ gotoAndPlay (1);
    btnCheckFour.addEventListener(MouseEvent.CLICK, nextBtnFour);
         function nextBtnFour (evt:MouseEvent):void {
                 if (meterVar == 1) {gotoAndPlay(2);
                     if (meterVar == 2) gotoAndPlay(3);
                     if (meterVar == 3) gotoAndPlay(4);
                 }else{ gotoAndPlay (1);
    I had attached the almost working FWS file

  • Controlling the main time line of a movie via a button within a movie on a different level.

    Hi there!
    I have two movie is two different levels,
    Level 5 is my base movie and I am loading another movie on
    top of this into level 10.
    Once the user clicks onto a button within the movie on level
    10, I would like the animation in level 5 to stop (the animation
    runs on the main root timeline of level 5).
    Once the user clicks on a different button within the movie
    on level 10, I would like the animation on the main timeline of the
    movie in level 5 to start again from the point where it previously
    left off.
    Is this possible?
    It would be great if someone could help me out with this.
    Thanks, midi_ie

    midi_ie wrote:
    > Hi there!
    > I have two movie is two different levels,
    > Level 5 is my base movie and I am loading another movie
    on top of this into
    > level 10.
    > Once the user clicks onto a button within the movie on
    level 10, I would like
    > the animation in level 5 to stop (the animation runs on
    the main root timeline
    > of level 5).
    >
    > Once the user clicks on a different button within the
    movie on level 10, I
    > would like the animation on the main timeline of the
    movie in level 5 to start
    > again from the point where it previously left off.
    > Is this possible?
    _level5.gotoAndPlay("someLabelframe");
    Use your regular action to target timeline or movie clips,
    just define the level number at the beginning of the path.
    Pretty much it :)
    Best Regards
    Urami
    !!!!!!! Merry Christmas !!!!!!!
    Happy New Year
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Have keyframes in effect controls window coincide with main time line

    Hello,
    Is there any way I can have the time line in my effects control window coincide with my main time line ?
    Example,  I add keyframes along my main time line, but any time I wish to edit  them, I need to scrub my effect controls window timeline to get to that
    spot  that coincides on the main time line.  I'm just wondering how I can  have both time lines show the same area at the same time.
    So  if I'm at the end of my time line, and add a keyframe, and then wish to  just scrub or move my cursor to the beginning of my main time line, the
    time  line in the upper window ( effects control window ) does not reflect  the area of the main time line I am currently at, I need to actually  click the time time
    line ( main time line ) in order to "refresh" the upper effect control window time line.
    Thanks for any advice,
    Dave.

    Hi Jim,
    that's what I mean, thanks for info.  I guess this isn't a popular want from users, I just thought it would be neat if we could do this, it's not a big deal, but I thought
    I would ask.  Thanks for the informatiion - at least I know now.
    Dave
    JSS1138 wrote:
    I think he wants the CTI of the Effects pane to match the CTI of the sequence.  If one moves, the other moves as well.
    In CS4 this happens by default.  Has that changed for CS5?

  • How load variables to a movie clip on a masked layer on my main time line

    the problem I have is that I been trying to load text from a
    text file news.txt into a movie clip on my main time line the
    problem is when the layer where the video clip is locates is masked
    the variables will not load, but it does work when the layer is
    unmasked, but then the website does not work the way it is suposed
    to look.
    any Idea on how I can get arround this????

    PArt of the problem will be due to declaring the uiLoader inside of a function.  When you do that you limit its scope to within that function.  You should declare it outside of any function if you need to access it in more than one function.
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    var uiLoader:UILoader;
    var targetObj:Object;
    The other problems I see regard the line you point to.  It is not spelling the name the same, using a lowercase "l". Also, if you want to target what the UILoader contains, you should target its "content" property, as in...
    targetObj = uiLoader.content.mask_01

  • Time line function in AS3

    How to use time line function like " gotoAndPlay, stop(), " etc with AS3,
    i had use stop in my first fram it give the error like,
    1180: Call to a possibly undefined method addFrameScript.
    did i have to import any other file for that

    Actually i wirte the simple code of generating multiple symbols on the stage in a seaprete class file, than i embed it like this:
    and then i write "stop()" in the first frame layer one.
    try yourself create any class and link it with fla and write "stop();" in first frame to stop it.

  • Accessing the main timeline

    Hello,
    I have multiple instances of a movieclip (a1) within the main timeline.  These instances move around via tweening within the main timeline.  The instances also appear (are added) and disappear (are removed) while the main timeline is playing.
    Within the movieclip is this actionscript:
    (code)
    addEventListener(Event.ENTER_FRAME, ef);
    function ef(evt:Event):void
         trace(MovieClip(parent).currentFrame);
    (end code)
    As soon as an instance disappears... I get this typeError:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at test13_fla::a1_1/ef()
    The question then is - How can I access the main timeline from each instance (even when it is not currently on stage)?  Is this possible?  Any suggestions on how I can keep all of my code within the movieclip?
    Thanks in advance!
    -Jake

    Throughout the timeline the instances are in a motiontween followed by a blank keyframe. 
    To remove the event listener when it does dissappear I could do a addEventListener(Event.Removed, removeEventListenerFn);.... but I need a way to keep it.
    In my real project, each instance draws itself via drawRect and then put into a sprite and added to the main timeline.  Then within the event function (where it traces the maintimelines current frame)  I need all of the sprites to be removed when the main timeline gets to a certain frame#.  I know... confusing...
    I just need to find a way to access the main timeline while the instance is removed from the stage.
    If, for example, I did this...
    (code)
    addEventListener(Event.REMOVED, ef);
    var ccc:Number = 1;
    function ef(evt:Event):void
         trace("First Removed: " + MovieClip(root).currentFrame);
         addEventListener(Event.ENTER_FRAME, eg);
    function eg(evt:Event):void
         if(ccc < 10)
              trace("I am now removed");
         ccc++;
    (end code)
    ... I do not get any errors and I would get this in the output window:
    First Removed: 59
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed
    I am now removed

  • Replacing the music in the prime time line

    I am working on a music project with dozends of audio file in the prime time line and hundres of video clips joint to them. 
    Now I have re-recorded the music and want to replace all the old audio files by one new audio file (with a lenght of nealy two hours) but keep all the joint video clips joint to the original audio tracks. (of course I have to move them a bit to adjust them to the new music track)
    How to proceed ?

    SSelect all the clips in the primary and make them a compound clip. Drag your new file onto the compound and use the replace function.

  • IS the audio time line gone?

    In older versions there was a time line for adjusting the volume (mixing)
    over the period of your movie. I think that is now gone right?
    I keep using the older version because I can incrimentally tweek volumes that
    clash with other things like dialogue.

    So what is a guy to do?
    I use (and like) both iMovie 09 and iMovie 06. But when I need the audio time line or better quality I use iMovie 06.
    If you like iMovie 06 better, as many do, you can continue to use it. I find that it works perfectly with my Mac Pro, iDVD 09 and the latest Mac OS.

  • Making my 2nd BT line the main phone line

    Hi
    I've been trying to find a solution for this with no luck. Spoken to several BT engineers (all based abroad!) and no one seems to understand the issue, let alone help. A pointer in the right direction would be hugely appreciated!
    We have 2 lines coming into the flat - Let's call them Line 1 and Line 2. Line 1 is the main line around the house. If you plug any basic phone into a socket in any room, you get Line 1.
    We have a Panasonic PBX system with both Line 1 and Line 2 going into it. Plug in a programmed Panasonic phone into any socket, and you get both line 1 and 2 available from the phone's selection menu.
    We are dropping Line 1 and want to make Line 2 the main line in the house (Line 1 is hardly used anymore). We want to be able to plug a basic phone into any socket and get Line 2 by default. We also want to remove the PBX, although this is less of a priority. Main thing is to make Line 2 the default standard house line, and change our phones to basic standard phones.
    I must be asking the wrong questions as I can’t find anyone than can help. Is this something BT can do? Is it the company that set up the PBX system (Spitfire I believe)?. Is it something I can do (I’m not hugely technical, but can follow basic steps)? What do I need to ask for, and to whom? 
    We do have a Cable & Wireless box near the PBX with two ethernet style cables coming out of them. They are labelled with the actual phone numbers of Line 1 and Line 2. I tried swapping those round, but it made no difference. Line 1 was still the main line. I suspect this is something compeltely unelated. 
    Thanks in advance for any help.
    Cheers

    This was originally sold as a business system, was there once a business operating from the premises?
    I have asked a moderator to provide assistance, they will post an invite on this thread.
    They are the only BT employees on this forum, and are a UK based team of people, who take personal ownership of your problem.
    Once you get a reply, if you click on their name, you will see a screen like this. Click on the link as shown below.
    Please do not send them a personal message, as they may not be on duty for a long time, and your message will not be tracked properly.
    For your own security, do not post any personal details, on this forum. That includes any tracking number you are give.
    They will respond either by phone or e-mail within 5-6 working days.
    Please use the tracked e-mail, to reply, not via the forum. Thanks
    This is the form you should see when you click on the link. If you do not see this form, then you have selected the wrong link.
    When you submit the form, you will receive an enquiry number, so please keep a note of it
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Using TestStand 2.0, what is the best way to run a smaller sequence, in parallel to the main sequence, and access the main sequence's FileGlobals?

    I did ask this a while back and appreciate your responses. We did upgrade to TestStand 2.0. The basic problem is that I have written and TestStand sequence to test Avionics black boxes. We use Excel to specify the signal names and input data and expected output data for thousands of test cases. My LabVIEW VI's are small generic modules that refer back to TestStand to determine how to set or get the signals. This way, on other projects, we simple change a few signal names, instruments, and were good to go. We use Analog, Digital, Pulse Trains, Synchro Resolvers, LVDT/RVDT, power supplies, logic analyzers, ... to perf
    orm these test. The TestStand sequence can run different black boxes on difference test benches based on the data contained with the TestStand FileGlobals. Now I have come across a special situation where in a couple of input signals are set based on a couple of output signals. I developed a short sequence to read the output signals, compute the values of the inputs signals, and set the instrument to send that data to the UUT for those couple of signals. Anyway, I have to reference the FileGlobals to determine what the instruments are and how to access them are used for the signals involved. Since I have a lot of FileGlobal data, I can not pass it as parameters to the parallel sequence.
    What I would like to be able to do is just reference the main sequence's FileGlobals as if they were the parallel sequence's FileGlobals.
    I am willing to send a copy of the sequence being used to whomever thinks they know a good way to accomplish this if it would help them to determine what I am t
    rying to do. I will need to know who you are since we do not want this being published, as is, since it contains some signals names which the company that I am consulting at may consider proprietary. You can
    email me directly at my company
    [email protected]

    a) If the parallel sequence is in the same file and...
    a1) ...you launch the parallel sequence as a thread in the execution of main sequence, you do not need to do anything. The sequences share the same file globals
    a2) ...you launch the parallel sequence as a separate execution, you must mark the file globals as shared by all executions. You specify this in the Sequence File Global control on the sequence file properties dialog box.
    b) If the parallel sequence is in a different file (or even the same file), you can pass the entire set of file globals as a single sequence parameter to the parallel sequence when you launch it. Make a Container parameter and right click on it to turn off type checking. Pass FileGlobals to the parameter. When you edit the subsequenc
    e, you won't be able to see specific file globals under the parameter but they will appear at runtime.

  • How do I access the item Schedule line date in VA01?

    Hi,
    I am using userexit_check_vbep to carry out some checks. I need to access the Schedule line date value (RV45A-ETDAT) but it is not available at that point.  How can I read that value from the exit?
    Thanks,
    Kroc

    Thanks Advait,
    ahhh, I asked the wrong question. Yes, xvbep is available in the userexit but my code is being called earlier in the process. This is the call sequence
    VBAP_FUELLEN
    VBAP-VSTEL_ERMITTELN
    VBAP-ROUTE_ERMITTELN
    SD_ROUTE_DETERMINATION
    EXIT_SAPL0VRF_001............This is where I need to access the schedule line data
    Z_CUT_OFF_TIME_CALCULATE............This is where I need to access the schedule line data
    Z_CUT_OFF_DETERMINE_DATA............This is where I need to access the schedule line data
    Do you know if it is available at that stage?
    Thanks,
    Aidan.

  • Classic Report not retrieving when accessing the first time

    I have two classic reports on two separate tabs and the first time that I access the tabs, the report does not retrieve. However, if I tab off and then back onto the tab, the report will retrieve.
    Any idea why these two tabs are not retrieving when initially accessing the tab?
    I have several other tabs in the same application that retrieve properly when initially access them.
    Thanks,

    I think I remember something like that happening to me because there were variables that were not initialized properly that the report used.

  • Where did the current-time-line go in Calender?

    I can't find the line that says what the current time is in Calender.. Is there any way to put it or get it back in? IMO it was one of the features why Calender was a really good app. It looks like Apple just forgot to put it in... Is this going to be updated.
    Should look something like this;(like we had before)
    https://www.dropbox.com/s/3dtvkw37vkw70hj/Screenshot%202013-10-25%2015.01.122.jp g

    I can’t tell you what’s causing it, but it is working fine here. The line is red and moves with the current time. But it is only visible when you are in the current week. If I move to the prior or next week it won’t show.

Maybe you are looking for

  • Why isn't junk mail going into its folder

    I get a lot of spam and a few weeks ago, it went into my junk folder which pulled if off my iphone and ipad. Now the junk mail just stays in the inbox. What is causing that or this? Can I fix it?

  • Error while starting java instance

    hi,All, Jstart.exe is stopped. i tried to restart but it was yellow for sometime and again became grey. Please find the logs here. trc file: "dev_jstart.new", trc level: 1, release: "710" sysno      00 sid        CE1 systemid   562 (PC with Windows N

  • How to Disable Conversations in Mail

    I NEVER want to see any email in conversations view; I only want to see 1 email at a time. Even though, in Yosemite Mail, I have unchecked all "view conversations" options in Mail Preferences, I am still seeing conversations when I click on a specifi

  • ATI and TVout plus games problems

    Hi, So I really hate ATI by now but since switching to nvidia ain't and option atm I might as well ask for user input on couple of problems: 1st: Tvout, I guess to get working tvout i must use fglrx? Tvout works as clone atm but is it possible to get

  • Font Guide Needed

    I'm a Muse Developer needing a way to show my customers which fonts are available for them to choose from. I can see what's available to me while I'm developing by pulling down the text menu drop down list in Muse, and accessing the "+ add web fonts"