AS help pls
- Started
- Last post
- 10 Responses
- airey
hi, just getting back into flash and am trying to learn how to make all my action exist in the main timeline and cut down on stupid repeating.
the code i'm using is for 2 buttons that effect 2 other mclips so that when one button is rolled over it plays the mclips animation and then plays the head back again on rollOut. see below:
functions created:
navItemOne_mc.onEnterFrame = function() {
if (navOneFade) {
navItemOne_mc.nextFrame();
} else {
navItemOne_mc.prevFrame();
}
};
navItemTwo_mc.onEnterFrame = function() {
if (navTwoFade) {
navItemTwo_mc.nextFrame();
} else {
navItemTwo_mc.prevFrame();
}
};button actions:
on(rollOver) {
this.navOneFade = true;
}
on(rollOut) {
this.navOneFade = false;
}any help hugely appreciated. even a hand on TweenLite usage instead of these clunky functions - anything basically. don't hate me cause i'm stupid.
- AndyRoss0
Is this supposed to be actionscript 3.0?
- airey0
AS2
- Mimio0
Is this for Flash Lite? Are there tweens in those MCs? Why use "nextFrame()/prevFrame" on a recursive event?
- airey0
currently it's 2 mclips shuffling to the next frame or back again using the 2 functions.
i'd prefer to use TweenLite but don't know what code to use.
any help any method would be appreciated.
- Mimio0
ok. You need to refer to
"navItemOne_mc.nextFrame();"
as
"this.navItemOne_mc.nextFrame...
- airey0
alrighty, to streamline the issue i'm ditching the mclis and just sticking with the 2 buttons. now, anyone klnow how i can fade the alpha on mouseover and fade it back for the mouse out + Press?
- Mimio0
myClip1.onEnterFrame = function() {
if (this.navOneFade) {
this.nextFrame();
} else {
this.prevFrame();
}
};
myClip2.onEnterFrame = function() {
if (this.navTwoFade) {
this.nextFrame();
} else {
this.prevFrame();
}
};
/////////////////////////////
Button
on(rollOver) {
myClip1.navOneFade = true;
}^ this will work
- jpea0
function fadeOne(){
TweenLite.to(myClip1, 1, {_alpha:100, ease:Elastic.easeOut, delay:2.5, onComplete:someFunction, onCompleteParams:[0, someParam]});
}
myClip1.onRollOver = fadeOnethat's the basic TweenLite usage
- airey0
thankyou. mimio, ta but the one i had actually works, it;s just that i'm trying make all my code centralised now in the main timeline, referencing the buttons and mclips rather than apply any actions into specific objects.
jpea, saviour. i'll try that now and endevour to get my head around it.
muchly appreciated.