|
-
[F5] Play a movie-Clip
Hi,
please forgive me that stupid question, but i don't know how to handle it (in Tutorials i found something, but i didn't work).
I have a Flash-Movie with several Instances and one scene.
Furthermore i have a movieclip which is called "Heroes".
This Movieclip contains an Graphic Object and on the single Instance 60 Frames. In the first frame is Alpha=0, on Frame 30 the Bitmap is Alpha=100% so this is to fade the image in.
On Frame 30 is Action "Stop", because from 31-60 the image will fade away again.
In the Main-Movie on the last Frame, i inserted the Movieclip so the Image is fading in and stays visible. The Stage is complete.
Now i want the Heroes to fade away, when a Menu-Button is pressed.
So i wrote in the Action-Field from the Button
on (release) {
Heroes.gotoAndPlay(31);
}
In the hope, the Movieclip plays from 31 to 60, but nothing happens.
What am i'm doing wrong ?
Thanks in advance for your time.
Yours
Marco
-
first check if you have the right target with this code instead of the one you wrote on your button:
Code:
on (release) {
Heroes._rotation=45;
}
does it rotate?
-
No, it doesn't do anything.
I thought the target is defined by the "Heroes."
-
Modulator
Is the movieclip's instance name Heroes or is that just its library name?
If it is just the library name, you need to change the instance name to Heroes and change the button code to this:
code:
on (release) {
_root.Heroes._rotation=45; }
As a Gamer, you play by the rules.
As a Programmer, you play as God.
-
The Library-Name is "Heroes", the Instancename is "Heroesi"
How is the Syntax for this ?
-
Modulator
code:
on (release) {
_root.Heroesi.gotoAndPlay(31); }
Whenever you want to refer to one object from another, you usually use _root (to take the referal level back to zero basically). Also, whenever you are referring to another object, it is usually the instance name that you are referring to. I think one of the only exceptions is text boxes, in which it would be the variable name that you'd be referring to.
As a Gamer, you play by the rules.
As a Programmer, you play as God.
-
OK, i understand what you are saying and it makes sense.
But your code doesn't work.
If i understand your code right, he's just saying, play the instance "Heroesi" from the main Timeline from frame 31. Don't i have to tell him that i want the movieclip's Frame 31 to play from ?
-
Modulator
Eh?
Hang on...is your layout like this?
Code:
Timeline(_root)_(Framelength = whatever)
|
-->Heroesi(MovieClip)_(Framelength = 60)
|
-->Image(Graphic)_(Framelength = 60)
Where you have the Graphic doing all the effects?
or this?
Code:
Timeline(_root)_(Framelength = whatever)
|
-->Heroesi(MovieClip)_(Framelength = 60)
|
-->Image(Graphic)_(Framelength = 1)
Where the MovieClip alters the effect?
Could you upload your .fla file and let me take a look?
P.S. Sorry about asking a whole lotta questions back ^_^;;
As a Gamer, you play by the rules.
As a Programmer, you play as God.
-
Because it's little more than 3MB i can' upload it here. I put it on my Server. rightclick on this Link.
I'm German, so i hope you'll find what you need. The Button with which i tried the code is "Programm".
Feel free to ask. I'm thankful for your help.
-
Modulator
Ok, I think I know what you did wrong...
When I said to rename the instance name, did you just rename the layer?
If so, you need to click on the actual movieclip and change its instance name.
It's getting late over here (or rather, really early, as in 3am) so I'm turning in now. But I'm sure the rest of the Flashkit board should be able to help out ^_^.
As a Gamer, you play by the rules.
As a Programmer, you play as God.
-
That's it. Forgot to define an instance-Name. Thank you.
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
|