Forum Topic: Need help with actionscript

(186 views • 7 replies)

This topic is 1 page long.

<< < > >>
None

LilDwarf

Reply To Post Reply & Quote

Posted at: 2/13/06 08:58 AM

LilDwarf NEUTRAL LEVEL 29

Sign-Up: 01/02/06

Posts: 1,054

I modified the NG preloader to what I like but I also wanted to combine it with a percentage preloader but I don't know where/what script to put. I went to the Ultimate Tutorial but it doesn't work. Remember that it's the NG preloader modified so can someone help me?

BBS Signature

None

SuperBokey

Reply To Post Reply & Quote

Posted at: 2/13/06 09:16 AM

SuperBokey LIGHT LEVEL 08

Sign-Up: 10/20/02

Posts: 281

Make a dynamic text box, and set it's instance name to percent, now in frame one put this:

_root.onEnterFrame = function() {
var total = Math.round(_root.getBytesLoaded()/_root.ge
tBytesTotal());
var per = Math.round(total*100);
percent.txt = per;
if(per == 100) {
_root.gotoAndStop(/*Insert whatever*/);
delete this.onEnterFrame;
}
}

Now I dont have flash open or anything so Im not 100% sure that'll work :P but it should..


None

LilDwarf

Reply To Post Reply & Quote

Posted at: 2/13/06 10:34 AM

LilDwarf NEUTRAL LEVEL 29

Sign-Up: 01/02/06

Posts: 1,054

Awesome thanks ^_^ I'll see if it works and give feedback on it. Also another question is how do you know when to use actionscript in a movie? What I mean by this is if you use it on something besides buttons?

BBS Signature

None

caseyo

Reply To Post Reply & Quote

Posted at: 2/13/06 10:37 AM

caseyo DARK LEVEL 23

Sign-Up: 05/14/05

Posts: 4,935

At 2/13/06 10:34 AM, LilDwarf wrote: What I mean by this is if you use it on something besides buttons?

You could make some scripted effects (like rain).I don't really get what you're asking


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 2/13/06 10:38 AM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 9,716

There should be a percent variable there, anyway. Just makea text box with whatever it's called.

Where is AS used? Well, have you ever wondered how games are made?

haXe AliceML Box2dLite Learn AS
#ngprogramming at irc.freenode.net
OVER NINE THOUSAAAAND!!!


None

LilDwarf

Reply To Post Reply & Quote

Posted at: 2/13/06 01:09 PM

LilDwarf NEUTRAL LEVEL 29

Sign-Up: 01/02/06

Posts: 1,054

electricfreak answered my question. As for the other guy, I clearly said IN A MOVIE so there...

BBS Signature

None

SuperBokey

Reply To Post Reply & Quote

Posted at: 2/13/06 01:47 PM

SuperBokey LIGHT LEVEL 08

Sign-Up: 10/20/02

Posts: 281

At 2/13/06 09:16 AM, SuperBokey wrote: Make a dynamic text box, and set it's instance name to percent, now in frame one put this:

I now have a computer on school that has flash so here's the code:

stop();
_root.onEnterFrame = function() {
bl = _root.getBytesLoaded();
bt = _root.getBytesTotal();
per= Math.round((bl/bt)*100);
percent.text = per;
if(per >= 100)
nextScene();
}


None

LilDwarf

Reply To Post Reply & Quote

Posted at: 2/13/06 05:41 PM

LilDwarf NEUTRAL LEVEL 29

Sign-Up: 01/02/06

Posts: 1,054

It worked! Thanks alot to those who gave me the scripts d('-'d)

BBS Signature

All times are Eastern Standard Time (GMT -5) | Current Time: 12:49 PM

<< 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!