A Flash Developer Resource Site

Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: Button inside a mc

  1. #21
    The Running Child
    Join Date
    Nov 2006
    Location
    Erfurt, Germany
    Posts
    42
    flash can be a real pain in the ass.

    i tried i as described but the same problem occured.
    but i finally found a way. it's incredebly confusing but it somehow works.

    when the mouse hovers over the 1st button it loads a new swf, which is the field, that is supposed to pop up. in that is the button and a button which is very slim and surrounds the field. when you click on the button it opens the link and if you you move your mouse out of the field and therefore out of the framing button it unlaods itself.

    wow... thats some ****. but when i didn't have the framing button it would either not unload itsef or the button wouldn'T trigger

    i have to use it now the way it is, because i'm running out of time and it's 4:05 a.m. here already.

    but maybe someone has a better solution for upcomming generations...

    cu

  2. #22
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    maybe someone has a better solution
    think i just posted it..

    gparis

  3. #23
    The Running Child
    Join Date
    Nov 2006
    Location
    Erfurt, Germany
    Posts
    42
    sorry. you must have written it while i was trying and typing along.

  4. #24
    The Running Child
    Join Date
    Nov 2006
    Location
    Erfurt, Germany
    Posts
    42
    Quote Originally Posted by gparis
    problem is you can't say:
    someButton.onRelease... if someButton is not present.
    Your button being on the second frame of that movie makes it "not present"

    Solution:
    Have that button on frame 1 also and have it invisible with:
    someButton._visible = false;

    or have that someButton.onRelease function in the same frame that the button sits.

    gparis
    i tried the second solution (had treid it before, btw) but no result. am i stupid?

    the first solution won't work because i the actual file the uppopping field will be much bigger then the one from the first frame. at least i don't see how it could work without already triggering when the cursor gets over the big invisible field.
    Attached Files Attached Files

  5. #25
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    ..also do not use button actions on a MC (onRollOver...) it will have button behavior and buttons inside buttons..... don't work.

    *edit: as i don't know if you're familiar with movieclip handlers i made it on you fla. see attached.

    gparis
    Attached Files Attached Files
    Last edited by gparis; 02-24-2007 at 12:17 AM.

  6. #26
    The Running Child
    Join Date
    Nov 2006
    Location
    Erfurt, Germany
    Posts
    42
    finally the thing i looked for.

    i am not familiar with the handlers. but i think its time now to become.

    thank you very much. (even though i have to reprogramm it again now, but it will work better then)

  7. #27
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    you're welcome. Maybe you've heard it is best practice to put your code on frame1 on the main timeline. It's true in the sense that readability, clarity etc.. are better. But, in my opinion, not ALL code always needs to be on frame1, not in ALL cases.
    For any other application, there may be impossibilities (like in your case: button only on frame2 of a nested clip) and there is no way writing an extra 5 lines of code (sometimes involving the use of cpu intensive loops) just to make it work, is worth it.
    just my opinion.

    gparis

  8. #28
    The Running Child
    Join Date
    Nov 2006
    Location
    Erfurt, Germany
    Posts
    42
    sure why not

    everything works pefectly now.

    thanks again

    going to bed now ( 6:14 a.m. ... other people get up now)

    well
    good night

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