Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Custom preloader AS help

(125 views • 4 replies)

This topic is 1 page long.

<< < > >>
Shouting

IZSBHR

Reply To Post Reply & Quote

Posted at: 8/17/07 08:17 PM

IZSBHR LIGHT LEVEL 24

Sign-Up: 04/08/06

Posts: 602

OK, so in my first AS frame, I have:

_root.stop();
PercentLoaded = _root.getBytesLoaded()/_root.getBytesTot al()*100;
if (PercentLoaded != 100) {
_root.bar.gotoAndStop = PercentLoaded;
} else {
gotoAndPlay("loaded");
}
pert = percentLoaded
onMouseDown = function () {
if (percent>99) {
gotoAndPlay(100);
}
};

When I export the movie, the dynamic text with the "pert" variable says "UNL"

Also, the MC with the instance "bar" won't go to the frame which equals the percent loaded. Please help, thank you.


None

FreekC

Reply To Post Reply & Quote

Posted at: 8/17/07 08:24 PM

FreekC FAB LEVEL 07

Sign-Up: 08/11/07

Posts: 457

Are you using AS2 or AS3? If you're using NG's preloaders some don't work in AS3.

hello!!!


None

Denvish

Reply To Post Reply & Quote

Posted at: 8/17/07 08:24 PM

Denvish DARK LEVEL 42

Sign-Up: 04/25/03

Posts: 15,933

At 8/17/07 08:17 PM, IZSBHR wrote: When I export the movie, the dynamic text with the "pert" variable says "UNL"

If it was bigger, it would say 'undefined', because it doesn't know what percentLoaded is. The PercentLoaded variable you used earlier has a capital P. F8 is pretty sensitive about case

Also, the MC with the instance "bar" won't go to the frame which equals the percent loaded. Please help, thank you.

_root.bar.gotoAndStop(PercentLoaded);

- - Flash - Music - Report Abuse - -
Not around any more, see last news post.

BBS Signature

None

Joelasticot

Reply To Post Reply & Quote

Posted at: 8/17/07 08:43 PM

Joelasticot EVIL LEVEL 33

Sign-Up: 02/14/03

Posts: 818

At 8/17/07 08:17 PM, IZSBHR wrote: Also, the MC with the instance "bar" won't go to the frame which equals the percent loaded. Please help, thank you.

Denvish answered your questions, though I wanted to add something : you'll have to round the percentLoaded var for the bar to go to that frame:

_root.bar.gotoAndStop(int(PercentLoaded)
);

s=0;p=0;onEnterFrame=function(){
s+=(25-p)/20;p+=Math.ceil(s);o="";
for(i=0;i<p;i++){o+=" ";};trace(o+"joelasticot");}


None

IZSBHR

Reply To Post Reply & Quote

Posted at: 8/17/07 11:04 PM

IZSBHR LIGHT LEVEL 24

Sign-Up: 04/08/06

Posts: 602

Well, now nothing shows up for the text var "pert", and "bar" doesn't go to the frame equal to percentLoaded. And if it has already loaded, it SHOULD be playing the loaded animation (a simple alpha reduction tween).


All times are Eastern Daylight Time (GMT -4) | Current Time: 01:02 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!