Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please i can't handle this problem

Status
Not open for further replies.

tanatos

Programmer
Sep 7, 2003
17
ES
I've been searching support to get "fade-in fade-out" effect and at last i found it. But it works en mail timeline, and i'm unabled to get it work ina mc.
The code is:
onClipEvent (enterFrame) {
// if the mouse IS over the button ...
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
// if the button is NOT at 100% alpha...
if (_root.fade._currentframe<_root.fade._totalframes) {
// keep playing the next frame...
_root.fade.nextFrame();
}
// if the mouse is NOT over the button
} else {
// if the button is NOT at 0% alpha
if (_root.fade._currentframe>1) {
// keep playing the previous frame...
_root.fade.prevFrame();
}
}
}

What i have to change to get it work in a movieclip?
Thanks in advance to all
 
that code goes on a clip

i agree it should go on the main timeline....very bad practise to attach code to objects
 
Can't be worst than using no caps & no punctuation in posts (what a good example that is!), making spelling errors (even if practise is a non used variant of pratice) and your constant bad habit of posting code with sloppy syntax!

As for you Tanatos, this code which is mine, has really nothing to do with a fade in & fade out effect, even if in the movie it was extirpated from, it did in fact have that effect.

&quot;_root.fade...&quot; refers here to an instance name of a movie clip to which this code was attached, and which actually contained alpha tweens that did produce an actual fade in & fade out, but not in the sense you understood it.

If you post your .fla or e-mail it to me, i'll try to indicate what you could do to make it work. You can get my e-mails, if you hit my handle user name.

Regards,

cubalibre2.gif
 
the code i attached in the post is from oldnewbie, a man i've learnt a lot from taking a look at his post in this forum. The case is just taking me, this code example is the only was helpful to me getting working the effect &quot;fade-in...&quot;, but cause my modest knowledge of actionscript, i only know set working effect when is applied in main timeline. If i work in a movieclip, almost probably sure due my weak base in relative and absolute paths actionscript code, the result is a fail.
I'm gonna try to send a .fla to oldnewbie.
Thanks
 
I made such a thing with simple motion tweenig
so I got 2 pictures on on top of the other and made a motion tween of 20 frames... before the motion tween i got a keyframe with the 1st picture only and said stop then i put an onmouserollover and said gotoandplay and set the first frame of teh motion tweening the i made a motion tweening where it fades in and set in each frame of the motions the script with onmouserollout and said got to frame x in the fade out sequence and in the fade out sequence i scripted it the other way around ...


so you can't get this work in your swf because it needs an only timeline...
I solved this in amkin' it an own swf and load it into the other...
 
Thanks to all, specially to oldnewbie. Everything works fine now. From i keep the fla. code you post with explanations attached to them, i'm learning
faster than ever.

Bye
 
&quot;Can't be worst&quot; - If you still insist on resorting to playground taunts and picking apart spelling and grammar shouldn't you at least get your own spelling right? [tongue]
 
Merci d'avoir attiré mon attention sur cette faute d'ortographe... Il y a des mois, je dirais même des années que j'utilise cer ortographe sans que jamais personne ne m'ait corrigé. J'ai toutefois l'excuse que l'anglais n'est pas ma langue maternelle, et que règle générale et en toute humilité, je ne fais pas beaucoup de fautes du genre. Dans le doute je vérifie toujours dans le dictionnaire...
Which, by the way I have just done...


Both spelling seem to be accepted?

In the end, that spelling error, if it is one, doesn't make my code, to which Bill was referring, any worse than his, and in this case would not even work in Flash versions prior to MX.
And that was the point I was trying to make! [tongue]

Are you related Bill?

Regards,

cubalibre2.gif
 
English is also not my mother tongue but in the context you used it 'worst' was a spelling mistake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top