A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Rollover - I want to 'swap' movieclips?!

  1. #1
    Registered User
    Join Date
    Oct 2011
    Location
    Melbourne, Australia
    Posts
    4

    Rollover - I want to 'swap' movieclips?!

    Hi guys,

    Newly signed up, after trawling around here for a solution to my problem for a while! I didn't think something so seemingly simple would be so difficult to solve...so here goes;

    http://elbee101.com/rollover.zip

    Is the .fla and .swf so you can see my lame attempt at what I'm trying to achieve. I'm trying to simplify the problem before I go down the full path, hence the simple square rollover animation and reverse rollout.

    A tile, you rollover it and it grows...can do! rollout and I'd like the box to re-tract, hence I'm playing the 'reverse' animation. Yet I can still see the 'expanded' box underneath?! I want this to be gone/not visible, and then the next time I rollover the (small) tile, it grows etc...

    I've tried removechild, then creating a new dynamic movieclip and I'm getting lost with what I think its name is. At one point I even managed to jump this little hurdle, then only for the next time I rollover the tile, nothing happens, as I assume its instance name is no longer 'btn'.....?? Thoroughly confused!!

    I'm digging a hole, and its filling with water! Any help would be greatly appreciated please

  2. #2
    Member
    Join Date
    May 2010
    Posts
    32
    What you can do is add all animations to the movie clip (card) and set stop() points. Judging by your files probably frame 1 for normal, frame 20 for enlarged and frame 40 for reduced again.

    Now in the mouse over and mouse out methods, your code can look more like:
    Actionscript Code:
    function manageMouseOver(event:MouseEvent):void{
      trace("over");
      btn.gotoAndPlay(2);
    }

    function manageMouseOut(event:MouseEvent):void{
      trace("out");
      btn.gotoAndPlay(21);
    }

    Alternatively to stopping at frame 40, you could make it just jump back to frame one, i.e rather than stop(), you can gotoAndStop(1).

    Hope this helps.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Location
    Melbourne, Australia
    Posts
    4
    thanks for that Sodium. I was messing around with "gotoAndPlay" and having the reverse animation in the 1mc, but I jut didn't point it in the right spot!

    working now, except the client has made a 'small' change to the required functionality and now again I am completely stumped, been trying to do something for 5 hours and I just keep going in circles and getting to the same dead-end spot I got to 4.5 hours ago :/

    I'll start a new thread...

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