AS2.0 help
- Started
- Last post
- 10 Responses
- jysta
I am just stating to move away from timeline based animations and have found MCTween incredibly useful and easy to pick up.
In an attempt to learn actionscript I have been playing with the activated menu example http://hosted.zeh.com.br/mctween…. In the comments they talk about the flickering of the buttons. I have tried to include some invisible buttons but can't understand how to handle the tween event on (mybutton_1,2,3 etc...) from another set of invisible buttons(e.g. hit1,2,3 etc...)
e.g.
invisibleButton.onRollOver = function() {
myButton[i].scaleTo(balh blah);
}But this does not work. What am I doing wrong?
- jysta0
The source I'm playing with is from here:
http://hosted.zeh.com.br/mctween…
- Mishga0
did you install the extension?
http://hosted.zeh.com.br/mctween…- yeah all installed, it works ok but I'm trying to apply the onRollOver to invisible buttons instead of the array options :-/ im totally lost!jysta
- Mishga0
try this one, i read somewhere it's a little bit faster than the one you use:
http://laco.wz.cz/tween/cheers!=)
- neverblink0
where is the 'i' getting filled in that function?
- jysta0
^ might make things a bit clearer neverblink.
// This is an array, a list of the buttons used.
var myButtons = [this.myButton_1, this.myButton_2, this.myButton_3, this.myButton_4];// Loops on all buttons from the first to the last one
for (var i=0; i<myButtons.length; i++) {// When the mouse rolls over this menu option... go down just a bit.
// NOTICE: I'm not taking into consideration the problem of having the hit area going down and "moving" the
// mouse area and out of the button (possible rollover flicking). This is just a simple example afterall.
myButtons[i].onRollOver = function() {
this.scaleTo(90, 0.5, "easeoutelastic");
};
}the NOTICE: bit is what Im trying to solve (with invisible buttons)
- ondo0
try this
// This is an array, a list of the buttons used.
var myButtons:Array = [myButton_2, myButton_3, myButton_4];// Loops on all buttons from the first to the last one
for (var i:Number =0; i<myButtons.length; i++) {
var thisObj:Object = this;
// When the mouse rolls over this menu option... go down just a bit.
// NOTICE: I'm not taking into consideration the problem of having the hit area going down and "moving" the
// mouse area and out of the button (possible rollover flicking). This is just a simple example afterall.
thisObj[myButtons[i]].onRollOver = function() {
thisObj.scaleTo(90, 0.5, "easeoutelastic");
};
}the NOTICE: bit is what Im trying to solve (with invisible buttons)
- jysta0
I know its a big ask, could I e-mail my FLA to someone??? Im banging my head against a brick wall.
- rson0
I dont know what you are trying to do...but myButton[i].scaleTo(balh blah);
your first post is missing an "s"
- rson0
Here is a file I wrote for my class. I think it is what you are trying to do - the animation, but the concept is there.
- jysta0
http://www.jystdesign.co.uk/land…
This is the application of what Im trying to build using pure tween/action script, at the moment it's all timeline based and I wanted to move away from that to gain better animation.This original version uses if/else statements referencing certain frame labels. I was using the example from MCTween to build from but I can't for the life of me see how to apply the event handling to my invisible buttons.
Hope that makes things a bit clear. It seems to me like the AS for this is a bit out of my depth.