|
-
Senior Member
movieclip AS _alpha fade trouble
Hello again!
Now that I'm finally moved into my new place, I'm getting back to working on my animated cartoon. During my "off time" I got a copy of the old Moock ActionScript guide and read through it. I'm a pretty decent php and ruby coder, so I figured actionscript would be fairly easy to pick up. But, alas, I'm having trouble right out of the blocks. Hence this post.
I'm trying to fade a bit of floating/shimmering text in and out during an opening credit sequence. I got my text doing what it needs to do and stuffed it into a one-frame movieclip. Then, I placed the following code on that one frame:
Code:
onClipEvent (load) {
this._alpha = 0;
}
onClipEvent (enterFrame) {
for (var i = 1; i < 60; i++) {
if (i < 20) {
this._alpha += 5;
}
else {
if (i > 40) {
this._alpha -= 5;
}
else {
this._alpha = 100;
}
}
When I play the resulting swf, the text floats/shimmers just as pretty as you please, but no fade in and fade out. Thinking my code might be the culprit, I tried substituting code I found on the board that, while it didn't aim to achieve the same sort of fade in and fade out I was going for, did nonetheless use the same onClipEvent handlers ("load" and "enterFrame"), but that code also failed. So I'm thinking that i've done something wrong in the way I've attached the code? Here's my structure:
Main timeline - has four keyframes. Keys 1 and 3 have 0 tweens; key 2 has 60.
mcFadeInOut is manually placed on the stage in keyframe 2 and manually removed in keyframe four. mcFadeInOut is itself one frame long and has the above code on that frame. This mc in turn contains two child clips that actually do the floating/shimmering work, said work achieved via tweaked motion scripts.
Any help setting me straight would be appreciated. The sooner I can get this working, the sooner I can get back to pretending to be as smart as I like to think I am. 
Thanks,
Matt
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
|