|
-
Translation from 2.0 to 3.0
I'm fairly new to 3.0 and know zero 2.0. As I searched around for some info on how to get something done (basically I have a scene of a farm on screen, when user clicks on an animal, the animal button or (movieclip inside button) "zooms" or enlarges and centers on the screen, makes animal sound and goes back to original position.
Well, I found this, which I believe would be a method that works ... but it's in Actionscript 2.0 and am having a hell of a time translating it to AS 3.0. I tried to set up an event listener on the button that sets off a conditional function increasing xscale and yscale as long as it's under the desired size (350). Anyway, it's not working. Here's the 2.0 actionscript I found here on flashkit. Wondering if anyone has any tips on how to translate.
button.onPress = function() {
var yourpic:MovieClip = _root.blabla;
var maxwidth:Number = 400; // The width of the enlarged picture
var maxheight:Number = 400; // The height of the enlarged picture
var speed:Number = 2;
this.onEnterFrame = function() {
if (yourpic._yscale < maxheight) {
yourpic._yscale += speed;
}
else {
...... etc etc.
}
}
There is also a great tutorial showing this code (even simpler method, though it seems incomplete) - clearly easy stuff, but I'm not seeming incapable of translating to AS 3.0:
stop();
this.onEnterFrame = function(){
if(zoom == true){
prevFrame();
}
}
this.onRollOver = function(){
zoom = false;
play();
}
this.onRollOut = function(){
zoom = true;
}
Last edited by Leftyplayer; 08-11-2009 at 05:08 PM.
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
|