A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: trace button in MC

  1. #1
    Member
    Join Date
    Feb 2010
    Posts
    79

    trace button in MC

    Hi guys,

    Guys i just created MovieClip and the fifth frame of the movieclip created one button. I just tried to trace that button, but i could't. If i put that button in the first frame i can trace that. Why this is? Pls explain me ..

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Where is your trace?

    If it's anywhere other than the fifth frame, then the button doesn't exist when you try to trace it.

  3. #3
    Member
    Join Date
    Feb 2010
    Posts
    79
    I am tracing button from the root.

  4. #4
    Member
    Join Date
    Feb 2010
    Posts
    79
    If i put
    Actionscript Code:
    trace(my_mc.my_but);

    Actually the button is inside the movieclip... then why it could't able to trace the button, where ever the button is inside the mc.

  5. #5
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Code:
    trace(bhagavath.lunch_next_tuesday);
    Until my_mc is on the frame with my_but, its my_but property is not set.

  6. #6
    Member
    Join Date
    Feb 2010
    Posts
    79
    Sorry sir i am not clear with your answer.... If u can , pls explain more.. i don't know wether u got my question r not.

  7. #7
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    The code I posted was to try to illustrate the fact that you can't refer to things in the future.

    Your question is why can't you trace something on the fifth frame of a movieclip, and the answer is because that thing doesn't exist yet.

    What exactly are you getting when you trace? I'd expect null, but if you're getting some error, post it.

  8. #8
    Member
    Join Date
    Feb 2010
    Posts
    79
    i wrote a script that the movie clip should stop in the frame 5. there is no button from the frame 1 to 4. In fifth frame the button is there. Once i clicked the button there should be some feed back. But the script should not be there in fifth frame. It should be in root frame.

    i put a script as

    trace(my_mc.my_but);

    i got output s "null",

    but if put

    trace(my_but);

    in the frame fifth i can trace out that ,.... why the reason is?
    i have give the attachment file..
    Attached Files Attached Files

  9. #9
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    I don't know how else I can tell you. The my_but property of my_mc is null until my_but exists. You cannot access it before that.

  10. #10
    Member
    Join Date
    Feb 2010
    Posts
    79
    Its ok... may be of my beggining stage i could't get it ... any thank u for ur support..

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center