Accessing class var from main timeline

Hi all! Well I've been working on this for a couple of days
now and just can't seem to get it to work right...... I'm still
getting my feet wet with as3 and like it more and more everytime I
use it.... almost.
Anyways, here's where I'm running into trouble.
Here's a dumbed down version of my project with all the other
usless drivel excluded. Basically what I'm trying to do is declare
a var and give it a value in my class. Then I want to be able to
display that value on the stage and use it in the main timeline.
Seems simple enough....
I need to be able to pass the var from the class to the main
timeline for use.... Any help on this would be GREATLY appreciated.
Thanks.

kglad, worked like a charm in my short test file... however
in my real world flash file the class takes a short time to
actually compute the value of the variable. If I fire the trace
from the main timeline it will display NaN b/c at the moment it
fires the value of the var doesn't exist b/c it has yet to be
calculated......
I don't really know the best way to delay this... would the
best way be to somehow add an event listener to listen to the var
to see when it is assigned a value?.... I'm open to suggestions.
btw, good catch on the assignment of a string value!!
Thanks!

Similar Messages

  • Access var on main timeline from class

    Hello,
    Currently working on some expanding media that has class files for all of the various action functions, then a separate class file for all of the var that sets the graphics, tracking, copy / content and whatnot.
    The final part that's driving me nutty - how to set a var per .swf that will concatenate with the tracking.  Ideally I'd like to get this as automated as possible so if I pass off the files to other designers they can update it quickly with minimal effort.
    Assets:
    unit 1a
    300x250 banner
    728x500 expanded larger content area
    unit 1b
    728x90 banner
    728x90 expanded larger content area (that is a duplicate of the 300x250 content .swf).
    So with tracking, each banner and expanded area would have individual tracking pixels.  Currently I can get all of the pixels to fire properly per unit however I have to have separate functions so there's no overlap and a number of duplicate naming.  Druthers-wise what I would have is the type of unit passed when the pixel function is triggered for the larger expanded sizes.  For example =
    User clicks on unit 1b button, this triggers the buttonClickTracking(); function (which is in the actions class file, shared by both unit 1a and unit 1b)..  unit 1b would have some var in the timeline so that when that function is called, the pixel will have "unit1b" + tracking.pixel;
    To sum it up, I need to set some var on the timeline for each expanded unit so the unit label (id) is called when any of the various tracking functions are initiated.  Right now getting that ID from each of the larger content .swf eludes me so any suggestions would be greatly appreciated!

    i could not understand what you're trying describe.

  • Accessing Var from main Nib/Class - [global variables]

    I'm sure this is a simple solution and the problem is I'm just not thinking right. I just started programming in Objective C but have come a long way in the past 2 weeks. Pretty extensive knowledge in C# and some java.
    Anyways, I've been creating an app and have streams working, CFNetwork working, network services discovery working and a tab bar with a custom View controller linking to one of the tab-bar buttons.
    So when you click on one of the tab bar items it opens a new nib file. That nib loads a table view. When nib loads it hits a method which starts looking for network services and updates the table when it finds some.
    Now the idea is is to have a selector on the cell and when you choose the service it adds same variable info, ip and port, back to a global variable which can be used through the entire app and all extra loaded nib files.
    Out of all this, I don't know how to access global variables....prob should be the simplest thing to do out of all I've done. I have ideas of how it should be done but don't know how to access it.
    Idea would be:
    MainWindowNib has NSString var that is public with a getter setter. But how can I access that MainWindowNib var from a SecondView.nib file/class. There a way to get the parent of the secondView.Nib? I have no clue.
    Any help would be great!
    Thanks!

    I'm still a bit confused how you access that method.
    Main.nib class : UIApplication
    NSString *port
    SetupView.nib : NSViewController
    view
    -TableView added to view
    -Seperate NSObject for TableViewDelegates
    -When item selcted, pass NSString to [main port]
    How do I get a pointer to port. I don't really understand how to do this with objective C.
    In C# I would be something like: [Not exact syntax but u get the idea]
    public Main : Form
    public string port{get;set;}
    Main()
    sView SeconddForm = new SecondForm(this);
    public SecondForm : Form
    SecondView(Main main)
    main.Port = "8080";
    Message was edited by: Clarke76
    Message was edited by: Clarke76

  • Controlling movieclip from main timeline & Child

    Hi,
    This code is currently contained within my "mc_1" movieclip. I want to be able to have this code on my main timeline, however no matter what I try I constantly get errors, multiple different versions. I've tried adding mc_1 infront of everything, but that just gives an output error about a Sprite.
    Also, I'm currently using visible to control whether the back image to the textbox should show - What I'd really like to do is control it using a child, but they're movieclips not buttons, so when I try to addChild within the function it errors saying I'm trying to control a movieclip within a simplebutton function.
    import flash.events.MouseEvent;
    stop();
    mc_textbox.visible = false;
    for(var i:uint=1; i<8; i++){
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case line1: // line 1 is the first button
            line_output.text = "1"; // This text should display
            mc_textbox.visible = true; // The textbox should display
            break; // If this is not the case, break and check next
            case line2:
            line_output.text = "2";
            mc_textbox.visible = true;
            break;
            case line3:
            line_output.text = "3";
            mc_textbox.visible = true;
            break;
            case line4:
            line_output.text = "4";
            mc_textbox.visible = true;
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case line5:
            line_output.text = "55";
            line_output.y = 427.65;
            mc_textbox.visible = true;
            mc_textbox.height = 100;
            mc_textbox.y = 417;
            break;
            case line6:
            line_output.text = "6";
            mc_textbox.visible = true;
            break;
            case line7:
            line_output.text = "7";
            mc_textbox.visible = true;
            break;
            default: // If none of the cases are true, this should display
            line_output.text = ""; // line_output should be blank
            mc_textbox.visible = false; // mc_textbox should be invisible by default
    function line_out(e:MouseEvent):void
            line_output.text = "";
            line_output.y = 474.65;
            mc_textbox.visible = false;
            mc_textbox.height = 61.95;
            mc_textbox.y = 454;

    I've resolved the timeline issue. Now my only issue is the Child not working.
    What I'm trying to do:
    addChild(mc_1.mc_textbox) to appear upon rollover of a button. On rolloff, for the child to be removed.
    Add mc_textbox inside mc_1 on rollover, at a specific XY and height. On rolloff, for the child to be removed.
    I have also been told that I should not have a dynamic textbox on the scene and should call that in using AS3 - If you have time, could you inform me how this would be done?
    Thanks alot for the help,
    ERROR:
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/addChild()
        at Main_new_fla::MainTimeline/line_in()
    TypeError: Error #2007: Parameter child must be non-null.
        at flash.display::DisplayObjectContainer/removeChild()
        at Main_new_fla::MainTimeline/line_out()
    import flash.events.MouseEvent;
    stop();
    for(var i:uint=1; i<8; i++){
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OVER, line_in, false, 0, true);
        this.mc_1["line"+String(i)].addEventListener(MouseEvent.ROLL_OUT, line_out, false, 0, true);
    function line_in(e:MouseEvent):void // Defineing the function as line_in
        var lineTarget:SimpleButton = SimpleButton(e.currentTarget); // The variable is lineTarget
        switch(lineTarget) // Each case should swap the lineTarget
            case mc_1.line1: // line 1 is the first button
            mc_1.line_output.text = "1"; // This text should display
            addChild(mc_1.mc_textbox); // The textbox should display
            break; // If this is not the case, break and check next
            case mc_1.line2:
            mc_1.line_output.text = "2";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line3:
            mc_1.line_output.text = "3";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line4:
            mc_1.line_output.text = "4";
            addChild(mc_1.mc_textbox);
            break;
    /* This case has much more text than the rest, as such the textbox is enlarged for this case only
    and changed in position. The line_output dynamic text field is also moved on the Y axis for this.
    This is reset to default using the line_out function.
            case mc_1.line5:
            mc_1.line_output.text = "55";
            mc_1.line_output.y = 427.65;
            addChild(mc_1.mc_textbox);
            mc_1.mc_textbox.height = 100;
            mc_1.mc_textbox.y = 417;
            break;
            case mc_1.line6:
            mc_1.line_output.text = "6";
            addChild(mc_1.mc_textbox);
            break;
            case mc_1.line7:
            mc_1.line_output.text = "7";
            addChild(mc_1.mc_textbox);
            break;
            default: // If none of the cases are true, this should display
            mc_1.line_output.text = ""; // line_output should be blank
            addChild(mc_1.mc_textbox); // mc_textbox should be invisible by default
    // Removes any text that has been displayed from the Dynamic text box, also resetting the sizes to default.
    function line_out(e:MouseEvent):void
            mc_1.line_output.text = "";
            mc_1.line_output.y = 474.65;
            removeChild(mc_1.mc_textbox)
            mc_1.mc_textbox.height = 61.95;
            mc_1.mc_textbox.y = 454;

  • Controlling multiple external swfs from main timeline

    Hi, I've been trying to combine the features of two tutorials I found, one that deals with controlling external swf's from the main timeline and the other that explains how to load and unload multiple external swf's.  I'd like to be able to load and unload multiple external swf's, and control these swf's buttons from the main timeline. 
    I asked this same question on the forum of the site where I found these tutorials, and receive only one reply saying that "it should'nt be hard to do." but they did not elaborate any further.  This left me think that I was missing something very obvious and I've spent too much time now trying to work what it is now.  I understand pretty much how both pieces of code work, but just can't work out how to combine them.
    If someone could explain it to me, I'd much appreciate it.
    Tutorial One code - controlling an external swf from the main timeline.
    var ldr:Loader = new Loader();
    var urlReq:URLRequest = new URLRequest("swfs/balls.swf");
    ldr.load(urlReq);
    function loadHandler (event:Event) {
    var myClip:MovieClip = event.target.content;
    addChild(myClip);
    function myClipOver(event:MouseEvent):void {
    myClip.myBlueBalls.stop();
    function myClipOut(event:MouseEvent):void {
    myClip.myBlueBalls.play();
    // set listeners
    myClip.addEventListener(MouseEvent.ROLL_OVER, myClipOver);
    myClip.addEventListener(MouseEvent.ROLL_OUT, myClipOut);
    // listener
    ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    Tutorial Two code - loading and unloading multiple external swfs.
    var Xpos:Number = 110;
    var Ypos:Number = 180;
    var swf:MovieClip;
    var loader:Loader = new Loader();
    var defaultSWF:URLRequest = new URLRequest("swfs/eyesClosed.swf");
    loader.load(defaultSWF);
    loader.x = Xpos;
    loader.y = Ypos;
    addChild(loader);
    // Btns Universal function
    function btnClick(event:MouseEvent):void {
    removeChild(loader);
    var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf");
    loader.load(newSWFRequest);
    loader.x = Xpos;
        loader.y = Ypos;
    addChild(loader);
    // Btn listeners
    eyesClosed.addEventListener(MouseEvent.CLICK, btnClick);
    stingray.addEventListener(MouseEvent.CLICK, btnClick);
    demon.addEventListener(MouseEvent.CLICK, btnClick);
    strongman.addEventListener(MouseEvent.CLICK, btnClick);

    I will not be able to help you with whatever relaxatraja provided though it is purported by relaxatraja to be clearly explaining what I was explaining (???).
    Your loadHandler function appears a bit confused.  For the code you show I don't see you assigning any event listeners for the events that will be dispatched in the loaded file.  As I showed earlier, your loadHandler function should be assigning a listener for the event that will be dispatched (modified slightly below). and if you have three different events being dispatched in the loaded file, then you'll do better to have three different listeners.  I show only one below for one of the events you dispatch...
    function loadHandler (event:Event) {
      // assign a listener for the loaded file's goExit function's event
       MovieClip(event.currentTarget.content).addEventListener("close", event1Handler);
    // I can't make sense of what you have here
        removeChild(myClip); // why ?? - it hasn't been added yet as far as I can see - error 2007?
        var newSWFRequest:URLRequest = new URLRequest("swfs/" + event.target.name + ".swf"); // the event.target is the Loader
        ldr.load(newSWFRequest); // this will load over the file you just finished loading??
        ldr.x = Xpos;
        ldr.y = Ypos;
        addChild(myClip);  // why?? it has nothing in it
    function event1Handler(e:Event):void {
        // do whatever is involved with what the "close" event is supposed to do
        trace("goExit function executed");
    As far as what you have in the loaded file, you appear to be trying to pass the files names as if they were parameters.  The file naming should be done at the receiving side for the event handler function for the event listener.  While you could create a custom event that include parameters that you can pass, that's another level of coding that is better left for a future experience.
    Study the following - understand it before you try to use it.
    Below is a link to some files I made for another posting that demonstrates what I have been explaining.  The neurope file is the main file.  Publish the netherlands file so that you have an swf to load for it, and then run the neurope file.  The file that gets loaded (netherlands) only has a button in it that when clicked dispatches an event for which the main file (neurope) has assigned a listener.  The main file displays a message when the button gets clicked in the loaded file.
    http://www.nedwebs.com/Flash/neurope.zip

  • Controlling loaded swf from main timeline

    Hello,
    I'm working on loading external swf files for ios. I am able to load the swf files and set them to visible or invisible in different frames. I am having trouble controlling the loaded swf files from the main timeline. Specifically, I would like to have a button on the main timeline, that when clicked will move a loaded swf to frame 1.
    Here is a code that loads one swf file:
    var myLoader1:Loader;
    var loaderContext1:LoaderContext = new LoaderContext(false, ApplicationDomain.currentDomain, null);
    if(myLoader1 == null)
              myLoader1 = new Loader();
              addChild(myLoader1);
    myLoader1.load(new URLRequest("folder/file1.swf"),loaderContext1);
    myLoader1.visible = true;
    backbutton.addEventListener(MouseEvent.MOUSE_DOWN, backbutton1);
    function backbutton1(myEvent:MouseEvent):void {???????????? myLoader1.gotoAndStop(1);}  (this line does not work)
    (Once I load file1.swf, within the file1.swf I click a forward button to move to different frames. My question is: how do I code the 'backbutton' on the main timeline so that it causes the loaded file1.swf to go to frame 1?)
    Thank you for your help.

    sure.
    if the movieclip on the loaded swf's main timeline has reference mc, you would use:
    MovieClip(myLoader.content).mc.gotoAndStop(1);
    p.s.  you might find the following helpful,  http://kb2.adobe.com/community/publishing/918/cpsid_91887.html

  • Is it possible to modify private member of a class directly from main?

    This is the code which modifies the private String stk[] indirectly from main method when sorting option is called from main method:
    import java.io.*;
    class Stack
        private String stk[];
        private int tos;
        private int size;
        Stack()
            size=5;
            stk=new String[size];
            tos=-1;
        Stack(int sz)
            size=sz;
            stk=new String[size];
            tos=-1;
        boolean push(String s)
            if(tos==size-1) return false;
            stk[++tos]=s;
            return true;
        String pop()
            if(tos<0) return "Stack Underflow";
            return stk[tos--];
        String[] display()//array type function to return an array called "stk"
            return stk;
        int returnSize()
            return tos;
    class myStack
        public static void main(String args[]) throws IOException
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            Stack S=new Stack();
            int opt=-1;
            while(opt!=6)
                System.out.println("\n\n\n");
                System.out.println("[1] - Create Stack");
                System.out.println("[2] - Push");
                System.out.println("[3] - Pop");
                System.out.println("[4] - Display");
                System.out.println("[5] - Display List In Ascending Order");
                System.out.println("[6] - Exit");
                System.out.print("Option: ");
                opt=Integer.parseInt(br.readLine());
                if(opt==1)
                    System.out.print("\n\nEnter the size of stack: ");
                    int size=Integer.parseInt(br.readLine());
                    S=new Stack(size);
                    System.out.print("\nStack Created...");
                else if(opt==2)
                    System.out.print("\n\nEnter String: ");
                    String s=br.readLine();
                    if(S.push(s))
                        System.out.print("\nSuccessfull...");
                    else
                        System.out.print("\nStack Overflow...");
                else if(opt==3)
                    System.out.print("\nItem Deleted: "+S.pop());
                else if(opt==4)
                    int sz=S.returnSize();
                    System.out.print("\n\n\nStack Contains: "+(sz+1)+" Item(s)\n");
                    String st[]=S.display();
                    while(sz>=0)
                        System.out.println(st[sz]);
                        sz--;
                else if(opt==5)
                    int s=S.returnSize();
                    String stc[]=S.display();
                    for(int i=0;i<=s;i++)
                        for(int j=i+1;j<=s;j++)
                            if(stc[j].compareTo(stc[i])<0)
                                String t=stc[i];
                                stc[i]=stc[j];
                                stc[j]=t;
                    System.out.println(stc[i]);
                else if(opt>6)
                    System.out.print("\nPress 6 To Exit....");

    Actually, since it is returning the reference value of the array, and he is changing the array elements using that reference, then he IS "changing the array".
    @OP:  When you return a reference value to an object (and, in this regard, an array IS an object), then use that reference value to change things in the object (NOT assigning a new value to the variable holding that reference value), then, of course, those items are changed, and everything using that same reference value will "see" those changes, as they ALL point to the SAME object.
    Edit:  My first answer was going under the assumption that you meant DIRECTLY changing (i.e. stk = ...) since all you provided was the "title" and a blurb of code.  Next time you should think about actually providing some information about the actual "problem".
    See http://www.javaranch.com/campfire/StoryCups.jsp (to get associated with the "terms" they use)
    then see http://www.javaranch.com/campfire/StoryPassBy.jsp for some easy to understand explanations of reference values and objects.

  • Is it possible to modify private member of a class directly from main function?

    This is the code which modifies the private String stk[] indirectly from main method when sorting option is called from main method:
    import java.io.*;
    class Stack
        private String stk[];
        private int tos;
        private int size;
        Stack()
            size=5;
            stk=new String[size];
            tos=-1;
        Stack(int sz)
            size=sz;
            stk=new String[size];
            tos=-1;
        boolean push(String s)
            if(tos==size-1) return false;
            stk[++tos]=s;
            return true;
        String pop()
            if(tos<0) return "Stack Underflow";
            return stk[tos--];
        String[] display()//array type function to return an array called "stk"
            return stk;
        int returnSize()
            return tos;
    class myStack
        public static void main(String args[]) throws IOException
            BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
            Stack S=new Stack();
            int opt=-1;
            while(opt!=6)
                System.out.println("\n\n\n");
                System.out.println("[1] - Create Stack");
                System.out.println("[2] - Push");
                System.out.println("[3] - Pop");
                System.out.println("[4] - Display");
                System.out.println("[5] - Display List In Ascending Order");
                System.out.println("[6] - Exit");
                System.out.print("Option: ");
                opt=Integer.parseInt(br.readLine());
                if(opt==1)
                    System.out.print("\n\nEnter the size of stack: ");
                    int size=Integer.parseInt(br.readLine());
                    S=new Stack(size);
                    System.out.print("\nStack Created...");
                else if(opt==2)
                    System.out.print("\n\nEnter String: ");
                    String s=br.readLine();
                    if(S.push(s))
                        System.out.print("\nSuccessfull...");
                    else
                        System.out.print("\nStack Overflow...");
                else if(opt==3)
                    System.out.print("\nItem Deleted: "+S.pop());
                else if(opt==4)
                    int sz=S.returnSize();
                    System.out.print("\n\n\nStack Contains: "+(sz+1)+" Item(s)\n");
                    String st[]=S.display();
                    while(sz>=0)
                        System.out.println(st[sz]);
                        sz--;
                else if(opt==5)
                    int s=S.returnSize();
                    String stc[]=S.display();
                    for(int i=0;i<=s;i++)
                        for(int j=i+1;j<=s;j++)
                            if(stc[j].compareTo(stc[i])<0)
                                String t=stc[i];
                                stc[i]=stc[j];
                                stc[j]=t;
                    System.out.println(stc[i]);
                else if(opt>6)
                    System.out.print("\nPress 6 To Exit....");

    Short answer is: no.
    Long answer is: you should not try to. Information hiding is the fundamental principle of OOP. This means that the code dealing with an object has no knowledge about the objects inner structure. It only knows the methods provided by its interface.
    You should declare all object properties private and prevent any other code outside the owning class to manipulate it. This includes leaking properties via "getter" methods. In your example the display() method is bad in two ways:
    its name does not convey its purpose.
    it a "getter" that returns the private property stk to the caller who may change it. Eg. the caller could add or delete an entry without changing tos accordingly.
    bye
    TPD

  • Control swf from main timeline

    i know i've done this before! i have a swf. 4 labels. a stop
    at frame 1. i embedd this into my main timeline. i have 4 butons in
    an MC in my main project, going to specific labels in my main
    timeline, where i have the following code, attempting to load the
    swf and jump to that label:
    this.container_shell.loadMovie("interact01.swf");
    interact_shellb.gotoAndStop("label1");
    its not working. the swf loads, but i can't jump to the
    label.
    any ideas? appologize for the basic question, i'm a designer,
    not a programmer!

    If you have a question to ask, you should start a new posting and include the code/info pertinent to your problem.  The one you are trying to catch a ride from is flawed and requires some questions to be answered.  Being that the posting is over 4 years old, it is unlikely the original poster is going to be answering any.

  • Jumping from Main Timeline to a specific frame of a MovieClip

    Hello there!
    I'm a begginer with Flash... and I am attending a course of fundamentals of Flash... so I apologize if my doubt is a too obvious answer to some of you.
    The situation is as follows:
      I'm using Action Script 2.0 --- I'm obligated to in the course I'm attending.
      I have a main timeline that has 3 frames. On the 2nd frame I have a movieclip named mc_nbr. On the 3rd frame I have a button "voltar" that when pressed I want it to "Go and Stop/Play" at frame 3 of the movieclip (that is embedded on frame 2 of the main timeline).
    I used the folowing code for the button btn_voltar:
    on (press)
        _root.mc_nbr.gotoAndStop("3");
    I tried as well with
    on (press)
       this.mc_nbr.gotoAndStop("3");
    None of them works!
    I tried to see wheather the button even works and it does.
    I included a input text box and the stament before the code shown above  like the one that follows:
    feedback.text = "Pressionei o botão!";
    So the part missing (and the important one) is jumping to the movieclip. I can't figure out how to do it !!!
    I uploaded the "project" at http://www.megaupload.com/?d=A6M581US
    Could anyone, please help me.
    Thank You for your feedback.

    Ron ron,
    Thank you for your help... but either I'm not following You or I'm doing something really wrong.
    I tried what you suggested but it doesn't solve my problem...
    Were we talking about the same button ? (btn_voltar, from the 3rd frame)
    Could you take a look at my file in http://www.megaupload.com/?d=A6M581US   ??

  • How to add button inside move clip and call it from main timeline?

    Hi,
    On the main timeline I  have a movie clip called clock_mc and playBtn
    playBtn is  placed in the center of clock_mc
    When you press playBtn clock_mc starts playing
    playBtn.addEventListener(MouseEvent.CLICK, playClock);
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    This is working fine for me.
    But I want to add replayBtn to the last frame of clock_mc and set up the function on main Timeline.
    Another words when the clock_mc rich last frame you see replayBtn.
    code example:
    replayBtn.addEventListener(MouseEvent.CLICK, playClock);
        if (event.target == replayBtn)
            clock_mc.play();
            replayBtn.visible = false;
            trace ("replay button was clicked");
    I've tryed to placed the replayBtn on the stage on the main timeline and I've set it up to replayBtn.visible = false;
    And then I add replayBtn.visible = true; to last AS frame of clock_mc but it wont work
    Even when I put the button physically to the last frame of clock_mc it will not work either.
    Please help

    I've solved the problem:-)
    I've set replayBtn.visible = false; on first frame of clock_mc
    and  replayBtn.visible = true; at the last frame
    and than as you sugested I'v add:
    clock_mc.replayBtn.addEventListener(MouseEvent.CLICK, replayClock);
    function replayClock(event:MouseEvent):void
            clock_mc.play();
            trace ("replay button was clicked");
    I couldn't see replayBtn at the firs stage because I have clockTween assosiated with clock:
    clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
    and I had replyBtn in the wrong place so when clock_mc was coming up on the stage replayBtn was on the left side of the stage :/
    Now I have to solve only one thing.
    Maybe you would have any suggestions please.
    I've set up stop(); in a first frame of clock_mc
    that when you see clock_mc sliding in it has to wait for playBtn to be clicked
    because I have two tween:
            clockTween = new Tween(clock_mc, "x", Regular.easeOut, -469,438, .5, true);
            playTween = new Tween(playBtn, "x", Regular.easeOut, -720,514, .5, true);
            playBtn.visible = true;
    so when you click on playBtn:
    function playClock(event:MouseEvent):void
        if (event.target == playBtn)
            clock_mc.play();
            playBtn.visible = false;
            trace ("play button was clicked");
    everythink is working fine except when I clik on replayBtn it play for I sec because there is stop(); on the first frame of clock_mc

  • Goto next frame in a movieclip from main timeline button

    So what I have is a button (named Next) on the main timeline. I have a movie clip on that frame (on the main timeline) and the movie clip has 3 frames that I want to be able to cycle through using the "Next" button that is on the main timeline. How can I go about doing this?
    Thank you,

    Thanks kglad! Works like a charm. :-)
    I had already named the instance of the movieclip and button so I just needed to change the code to match and it's working great.
    One other issue I've come up with now is that when it goes to the 3rd frame of the movieclip and I click next, it doesn't do anything. shouldn't it go back to frame 1 of the movieclip?

  • Navigating to Frame Label in mc from main timeline

    Lets say that in my main timeline, I have a number of frame
    labels. On stage I have a movie clip (let's call it bg_mc) which
    contains a tweened animation that has been looping repeatedly (so
    it has its own timeline with its own frame labels).
    I would like this to happen:
    - On the main timeline, the playhead enters a specific frame
    called "newBackground."
    - When that happens, I want the playhead in bg_mc to jump to
    the first frame in its timeline, "beginLoop."
    How do I accomplish this?
    Thanks so much for your help!
    David

    Now, this brings on another question... that is, what if the
    opposite is true?
    For instance:
    The main timeline plays to a stop(); at frame 10.
    At frame 10, a movie clip (countdown_mc) which contains a
    countdown timer, begins.
    When the timer reaches 00:00, I want to trigger the main
    timeline to continue and play the next frame (11).
    Thanks again for the great advice,
    David

  • Calling Nested Class Constructor from main()

    Consider the following code:
    public class OuterClass {
        static static void main(String[] args) {
            NestedClass nc = new NestedClass()
        class NestedClass {
            NestedClass() {
                 //constructor logic here
    }This call to the nested class constructor gives the following error: " 'OuterClass.this' cannot be referenced from a static context. However, if I cut and paste the code for NestedClass into its own class file, there are no error messages. I would like to be able to keep the class nested, so what do I need to do?

    static static void main(String[] args) {
    NestedClass nc = new NestedClass()
    }public static void main(String[] args) {
    NestedClass nc = new NestedClass()
    }

  • Accessing a VAR from within a Function

    I'm sure this is a simple question, but I have been batteling
    it all night. I am pulling data from a database, this works fine.
    the data loads into flash fine, but I cant figure out how to use
    this data outside of the function.
    I have looked at global var, timeline vars, but I must be
    missing something. I have attached my code, if you run it, it will
    load the data, I left the link live.
    In the function the data traces correctly, outside of the
    function it fails.
    Thanks
    ~Chris

    Ok, I attempted this last night, and I am unning into an issue.
    Heres what I have, I am pulling data from a mySQL database, into a
    php file that includes XML, Here is the PHP Script.
    $query = "SELECT * FROM Teams WHERE active = 'Y'";
    $resultID = mysql_query($query, $linkID) or die("Data not
    found.");
    $xml_output = "<?xml version=\"1.0\"?>\n";
    $xml_output .= "<teamData>\n";
    for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){
    $row = mysql_fetch_assoc($resultID);
    $xml_output .= "\t<item>\n";
    $xml_output .= "\t\t<teamName>" . $row['TeamName'] .
    "</teamName>\n";
    $xml_output .= "\t\t<manager>" . $row['Manager'] .
    "</manager>\n";
    $xml_output .= "\t\t<order>" . $row['LeagueOrder'] .
    "</order>\n";
    $xml_output .= "\t</item>\n";
    $xml_output .= "</teamData>";
    echo $xml_output;
    ?>
    NOTE: This script does run fine, if I run the PHP I do get the
    correct results.
    so I modified the Action Script you sent me a little to fit
    my PHP script. but I must be missing something. I think the problem
    is, what part of my XML goes after "studentData
    newTextField.text = studentData
    .teamName + " :: " + studentData.manager + " :: " +
    studentData
    .order;
    Thanks Again for the help
    /////////////////////////////////////////////////////////////////////////////////////

Maybe you are looking for

  • Acrobat shuts down with an error every time I access Password security settings

    Hi I wonder if anyone can help me. I have just bought Acrobat 8.1.2 professional, which I am using on a Windows XP machine. When I enter the Password Security-Settings dialogue, about 2 seconds later, I get an error message saying that "Acrobat has e

  • How do I delete missed call badge on FaceTime in Mac mini OS10.X?

    I missed a FaceTime call on my iPad. I deleted it there. It still shows up on my Dock. I have tried the Quit-->Show Recents Routine and eventually, the badge disappeared from the icon on the dock but still showed on the Applications screen. How do I

  • OSS Note deimplemented and included in Support Package

    Hi, We have deimplemented note in version 2, because version 3 was not possible to be implemented in SNOTE. Now it is deimplemented at all, and when I try to implement latest version of the note, I get the message SAP Note already implemented by Supp

  • Export to PDF - white background

    When I print ot export to PDF and I want to add a a background to the file in Acrobat afterwards, this background doens't seem to show... meaning the background is white instead of transparant. Any way to settle this? I need this option for my invoic

  • Fetching data from a number of tables selected at runtime

    Hi, I have this application that stores user specific information on weekly basis. The application creates a new table every week and stores information in it on around 60 thousand users. The table structure is exactly the same for every week. Analyt