A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: de ole "dynamic resizing of a square" ...

  1. #1

    de ole "dynamic resizing of a square" ...

    I have a square that is being dynamically resized depending on which button is selected. The problem is that when it resizes it resets the original size of the symbol and tweens from that size and not the previous size it had tweened from (Did that make sense?!) So the box jumps between transitions and does not go from dimension to dimension smoothly.

    Also I wanted to add some velocity and elasticity to the transitions.

    Here's the code on each clip (I'm not a AS guy. I read this in a post and tried it on my own) ....
    code:

    onClipEvent (enterFrame) {
    // Set dimensions and speed and more
    w = 200;
    h = 150;
    xpos = 100;
    ypos = 150;
    speed = 5;
    // Move the thing
    this._width += (w-this._width)/speed;
    this._height += (h-this._height)/speed;
    }




    I've included the file in case my assessment of the issue was too confusing.

    Looking forward to enlightenment ...

    Thanks
    Attached Files Attached Files
    Last edited by Ridick; 11-02-2005 at 07:18 PM.
    "Lets get right down to brass tacks....How much for the ape?"

  2. #2
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Location
    Phoenix, AZ
    Posts
    427
    When you go to a new keyframe, the movie clip instance reloads, thus returning to its initial state prior to beginning it's approach to the new dimensions. I've attached a reworked .fla that shows the solution. Instead of going to a new frame with new variables to approach, just send the clip the variables. Now it approaches from where ever it already is instead of reloading to it's initial state.

    take care

    _b
    Last edited by bitsk308; 01-10-2008 at 01:32 PM.

  3. #3
    Ahaaa!! Thank you so much! Eternally grateful for this!! So ideally I could trigger sound effects and elasticity in the same fashion by sending them as variables?
    "Lets get right down to brass tacks....How much for the ape?"

  4. #4
    Quote Originally Posted by Ridick
    Ahaaa!! Thank you so much! Eternally grateful for this!! So ideally I could trigger sound effects and elasticity in the same fashion by sending them as variables?
    Boy was I off target! Variables Schmariables!! But I found another thread regarding resizing with elasticity. Complex stuff but I was able to understand enough to edit it to fit my needs. Thanks again for your help!!!
    "Lets get right down to brass tacks....How much for the ape?"

  5. #5
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    i'm having the same problem... anyway you could post that fixed FLA in MX2004?...I can't open the attached.

    Thx
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  6. #6
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Location
    Phoenix, AZ
    Posts
    427
    I'll change it 04 and repost tomorrow, I did that one from my work computer.

  7. #7
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    thanks. i appreciate it!
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  8. #8
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    thanks. i appreciate it!
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  9. #9
    Getting There! bitsk308's Avatar
    Join Date
    Jul 2000
    Location
    Phoenix, AZ
    Posts
    427
    04. Let me know if you have any problems

    _b
    Last edited by bitsk308; 01-10-2008 at 01:32 PM.

  10. #10
    Can't Re-Member madzigian's Avatar
    Join Date
    Apr 2004
    Location
    Boston MA
    Posts
    2,662
    thanks!!
    Please DO NOT PM me simply for individual help. Post in the public forums...that's what they are for, and they allow others to benefit as well. - Thx
    OS X 10.3.9 || Flash MX04 Pro
    | del.icio.us || furl || Helpful Source Files || Free Pixel Fonts |

  11. #11
    Official Dealer
    Join Date
    May 2003
    Location
    Melbourne, Australia
    Posts
    16
    Hi there...

    I was hoping someone could also explain to me how you could have a movieclip always attached the left edge of the movieclip that is resizing.
    example...a menu...the blue box would contain the content but the menu would always be stuck to the left edge of the box.

    also i notced that if you add a slightly larger box behind the blue box to imitate a border, when it stretches wider than it is high it warps....

    What I'm trying to acheive is something like this www.dubko.com

    Any help would be much appreciated.

    Thanks

    Robert.

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