Groups | Blog | Home
all groups > flash actionscript > november 2005 >

flash actionscript : Can't describe my question here, see post.


stillwaiting
11/9/2005 9:37:26 PM
Okay, I learning here and have made a lot of progress (mostly thanks to other posters).
My question now is this. I have accomplished getting the mc to expand and contract as I want it but now I want to figure out how to get it to expand
one direction rather than both ways equally. In other words, rather than it expanding 3 pixels to the right and left, I want it to expand 6 pixels to
the right etc.

I have tried adding this in their respective functions but it does weird things:

________onRollOver___________
|
if (this._y < 206) { |
this._y = this._y + 3; |
} |
|
_____________________________|

_______onRollOut_____________
|
if (this._y > 200) { |
this._y = this._y - 3; |
} |
_____________________________|



Here is my code w/out the above.

_____________________________________________________________
button1._alpha = 30;

button1.onRollOver = function() {

this.onEnterFrame = function(){
if (this._width < 206) {
this._width = this._width + 3;
}
if (this._height < 36) {
this._height = this._height + 3;
}
if (this._alpha < 100) {
this._alpha = this._alpha + 35;
}
else {
this._width = 206;
delete this.onEnterFrame;
}
}

}
button1.onRollOut = function() {

this.onEnterFrame = function() {
if (this._width > 200) {
this._width = this._width - 3;
}
if (this._height > 30) {
this._height = this._height - 3;
}
if (this._alpha > 30) {
this._alpha = this._alpha - 35;
}
else {
this._width = 200;
delete this.onEnterFrame;
}
}
Pal_w_G
11/10/2005 12:00:00 AM
as far as this concerns expanding and contracting depends on the registration
point of the clip. Make the registration point on the top left corner when u
are creating ur clip and see whether it solved out.
stillwaiting
11/10/2005 7:38:26 AM
That worked. Thanks a bunch.

stillwaiting

[quoted text, click to view]
AddThis Social Bookmark Button