Hey there, as U can see I’m pretty new around here, so hello to all of U, and happy nu year!
I have a little problem here with a simple menu I bought on Flashden the other day.
This is the one:
http://www.flashden.net/item/powerful-menu-xml-6-wave-text/15675
It was done in AS2, but I need it in AS3. I already converted the majority of the code by myself, but there’s a little function (which is responsible for the motion of the menu itself) which I can’t get to work properly.
...
var minScale:Number=1;
var xProx:Number=5;
var yProx:Number=50;
...
function wave(e:Event):void {
if (parent.mouseY<yProx && parent.mouseY>-yProx) {
this.scaleX = (Math.max(this.scaleX-((this.scaleX-minScale)/5), this.scaleX-((this.scaleX-(((xProx-Math.abs(parent.mouseX-(this.x+[this.width/2)))/xProx*100)))/5](http://this.width/2%29%29%29/xProx*100%29%29%29/5))));
} else {
this.scaleX+=(minScale-this.scaleX)/3;
}
this.scaleY = this.scaleX;
}
[FONT=monospace]
[/FONT]This entire section of code is put in each instance of the button movieclip (which are the textual items in this menu), so that each button scales itself according to the mouse movement. The syntax is ok, the flash movie compiles without errors, but the menu doesn’t work like it should. I guess it’s something to do with scaling, which has changed in AS3, but no matter how I tried to modify some values, it’s still now working.
Oh, and of course the function wave is assigned as an event handler to the ENTER_FRAME event of these button mcs. Basically, when I test the movie, it does scale and move but not in the right way, that’s why I think it must be something with the scaling calculations…
So anyway, I’d greatly appreciate any help on this matter, thanks!