Forum Topic: Action script help...

(217 views • 4 replies)

This topic is 1 page long.

<< < > >>
None

Novocaine88

Reply To Post Reply & Quote

Posted at: 6/12/06 12:16 PM

Novocaine88 EVIL LEVEL 12

Sign-Up: 07/30/01

Posts: 86

i just need a small bit of action script code, im new to flash and as yet dont know the lingo. all i need is some code to prevent my movie from looping once its finished. and also code for a button to replay it. would that be something like this;

on release
gotoAndStop("Index", 1);
}

'index' being the name of the scene the movie is in.

would that be placed in the release frame of the button?

i also need to know how to get a button to play the movie after its loaded, when ive tried the button is there and the movie dosent play but when i click the button nothing happens.
help would be much appreciated, thanks

BBS Signature

None

mike

Reply To Post Reply & Quote

Posted at: 6/12/06 12:21 PM

mike NEUTRAL LEVEL 19

Sign-Up: 02/24/00

Posts: 319

To make a movie not loop, on the last frame of it, put:
stop();

You're on the right track with the rewind button -- To make a rewind button, put the button on the scene, click it once, and put this in actions:
on(release)
{
gotoAndPlay("scene",1);
}

NG has a preloader you can use floating around on the Flash page

!


None

Novocaine88

Reply To Post Reply & Quote

Posted at: 6/12/06 12:30 PM

Novocaine88 EVIL LEVEL 12

Sign-Up: 07/30/01

Posts: 86

cheers for the help.

p.s. i know theres a newgrounds preloader but i made my own one. all works cept the button so far

BBS Signature

None

CorkySurprise

Reply To Post Reply & Quote

Posted at: 6/12/06 01:48 PM

CorkySurprise EVIL LEVEL 09

Sign-Up: 02/25/05

Posts: 73

on (release) {
_root.gotoAndPlay("scene",1);
}

That's better


None

Dark-Prism

Reply To Post Reply & Quote

Posted at: 6/12/06 01:54 PM

Dark-Prism EVIL LEVEL 10

Sign-Up: 03/14/03

Posts: 56

At 6/12/06 12:30 PM, Novocaine88 wrote: all works cept the button so far

What I do, I don't know about other people, is have 3 frames. The first one has the code-

Math.floor((getBytesLoaded()/getBytesTotal
())*100)

along with the other things to make the bar move. The second frame has the code-

if (getBytesLoaded()<getBytesTotal){
gotoAndPlay(1);
} else {
gotoAndPlay(3);
}

I also have it make the bar and everything else equal 100% in case it didn't reach that point yet. On the third frame I have stop(); and my button.


All times are Eastern Standard Time (GMT -5) | Current Time: 08:01 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!