A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: attachMovie()

  1. #1
    Junior Member
    Join Date
    May 2003
    Posts
    19

    attachMovie()

    ok say you got a big green circle movie clip on stage...and you attach a small red square button or movieclip to it at runtime using
    the attachMovie method. Also, suppose you set the on(rollOver) event for that small red square to change the alpha of the square...how come this doesnt work when you roll over the square? It seems the square is trapped inside the circle movieClip somehow. (only the on(rollOver) event for the circle works...please help!

  2. #2
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    This fla is for MX. Is this your problem?
    Attached Files Attached Files
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  3. #3
    Junior Member
    Join Date
    May 2003
    Posts
    19

    attachMovie

    Yes that is close! But, in my movie...I have circle.onRollOver = function()....blah blah blah try setting the onRollOver even for the circle, and the one for the square wont work anymore...its like it overrides it. Any suggestions??
    thanks

  4. #4
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    Try this. Makes the rollOver for the square and the circle equal.
    Attached Files Attached Files
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  5. #5
    Junior Member
    Join Date
    May 2003
    Posts
    19

    dcdc

    thats close, but I need just the square to change and nothing else...
    you see there will be many squares on this circle, and each one needs to register an onrollover differently. damn this is tricky. I cant find any tutorials that even acknowledge this problem. by the way, thanks for the help man!

    mikell


    ps. basically this is what needs to happen...when the user click on the circle...a square appears. the user can add many squares. (I've added collision detection so they cant add one on top another one.) so I got a bunch of squares attached to the circle, but I cant get any of them to register on the onRollOver event...

  6. #6
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    With my code, could you (or you could) add a code with something like...
    code:
    with("newSquare"+i){
    this.onRollOver=function(){
    //actions
    }
    }

    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

  7. #7
    Junior Member
    Join Date
    May 2003
    Posts
    19
    nah thats not gonna work. it just seems that if you attach a movie to another movie, you cannot register any on(whatever) events with the attached movie if you hav an on(whatever) event registered with the movie which you are attaching to. It you can think of something though, I'm all ears! try attatching a little square to a big circle...setting on(rollOver) events for both

  8. #8
    FK's Giant Steve_w_V's Avatar
    Join Date
    Mar 2003
    Location
    San Jose, California
    Posts
    2,113
    Hmm...I see your point.
    The other day, I bought a box of animal crackers. On the side, it said "Do Not Eat if Seal is Broken". I opened the box and sure enough...

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