actionscript can i have symbol with multiple animation? - actionscript-3

im building a multi page flash animation , the background is changeless and symbols come to view with some effect and enter a loop . its possible to add more animation effect on symbols and call them when a button is clicked ?
maybe i can label deferent part of symbol time line and call them with as?
something like this
symbol1.loading.play();
and
symbol1.exit.play();
p.s
im new in flash and prefer to do things with code

you can put animation in different moviclip, with first frame blank. As example given you can name movieclips with name as "loading" or "exit"

Related

Adobe Animate Actionscript 3.0 "clicktogotonextscene" code not working

So I have the following code for a button called "n2" and as you can see it's supposed to take me to the next scene when I click it, but it isn't working. It is inside Scene 2 and I'm trying to get to the next one and whenever I test the scene and click it, I don't even get an error, it just doesn't work.
Btw, it's a GIF defined as a movie clip and then as a button. Could that be causing the problem?
n2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextScene);
function fl_ClickToGoToNextScene(event:MouseEvent):void
{
MovieClip(this.root).nextScene();
}
If you put a trace in the function and comment out "MovieClip(this.root).nextScene();" you could then see if the function gets called on a button click.
I've not used animate before, but in flash you have to name your button/movieclip and then also name the instance. This allows you to create the object twice with two seperate names to be referred to by actionscript.
Not sure if this helps but thought I'd give you some things to try, good luck

How do i get my UILoader to play an .SWF once then disappear?

How do i get my UILoader to play a .swf file once then disappear until called upon again?
I am creating a guitar tutorial app that shows you chords and the transitions between them. to display the chords I'm using standard Flash graphics and for the transitions i am using a UI Loader to display the .swf files for instance, on the C chord frame, the fingers are in position and the UI Loader is a layer on top of it, when the chord transition is selected from the list component it loads the chordtransition.swf.
The problem is that once the swf is loaded it plays on loop, ive added "stop();" in many different places as people suggest and it doesn't make a difference.
I would like to be able to click "C-D" on the component list then for the .swf to play once then disappear.
Any ideas??
A strategically placed stop() should work (last frame on the timeline in the swf). You'll need to stop the right movieclip - if your movie has nested clips you might be stopping the wrong clip.
However, creating multiple swf's just to show different chords looks like overkill to me.
Create clips showing all chords on the main timeline, and add frame labels to indicate where they start and put stop() at the end of every chord animation (are you using animations?).
Use movieclipWithChords.gotoAndPlay("chord_C");
If you are not using animations you can use movieclipWithChords.gotoAndStop("chord_C");
Of course you can also create labels like 'C' and 'D', and use those as a direct mapping of the chords.
Update: After reading your question again I realize you are actually showing clips of a transition from one chord to another. In that case you can still use my suggestion as above, only your labels will not be for the individual chords, but for the chord transitions e.g. 'transition_C-D' or 'transition_G-B'.

AS3 - Using same symbol different image?

Basically I'm working on a new game and have decided to come up with the idea of having different enemies - however would I have to create multiple symbol's for these enemies or can I use that one symbol and change the image that is loaded onto it?
If yes - how would I go about doing this?
Currently the symbol is known as Enemy
Your symbol must be movie clip. In each frame there are different images and added by label. to change the enemy you can call:
Enemy.gotoAndStop(labels)// use Enemy.gotoAndPlay(labels) if you want the animated ones.
with labels is a string.

AS3 Play contents of a symbol

I've grouped a multiple layer 1 frame actionscript driven animation into a symbol. (simply put, imagine a 1 frame image being tweened by code over a few sec, in this symbol)
Now I'd like to play the contents of this symbol using an event listener.
But
stuff_mc.gotoAndPlay(1); and Test Movie doesn't play a thing (doesn't even show the contents of the symbol (the picture) which can actually be seen on stage).
If I go inside the stuff_mc and Test Scene, it works perfectly..
So how do I play stuff_mc from the stage?
Thanks in advance
It sounds to me like you are using multiple scenes. If that's the case then this is most likely where your problem is. Scenes are generally a bad idea in Flash – Adobe itself admits this.

AS3 - how to start all over again a flash movie

This may be very simple, but I have no idea how to do this.
I created a photo gallery in AS3, everything is on one keyframe. In this photo gallery I have a link to home. My goal is, when someone clicks the "home" link I want everything to start over. Any ideas on how to do this in AS3?
Appreaciate it.
L.
call flash player container
usually the HTML page and use JavaScript to reload the flash player
flash.external.ExternalInterface.call(jsFuncRestart);
jsFuncRestart is a JavaScript function in the HTML file
and now in the js function just create a new object and replace the current flash object
with the new one
You probably animate everything with as3, right? Then just make a reset function that puts all the images back to their original place and start the animation all over.