6. Is there an easier way to relocate a sprite(GIF) without going through every single damn frame and changing the X and Y factors individually?
1- Create a blank layer in the MC, and make keyframes in each frame that you'd want to start and stop from (say, if you have a section of a movie clip that just shows a guy walking, go to the start of that segment, make a blank keyframe in the blank layer, and label the frame "walkStart". then another at the end of that segment, name it "walkEnd"). In the walkEnd frame, either set it up to loop (gotoAndPlay("walkStart");) or to stop (stop();) or something to keep it from rolling further. When you want to play that segment, use gotoAndPlay("walkStart"); in the movie clip actions, or CharName.gotoAndPlay("walkStart") in the main timeline.
2- To use part of an MP3, you can set an offset in the "start" command in actionscript, which uses the syntax
someSound.start(offset, loops);
this assumes you've exported the MP3 object in the linkage window (right click the symbol in the library), created a sound object "someSound" and attached a sound to it... like this...
someSound = new Sound();
someSound.attachSound("exportedMP3name");
So to skip the first 12 seconds, use
thisSong.start(12, 1);
music = "on"; //for the next example
Then, simply stop the sound in the frame you want it to end, or after a certain number of frames. To stop after a certain number of seconds, multiply seconds by the framerate.
thisSong.stop();
3- Continuing the previous example, to make an audio ON/OFF button, put this action in the button:
this.onRelease = function(){
if (music=="on"){
_root.thisSong.stop();
music="off";
} else {
_root.thisSong.start();
music="on";
}
}
4- I've just put this up on another post, but i'll do it here since it'd be nice to have all the scripts together...
Make a seperate Scene (from menu:insert... scene) for the preloader, and use the scene editor to place it before the main scene (from menu:windows... scene), and rename it Preloader. In the first frame, make a dynamic text field called "percentLoaded", and a movie clip called "loadbar1" that contains just a rectangle (it'll grow horizontally as the movie loads). Make sure that "loadbar1" is the instance name (properties), too. This action goes in the first frame of the main timeline:
_root.onEnterFrame = function() {
lBytes = _root.getBytesLoaded();
tBytes = _root.getBytesTotal();
allBytes = Math.floor(tBytes/1024);
percentLoaded = Math.floor((lBytes/tBytes)*100);
loadbar1._xscale = percentLoaded;
percent.text = percentLoaded+"% of "+allBytes+"K loaded.";
if (lBytes>=tBytes) {
gotoAndPlay("Scene 1", 1);
}
}
and this goes in the second frame:
gotoAndPlay(1);
6- To relocate sprites and such, make them movie clip symbols. Put them all in seperate layers. Keyframes can be motion tweened each other, just put it in one spot in one keyframe, and then another in another keyframe, right click on the first keyframe and "create motion tween".