It needs to grow!!
Im trying to maka a mc grow when the mouse is over it.
basically script needs to be like....
on rollover
if this_mc's width or height is less that 200
increase its width and height by 5
until it gets that big
I tried various ways of doin it "wrongly" but the only way I can think of doing it is by nesting ON handlers, which isn't allowed
Frantically flickin through a Colin Moock book....
Teoma
a "for" may help you out here, ie:
on (mouseover) {
for ( i=1, i>=200, i++) {
this._height = this._height+i
}
}
or something like that.. ^_^
i'd suggest looking it up in your
FlashMX actionscript dictionary
for the proper way to write it...
good luck!
AKA [ Paul Bainbridge]
Wrong
code: on (mouseover) {
for ( i=1, i>=200, i++) {
this._height = this._height+i
}
}
Right
code: on (mouseover) {
for ( i=1; i<200; i++) {
this._height = this._height+i
}
}
I keep trying things like that,, all I get is endless loops and flash freezin,
code:
on (rollOver) {
for (i=1; i<=200; i++) {
this._height = this._height + i;
}
}
like your example gomar, what this does is change the size instantly and not like just using tweening to change a size, well thats the effect i want to acheive, just with AS.
think i remembered a fla i have that duz it, or i might look at setInterval to do it. ARGH!
Last edited by Teoma; 09-24-2003 at 01:16 PM .
AKA [ Paul Bainbridge]
Ah i know what your looking for
code:
//frame 1
bar._xscale=0
//frame2
bar.xscale+=5
//frame3
if(bar._xscale<100){
gotoAndplay(2);
}else{
gotoAndStop(4)
}
//frame4
stop();
This should get you started in trying to acomplish the effect your affter
can i do that in 1 frame with rollOver event?
AKA [ Paul Bainbridge]
this code would have to be in a an mc of it own
frame 1 would have a stop action
the each frame after as above
the rollover event would have something liek
code:
on(rollover){
mcwithgrow.gotoAndPlay(2)
}
Or something like that
ahh, here's the movie i was thinking of... this may be a help for some code.. it's not exactly what you want but i'm sure you can rework it..
good luck! ^_^
Flashkit/Movies/Elastic
and yes those "," and ";" would mess you over well.. hehe.. ^_^
Thats addictive, although doesn't work if exported to Flash 6 or 7, I played about with it to make it work, n saved it as MX format,
The code will allow anything to expand in size when rollOver occurs, so if anyone else want to see it, it's attached
Only problem is, It's lost the elastic effect
Attached Files
I never used the for command, so I don't understand how it works, but I use:
code:
on(rollOver) {
while ( _root.mcname._width < 200) {
_root.mcname._width +=5;
_root.mcname._height +=5;
}
}
Or something like that, I'm not sure if you can set the width and height with _width and _height but I think you can.
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width