PDA

View Full Version : [Actionscript] Preloader



Simpsoni28
March 6th, 2006, 04:29 PM
hi guys, i'm back and i need help.

i've made a basic

preloader, i've got it all so it loads correctly, but i've seen preloaders

that when its loaded a "play" button appears, and when you click the "play"

icon, the film starts.

I've set my "play" button as a "button"

symbol, but what code do i enter to play on click, if you see what i mean.

Simpsoni28
March 7th, 2006, 07:05 AM
c'mon guys

i've done a google search, but i can't seem to find what it is i want to

do...

Oscar
March 7th, 2006, 07:56 AM
Make sure you have a stop

script where you want it to stop then attatch this code to the

button;



on(release){


gotoAndPlay("Scene 1", 15);
}


Change

Scene 1 to what your scene is called and 15 to what frame is

after your stop script. Get it?

Jaded
March 7th, 2006, 11:40 AM
Or if you want

just get the NewGrounds ppreloader and look at the script from that.

Netrosis
March 7th, 2006, 04:47 PM
newgrounds script works differently, the code is

inside a movieclip for a button and in the frames.

Im just making it

sound difficult, lawl.|

Oscar's should work

fine.

Although

on(release) {


nextFrame();
}

should work too.

Oscar
March 7th, 2006, 08:17 PM
Or

just a simple "Play" :roll:

JJ
March 7th, 2006, 08:35 PM
thats

what i thought....
keeping it simple.....
classic.....

`seCks
March 7th, 2006, 08:58 PM
/download ne gud

preloader den just change da grpahics 2 make it loook liek u made it :D

JJ
March 7th, 2006, 09:07 PM
/download ne gud

preloader den just change da grpahics 2 make it loook liek u made it



english:
ne- ANY
gud- GOOD
den-THEN
grpahics-

GRAPHICS
da- (of course) THE
loook- LOOK
liek- LIKE

Simpsoni28
March 8th, 2006, 05:01 PM
thank you for the help, but when i type the code

in i get this.

**Error** Scene=Preloader, layer=Preloader,

frame=27:Line 1: Statement must appear within on handler


stop();

Total ActionScript Errors: 1 Reported Errors:

1

the code oscar gave me, i put in a separate keyframe, i put stop on

its own just before it. when i get to the play bit i move the mouse over the

play button, and i get the hand, but i click it and nothing happens... (and

yes, i've already changed the scene and frame bit to what i need, and there

is already a movie after that.)

Ok, heres what i got so far, there is

another piece of text after the play icon.
(when i play it i have to

right-click then click forwards, then click the play icon on the

document)

http://media.putfile.com/Preloader57

Simpsoni28
March 8th, 2006, 06:37 PM
also, is there a program that i can get to

create good text effects for me?

i've been looking but the ones i've

found either, won't let me export the file, or make me pay before i use...

Oscar
March 8th, 2006, 08:31 PM
You have to attatch

the code to the actual button - not to an empty frame.

Make sure you

copy all of the code. I just tested it and it works for me.

JJ
March 8th, 2006, 10:00 PM
it might depend on the version of flash, i know oscar uses flash

8....pro....pretty sure...


note: ur preloader, the play button

should be a wider area to be clicked apon....do this by making box, then

convert to symbol, as a button, then alpha to 0%....put it behind the text

that says PLAY, and put the same action script u put in the "play"

button....

or make a box and the text in one button symbol....go into

the symbol, click the box and make it a color with a alpha of

0%....

there is another way to do it, but i like it simple

Simpsoni28
March 9th, 2006, 07:06 AM
yeh i'm using flash 8 pro, i copied all the code,

into the button (the box behind the play text) the stop problems gone. but it

still dosn't load the next scene when i click play.

when i double

click on the box, it gives me a timeline which says, up, over, down, hit. do

i have to do something to that?

Netrosis
March 9th, 2006, 12:15 PM
Ok, have a blank keyframe and put this actionscript

in the frame.


stop();

Then, place a

button on the same frame. It doesn't have to be the same layer, but the same

frame number. Deselect everything, then click on just the

button.

Open up the actionscript window and put this code

in.

on (release) {


gotoAndPlay("scene",1);
}

with

gotoAndPlay("",#); the first thing you type is the scene, this must be

inside the quotation marks and I think its case sensative. The second part is

the frame number, it can also be a quoted frame name if you label your

frames.

If it is in the same scene, you don't need to supply a scene

and just put the frame number or label in there.

Simpsoni28
March 9th, 2006, 03:14 PM
yes! it works

cheers Netrosis :D

also, how do you stop the preloader looping when

the movie has ended?

is it just the stop(); command, then if you want

to replay it then just make a button that says replay, and assign the

gotoAndplay ("Scene 1",1) command yes?

Fu
March 9th, 2006, 04:33 PM
well, no, because if the frame or the movie clip that the

preloader is in have a stop command in itself, then you have to make the

command go to the second frame where the actual animation begins.
hope

this helped

Simpsoni28
March 9th, 2006, 05:09 PM
weah! at last! i figured it out (after 3 days

:shock: )

can someone test this just to make sure it works. please try

out all the menus just for the sake of bug testing. thank

you.

http://media.putfile.com/Preloader---new

Fu
March 9th, 2006, 05:54 PM
okay it works now make good animations

Netrosis
March 10th, 2006, 02:13 AM
yep, it works fine for

me. If you're making menus, just remember to put the stop(); code on the

frame you want it to stop on, and then put the button and the rest should be

common sense.

Simpsoni28
March 10th, 2006, 04:05 PM
thank you Netrosis,

Oscar and JJ for your help. its been really appreciated, now to make a

movie!