|
Post by archy12 on Mar 26, 2009 7:52:52 GMT 2
it's been a while since i asked for assistance. here goes: if i want to have an interactive dialogue scene where the viewer can click a button to proceed in the story, what kind of actionscripting must i use? do i add a play("scene") on the dialogue area? also, if i want to cue music; for instance, music is playing while there is dialogue, after a few clicks, new music plays, what do i need to do? and finally, if i want characters to stay still while there is activity behind the background, do i need to use a loop actionscript? i gladly appreciate any help
|
|
|
Post by viruszero on Mar 26, 2009 16:58:36 GMT 2
Well, for the click to proceed part here's what you do:
1- on the frame you want it to stop at enter this in the actions panel stop(); (Nothing more is required) 2- then you have to make a button to advance the story. (To do this, either right click on the image you want to turn into a button and choose "convert to symbol". Then choose the button type, name it and press ok. OR you can just insert a new symbol by going to the insert menu at the top of Flash. And then you name/choose the button type, finally you can draw/create your own button. ) 3- Now to add the actionscript for the button.
Now this only stops/starts the stage, any movieclips you have have to be stopped then started individually.
Ok, to start music on something... 1- Import any music you want to use by going File->Import to library. 2- click on the frame you want the music to start on, look at bottom, there will be a spot for music/sound... click the drop down menu and choose your song to play.
3- Now, lets get the second song you want to play set up... - Make sure it's imported. - Then right click on it when it is in the library. - Choose "Linkage" - Select "Import this symbol" - Name it. (This name will be what you use to call it later...)
4- More actionscripting... Put this on the frame where you want the music to start.
- You can modify what is in blue to your preference, but you have to make sure they are exactly the same. - The red is what you named the song from the "Linkage" menu. - The 999 is the number of loops
5- Now to stop music after a few clicks and start a new song... 1- on the button put:
6- Then when you want to stop that song from playing put this code either on the frame you want it to stop, or a button.
For the Frame.
For a button:
And for your final question... No actionscript loops, those are for another case entirely. (Particularly for more dynamic events such as game development where most of what happens is created on the fly or as a result of user input.)
What you'll want are movieclips, and if you want characters not to move at all during them, then you can not animate them for that part or you can have them in their own movie clips and use:
The purple is what you assign the movieclip for a name when you click on it then look in the properties bar at the very left. It should have a dropdown menu with "Movieclip" selected, and under that it should say <Instance Name>. Change what's in the instance name box to what you want to call it then make sure you use that name when you want to stop that movie clip.
To start it again...
Hope that helps.
|
|