Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Preload For _level1 Returns No GetBytesLoaded



The fallowing preload does not work and I don't know why

on frame 1 : button gotoplay(2)

on frame 2 : movieclip loadBar and a textfield called loadText and with the
fallowing AS :

loadMovieNum("1.JPG", 1);
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_level1._x = 400;
_level1._y = 150;
this.gotoAndstop(4);
}

///////////////////////////////////////
on frame 3 : gotoplay(3)
on frame 4 : statique text "Image loaded" with stop



problem : there is no bytes counting . loadText and loadBar do not work. the
script says that the condition if (bytes_loaded == bytes_total) on frame
enter is true so it immediately jumps to this.gotoAndstop(4); altough
the 700ko JPG is not loaded yet




I think that (_level1.getBytesLoaded() ) is no the command tu use to refer
to the image 1.JPEG loaded with loadMovieNum("1.JPG", 1);

Can someone help me?



FlashKit > Flash Help > Flash MX
Posted on: 03-10-2004, 07:49 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Preload For _level1 Returns No GetBytesLoaded
The fallowing preload does not work and I don't know why

on frame 1 : button gotoplay(2)

on frame 2 : movieclip loadBar and a textfield called loadText and with the
fallowing AS :

loadMovieNum("1.JPG", 1);
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_level1._x = 400;
_level1._y = 150;
this.gotoAndstop(4);
}

///////////////////////////////////////
on frame 3 : gotoplay(3)
on frame 4 : statique text "Image loaded" with stop



problem : there is no bytes counting . loadText and loadBar do not work. the
script says that the condition if (bytes_loaded == bytes_total) on frame
enter is true so it immediately jumps to this.gotoAndstop(4); altough
the 700ko JPG is not loaded yet




I think that (_level1.getBytesLoaded() ) is no the command tu use to refer
to the image 1.JPEG loaded with loadMovieNum("1.JPG", 1);

Can someone help me?

_level1 GetBytesLoaded/getBytesTotal.. Help
Does anybody know how can I make my preloader.. if I want to load music from _leverl1 ?

setProperty("_parent.load_bar", _xscale, ((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
//this script doesn't work for me

Thanks..

_level1 GetBytesLoaded/getBytesTotal.. Help
Does anybody know how can I make my preloader.. if I want to load music from _leverl1 ?

setProperty("_parent.load_bar", _xscale, ((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
//this script doesn't work for me

Thanks..

GetBytesLoaded Returns NaN
Hi,

Firstly apologies if this appears somewhere else - I've not been able to find a post with the same problem that I'm having.

I'm loading an external JPEG into a placeholder movieclip using the loadMovie method. This all works fine. I'm trying to provide feedback on how much has loaded using the moviclip_name.getBytesLoaded method. Here's the AS in the first frame:

percentLoaded = Math.floor((imagePlaceholder_mc.getBytesLoaded()/imagePlaceholder_mc.getBytesTotal())*100);

where:

percentLoaded = a variable to hold the percentage loaded
imagePlaceholder_mc = the movieclip I'm loading into

I have a dynamic textfield with the variable 'percentLoaded' that shows the percentage of the image loaded.

The problem I'm having is that, at the start, percentLoaded is being shown as 'NaN' - not a number. I'm presuming that this is because Flash hasn't worked out getBytesTotal yet and so the equation defining percentLoaded isn't a number. Am I right?

I have tried various scripts to determine whether percentLoaded is, or contains, NaN, if it does then display "calculating" etc. but to no avail. I've also tried setting percentLoaded to '0%' but I still get 'NaN% loaded' in my textfield until some of the image has actually started loading - most annoying!

Has anyone got any ideas?

Many thanks,

J

GetBytesLoaded Returns No Value
The fallowing preload does not work and I don't know why

on frame 1 : button gotoplay(2)

on frame 2 : movieclip loadBar and a textfield called loadText and with the fallowing AS :

loadMovieNum("1.JPG", 1);
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_level1._x = 400;
_level1._y = 150;
this.gotoAndstop(4);
}

///////////////////////////////////////
on frame 3 : gotoplay(3)
on frame 4 : statique text "Image loaded" with stop



problem : there is no bytes counting . loadText and loadBar do not work.

I think that (_level1.getBytesLoaded() ) is no the command tu use to refer to the image 1.JPEG loaded with loadMovieNum("1.JPG", 1);

GetBytesLoaded Returns No Value
The fallowing preload does not work and I don't know why

on frame 1 : button gotoplay(2)

on frame 2 : movieclip loadBar and a textfield called loadText and with the fallowing AS :

loadMovieNum("1.JPG", 1);
bytes_loaded = Math.round(_level1.getBytesLoaded());
bytes_total = Math.round(_level1.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_level1._x = 400;
_level1._y = 150;
this.gotoAndstop(4);
}

///////////////////////////////////////
on frame 3 : gotoplay(3)
on frame 4 : statique text "Image loaded" with stop



problem : there is no bytes counting . loadText and loadBar do not work.

I think that (_level1.getBytesLoaded() ) is no the command tu use to refer to the image 1.JPEG loaded with loadMovieNum("1.JPG", 1);

GetBytesLoaded Returns GetBytesTotal...
Okay what I am trying to do should be pretty simple... I've done it quite a few times before but I'm getting nowhere this time. Here's my setup.

I have a main swf that simply is used to load other swfs as links are clicked. Now two different swfs are always loaded at the same time. One is a banner that contains the menu which is never unloaded. And the other is the content swf that is changed as the links are clicked.

Here's the setup: It's not as optimized as it could be because I've been messing it up continuously trying to find the problem.


Code:
//SNIPPET: this is in the banner.
if (loading) {
loading = _root.checkLoading();
if (!loading) {
turnOn();
}
}

//SNIPPET:this is in the main swf
function checkLoading() {
var rbool:Boolean = true;
var loaded:Number = content.getBytesLoaded();
var total:Number = content.getBytesTotal();
lbar.lbar._xscale = loaded/total*100;
lbar.perc = loaded;
if (total == loaded && total > 1) {
rbool = false;

}
return rbool;
}

//SNIPPET: Last here's the setup for content which is also in the banner
if (_root.chg == "2d") {
loadMovie("2dViewer.swf", _root.content);
} else if (_root.chg == "3d") {
loadMovie("3dViewer.swf", _root.content);
} else if (_root.chg == "web") {
loadMovie("webViewer.swf", _root.content);
} else if (_root.chg == "contact") {
loadMovie("contact.swf", _root.content);
} else if (_root.chg == "about") {
loadMovie("about.swf", _root.content);
} else if (_root.chg == "home") {
loadMovie("main.swf", _root.content);
}
Okay now here's my problem. content.getBytesLoaded() returns the same as content.getBytesTotal(). And no it's not 0... it's a large amount of bytes that I am assuming is the actual Total. And it's not loaded yet either, one of the swfs is about 2.5 megs and says it is loaded but it's not even close...

Am I doing something stupid? Probably... if you can help me that would be awesome! In the mean time... I'll scratch my brain some more...

Newbie Question: GetBytesLoaded() Always Returns 12
I'm pretty much a newbie when it comes to Actionscript, but bear with me please. How is it that when I use _root.getBytestLoaded() it returns the correct loaded size of the whole swf file.
But when I use MovieClip.getBytesLoaded() (or getBytesTotal()) on a movieclip (for instance one that contains just an image) it always returns the numbers 12. That's strange.
For instance, I have a movieclip that has one image inside it.The movieclip's instance name is hats. And when I use hats.getBytesLoaded() it always returns 12.

Newbie Question: GetBytesLoaded() Always Returns 12
I'm pretty much a newbie when it comes to Actionscript, but bear with me please. How is it that when I use _root.getBytestLoaded() it returns the correct loaded size of the whole swf file.
But when I use MovieClip.getBytesLoaded() (or getBytesTotal()) on a movieclip (for instance one that contains just an image) it always returns the numbers 12. That's strange.
For instance, I have a movieclip that has one image inside it.The movieclip's instance name is hats. And when I use hats.getBytesLoaded() it always returns 12.

XML Object: GetBytesLoaded() And GetBytesTotal Returns Same
i am trying to build a preloader for loading XML documents, but getBytesLoaded() and getBytesTotal returns the same number as the document is loading.

has anyone heard of a problem with this?

Sound.getBytesLoaded() Returns Total Bytes
I am experiencing difficulties with the Sound.getBytesLoaded() function.

I'm using Sound.loadSound() to load MP3 files from a server, but when I call getBytesLoaded() on one, it seems to return the total bytes of a sound no matter what.

This is an abridged version of my preloader script:


Code:
sounds = _root.createEmptyMovieClip(sounds, 0);

sounds.one = new Sound();
sounds.two = new Sound();

sounds.one.loadSound("one.mp3", false);
sounds.two.loadSound("two.mp3", false);

progressBar.bytesTotal = sounds.one.getBytesTotal() + sounds.two.getBytesTotal();

// The following code is on a progress bar movie clip:
onClipEvent(enterFrame) {
bytesLoaded = sounds.one.getBytesLoaded() + sounds.two.getBytesLoaded();
_width = bytesLoaded / bytesTotal * 100;
if (bytesLoaded == bytesTotal) {
_root.gotoAndStop(4);
}
}
The empty movie clip for sounds is required for other functionality in my movie.

When I trace sounds.one.getBytesLoaded() inside the progress bar script, I always get the same bytes as the total size of the sound. This happens both locally and when loading from a server. I've also tried downsizing the functionality by removing the empty movie clip and not using a separate progress bar, but the result is the same.

Is there something I've missed in my script?


Flash version: MX
ActionScript version: 2.0
Operating System: Windows XP

Using A Preloader In _level0 To Preload _level1?
i have some exported symbols in my main movie which seem to load first causing my preloader not to load until those 75k symbols load... which is pointless.

my "solution" was to load my main.swf from a movie called preload.swf

preload.swf is a 3 frame movie.

frame 1:
loadMovieNum ("main.swf", 1);

frame 2:
stop();

frame 3: (blank keyframe)
stop();

on frame 2 is a blank movie clip with the following actons on it.

Code:
onClipEvent (load) {
total = int(_level1.getBytesTotal());
}

onClipEvent (enterFrame) {
loaded = int(_level1.getBytesLoaded());
percent = int(loaded/total*100);
_root.percentText = Percent +" % Loaded";
if (percent>=100) {
tellTarget (_level1) {
play ();
}
tellTarget (_root) {
gotoAndStop (3);
}
}
}

well suffice to say.. it isnt working at all....
it is loading the movie but nothing else.

can someone help?

_level1.lalalalalalalalala Is That Right Can I Do _level1.lala... ?
hi, im making a super dooper game. There is a movie clip on the root time line (called santa_turret). in this movie clip there is a second movie clip (pudding) in this movie clip i want to make the santaturret movie clip go to frame label "safe" but i forgot the actionscript for it *doh!*...

is it something like

on pressss....
_level1.santa_turret
gotoandplay "safe"


thanks alot for your time and help

James

GetBytesLoaded() Or Math.round(getBytesLoaded())
hi have a problem with my preloader it is in scene1 and when it loads it goes to scene2 it works fine on my computer but when i upload it to the web it doesn't work right the preloader bar shows up allready loaded can any body help me, here is the script i'am using:


ActionScript Code:
total_bytes=_root.getBytesTotal();
loaded_bytes=_root.getBytesLoaded();
remaining_bytes= total_bytes - loaded_bytes;
percent_done=int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded("main",11){
    gotoAndPlay("main",1);
}

GetBytesLoaded() -vs- Loaded = GetBytesLoaded()
is it better to just use
getBytesLoaded()
or to make
BLoaded = getBytesLoaded()
then use "BLoaded" in your script.

Sending Text With "RETURNS" Through A Button To A Dynamic Textfields With "RETURNS"
I have a dynamic textfield which I am loading text into through a button. Here is the button code

on (press) {
_root.about = "this is my text that is loaded into a dynamic text field named about";
}

I'm trying to make returns appear in the dynamic textfield


HERE is what I would like the text to look like in the dynamic textfield


this is my text
that is loaded into a
dynamic textfield named about




I tried using /n in the button script but nothing appeared.

n (press) {
_root.about = "this is my text /n
that is loaded into a /n
dynamic text field named about";
}

_level1 Won't Go To _x & _y On Startup...
As the title suggests, I can't seem to place the movie clip in _level1 on startup.

onClipEvent (load)
{
this.loadMovie("movie.swf",1);
_level1.instance._x=150;
}

this only seems to work if I place it in the enterFrame event. As though the movie isn't quite loaded by the time I set its properties...

I tried onClipEvent(load)... but it doesn't seem to work either...


I don't suppose there is a way to tell if the movie is loaded or an efficient way of placing an instance of another movie on startup?

thanks...

Move Over _level1
Seeing if there is something I am doing wrong here...
the parent movie loads up a movie and tries to move the instance over to position it!

onClipEvent(load)
{
this.loadMovie("movie.swf",1);
_level1.thing._x=100;
}

nothing happens... the object remains in the center of the screen. This is because (from what I can tell), the movie is not quite loaded when the action script tries to move it. So I tried:

onClipEvent(load)
{
this.loadMovie("movie.swf",1);
}
onClipEvent(data)
{
_level1.thing._x=100;
}


No Joy! then I tried:


onClipEvent(load)
{
this.loadMovie("movie.swf",1);
}
onClipEvent(enterFrame)
{
_level1.thing._x=100;
}

This obviously worked because it is repositionned EVERY time we Enter the Frame. (I am trying to avoid this since I have many things to place...). So I try this:

onClipEvent(load)
{
this.loadMovie("movie.swf",1);
objectPlaced=false;
}
onClipEvent(enterFrame)
{
if{!objectPlaced)
{
_level1.thing._x=100;
}
}


Still no luck... anytime I try to position it in a "one-time" manner, it doesn't see it...

I've also tried SET, setProperty to change _x...


I need to find a way to wait till the movie is well loaded;
- the _framesLoaded method isn't usefull since there is only one frame in the movie;
- loops (FOR & WHILE) seem to stop every thing else that is happening until the loop is complete.

In the end... all I want is:
-As the parent movie is loaded, it loads item A and places it HERE, loads item B, places it HERE... and so on... all the ITEMS are seperate movies since they are called for different reasons...

Hopefully someone has come across this one before...

I also noticed there are many posts regarding the same issue...

Thank you for your time...

Attatchsound In _level1
let me explain how my movies are setup

_level0 is the website interface etc

_level1 is the bground sound, user preferance automatic volume control and mute.

to give the best control on volume and to fade the music out on mute i have attatched the sound using Action Script.

Works great in _level0 but like i mentioned above i want to have it in _level1 so it can load in its own time without the user having to wait.

the libaryID is mymusic if i put the music clip in the _level1 libary with the correct ID it dont work however if i put the music in the _level0 libary with the correct libaryID it does work even though its being controled from a higher level?

How can i get the attatchSound("mymusic"); to locate the sound clip from _level1's libary and not _level0??

Thanks in advance.

Danny

AttachSound In _level1 ? How?
I want my text on the current object to be spoken by a voice. but to save those with slow connections the loading bar, i decided to put those sounds into external swf movies and load them after the screen finished loading, so that people with fast modems DO get those files and people with slow just see the text (unless they wait for the sound to finish loading)

so: i have a bunch of external movies and got those sounds identified with the linkage field, so that i can use the attachSound

now i have a problem of targeting. how do i have to write that attachSound order? because these sounds arent in the _root library, how do i acces the library of the loaded Movie? (f.e. in _level1) ?

where do i have to initialize the new Sound()?

_root._level1
if i use the code "_root._level1" in a loaded swf, will this reference the main timeline of the said loaded swf after it is loaded in the main movie?
thank you.

>>> _level1.gotoAndPlay(10); <<<
Hi!
i load a movie on level 1...

from level0 i've to bring the movie on level 1 on the frame 20 in the movie clip "mc" thet it's on the root....

how could i do???

thanX

CreateTextField And _level1
Does anyone know why createTextField in _level1 doesn't seem to work?
I have 2 movies. 1 is the main timeline and the other movie is loaded in level1. If I play the movie with the createTextField by itself it's fine, but when I load the movie with createTextField in level1 the createTextField doesn't work.

OnSoundComplete From _level1
Hi All,
I have a main movie (_root) which loads an external swf file on level1.
The external swf file plays an external mp3 via a soundObject.
When the track ends I want my buttons to reset in the main movie.
I am trying to achieve this with the onSoundComplete command:

myMusic.onSoundComplete = function() {
_root.container.au_MC2.bplay1.gotoAndStop(5);
_root.container.au_MC2.bplay1.enabled = true;
_root.container.au_MC2.bplay1.useHandCursor = true;
_root.container.au_MC2.stop1._visible = false;

I've put this code in the external swf (which is loaded in level1)

Bit it isn't working!?
_level1 or _parent instead of _root isn't working either.

Can anyone help me out..please?

Attaching MC To _level1
Hi Guys,

I want to attach my movie clip to _level1
my code is as follows:

var a:Number = Stage.width/2;
var b:Number = Stage.height/2;

function attach (){
this.attachMovie("hitarea","hitarea_mc",10,{_x:a,_ y:b});

}

hit_mc.onRelease = function(){
attach();
}

I thought _level1.attachMovie(etc,etc); would work .. but it doesnt. Can anyone point me in the right way? Thanks!!

_level1.newsupdate
I'm using the follwing script to load an external .txt file into a scrolling box:

loadVariablesNum("http://www.robertdipietro.com/text/news_update.txt","");

For some reason the box loads "_level1.newsupdate" instead of the actual text on the document.

The variable is named "newsupdate".

Strange this is, it worked for a minute then *poof*, it stopped working.

Any help would be appreciated.

-dn

Playing Mc In _level1
how do i play from a labeled frame in a labeled mc in _level1? im trying to play in _level1 in the 'content' mc from the 'transitionout' frame.

right now i have

on (release) {
_level1.section="weddings";
_level1.content.gotoandplay("transitionout")
}

any help would be great!

thanks!
austin

Controlling _level1
Obviously missing the point here, but am trying to load and control a movie to _level1 with the code below. The movie is loading fine, but the gotoAndPlay part is not working. Would appreciate help with this one:

on (release) {
loadMovieNum("navigation.swf", 1);
_level1.gotoAndStop("company");
}

Thanks.

Dabush.

How Do I Attach A MC From _level1 To _level0? (please Help)
Hello,
i am stuck ...
How do i attach a MC(exported) i got in _level1
to _level0.. is there any way to do so???

please help...

TextFields & _level0 Vs. _level1
Hi,

I have a dynamic text field in my _level0 .swf. I load another .swf onto _level1 and I want it to contain the present value of the same variable on _level0. Is this possible? If so, how?

Here is my variable and paths:

Level #0:
Variable _level0.orderform.grandtotal = 59.85

Level #1:
Variable _level1.orderform.grandtotal = 0

So, when the _level1 .swf loads, I want grandtotal value in the text field to be 59.95.

Much Thanks!

Rick

Movie Won't Work On _Level1?
Hi,

I'm working on a shopping cart and need variables on _level0 to be updatable on _Level1. My shopping cart code works on _Level0, but when I load it on _Level1, it doesn't.

Basically, I need to be able to have a series of variables stored +/or presented dynamically on three levels of my movie. Here's the code for one drag and drop cart element:

on (press) {
startDrag ("/orn1");
tellTarget ("/orn1fader") {
nextFrame ();
}
}
on (release, releaseOutside) {
stopDrag ();
if (getProperty("/orn1", _droptarget) eq "/cart") {
/orderform:quantity1 = Number(/orderform:quantity1)+1;
/orderform:total1 = /orderform:quantity1*15;
setProperty ("/orn1", _visible, "0");
trace ("/orn1 droptarget eq /cart!");
tellTarget ("/orn1fader") {
play ();
}
} else {
setProperty ("/orn1", _x, /rn1_x);
setProperty ("/orn1", _y, /rn1_y);
tellTarget ("/orn1fader") {
gotoAndStop (1);
}
}
}


Please help!

Thx,

Rick

How To Assign Vars To _level1 ?
Hi all

how to assign variables to _level1 for example

I have to send my vars to perl but

the recipient received all variables in my swf

how to debug this help please

Help: Load MovieNum And _level1._x = ? Help...
hi! thanx for stopping by! i have one question... i am making a homepage and it is divided into subdivision (i.e. profile, picture, and etc). i made all of into separate swf files (i.e. profile.swf, picture.swf, and etc) and i decided to to attach them all together onto one main template. i used the following code to attach all the swf files (i.e. picture.swf) to the main template on DIFFERENT LEVELS...
loadMovieNum("xxxx.swf",x[level])

my question is... how do i adjust the _x and _y values of the swf files attached on different levels? at this point all of swf files overlap each other... i tried the code _level._x to move the swf file but obviously that doesnt work... i dont know how to give the swf files an instance name to target them. any replies are greatly appreciated. thanx

Set Coordinates Of Loaded ' _level1 ' MC ?
How might I set the coordinates of a movie that I'm loading into level1 of my root? I've tried everything.

Please help.

Updating _root From _level1?
I am going insane. You can update the level0 from an externally loaded level1 correct? I have a boolean variable called fontsLoaded on the root level which equals false, when the swf is loaded ontop of level0 (root) the boolean value should be updated to true via the code on a MC:
onClipEvent(enterFrame) { _root.fontsLoaded = true; }

Ive tried everything including buttons to get this external swf to update vars on the root level but nothing works. Please someone tell me what I am doing wrong, im positive ive got something like this to work before.
Thanks in advance,
-Acid

Playing _root.MC From _level1
I cant get a movie clip on _level0 to play from _level1. Is there some kind of trick to doing this I dont know about? I had to make a variable global just so I could update it in the same way. I dont understand why _root.MC.play(); (calling from a button inside a movie clip on _level1) would not work. Please advise.
TIA
-Acid

Play _level1 (probably Very Simple(
how do i play _level1?

[F8] _level1.height Not Working
I am having a wierd problem. I need to resize a flash window via javascript. I know how to do that. I load a movieclip into _level1 using:

loadMovie("movieToLoad.Text, "_level1");

and later, I send the value _level1.height to a javascript function. It doesn't work. I redo the program to 'trace' the value of _level1.height. It traces 'undefined' even though an swf is playing just fine in _level1. I put 'trace(_level0); and it puts 225. _level1 is undefined. Super wierd. I even get variables from the swf loaded in _level1 with no problemo, and it works fine until I try to get the .height of _level1 which returns undefined. Can anyone help please? Here is the code with the problem:


Code:
loadMovie_btn.onRelease = function() {
loadMovie(targetMovie_txt.text, '_level1');
reloadfunc()
}

function getAllVarsInMovieClip(targetMovieClip:MovieClip):Void {
var output:String;

for(var v in _level1){
output += "Variable: " + v + "
Value: " + _level1[v] + "
-------------------
";

trace(output);
}
}

function resizefunc() {

h = _level1._height;
getURL("javascript:setFlashHeight('flashid',"+h+");");
}

Use _level0 Function In _level1
Hello.
I've got a question:
I have a moveiclip loaded, and Frame 1 contains a function that looks like this:
function returnValue () {
return _root.main.intRank;
}
And with VB, I've loaded another clip on level1.
When I use _level0.main.intRank; from the level1 clip it works fine. But the question is: how do I execute this function from the level1 clip?
I've tried _level0.returnValue() but it returned as undefined...

Any solution?

_level1.gotoAndStop Problem
I'm using, unsuccessfully, these two lines of code to load an external .swf file called bag.swf and have it start on the frame "trunk":


on (release) {
    loadMovieNum("/site/flash/bag.swf", 5);
    _level5.gotoAndStop("trunk");
}

 
Any suggestions are appreciated.


Preloader For _level1 Not Working
Hi, not sure what I'm doing wrong here. it works fine when I test movie from within Flash, but as soon as I upload it, it doesn't work. Here is my code:

Frame 2
loadMovieNum("milkhoney_main.swf", 1);

Frame 3
bytes1 = _level1.getBytesLoaded();
total1 = _level1.getBytesTotal();
if (bytes1 == total1) {
gotoAndPlay("go");
}

Frame 5
gotoAndPlay(_currentframe-2);

... and here is the code for my preloader movie clip which is 100 frames long. It's instance name is preloadies
onClipEvent(enterFrame){
_root.preloadies.gotoAndStop( int(_level1.getBytesLoaded()*100/_level1.getBytesTotal()) )
}

I can't figure this out. Again, it works fine when I test movie from within flash, but not when I upload it to FTP.

Thanks

_level1 And Preloader - A PC/Mac Thing?
when a user clicks one of the buttons from the main menu- the preloader(external .swf) gets loaded into _level1 and another .swf (content) into a mc. It works fine on the PC, but not on the Mac (which I don't have but the client/friend does). The preloader flashes in, out, in (within the first second) and that bothers her + it looks bad. Any one knows what is going on?

At the moment, I've put the preloader into the movie's library and it gets attached, which works fine. But I want to keep it separate from the main movie. Thanks.

How Do You Code _level1. In Flash 4 Scripting
Hi,

Im workking with Flash 5 but exporting the movie as version 4. I have the following code: _level1.gotoAndPLay(3) but it gives me an error on export saying the code wont work in version 4(even though the action script reference guide book says it should :-(

Anyone know how I could rewrite the code to work with v4 players?

Cheers

P

How To Attach A Movie From _level1 To _level0? (please Help)
Hello,
i am stuck ...
How do i attach a MC(exported) i got in _level1
to _level0.. is there any way to do so???

please help...

_level1 Talk Back To _level0
I have a movie called backgroundAnim.swf that loads into a main movie on level1 now I have a prloader built on the main movie that loads the main movie and I also has in that preloader scene, a loadMovieNum("backgroundAnim.swf", 1); now I don't want the backgroundAnim.swf to play till the main movie has loaded so I thought i would set a variable in the
main movie timeline which would trigger an if statement in the level 1 movie which is called backgroundAnim.swf .to play when this flag is
triggered. But I cant figure the path to talk back to the main movie .I have at the moment in the if statement on the backgroundAnim.swf

Code:
if (_level0.backgroundAnimation==true) {
gotoAndPlay(2)
} else {
stop();
}

then in the main timeline of the main movie after the preloader has happened I have

Code:
backgroundAnimation=true;

which should trigger the backgroundAnim to play then .
Maybe there is an easier way than this .

Controling A _level0 Movie From _level1
Why this wont work I really dont know...Please help.

setup: I have a clip called movie.swf that loads another clip called buttons.swf on _level1.

aim: To control (gotoAndPlay() etc..) _level0 (movie,swf) from the _level1 (buttons.swf) clip....

tried: from the _level1 clip I have a button which I put this a-script on:

_level0.gotoAndPlay("op1");

but doesnt work.

This seems to work ok when controlling movies loaded on higher levels but no-go when controlling _level0.

Any ideas....

Thanks.

_level1/ If Function/var Problem You Decide...
I am making a flash document for school and i was wondering how i could get this to work. the first 2 work like a charm but when i start iffing it doesnt work.. Could be i am forgetting something with the vars but i just cant figure out what..

Could someone telle me how to exactly use the vars.. i have on in frame 1 on the "index.swf" a var called vartaal = 0. And on that frame you can choose which "frameset" you are going to get. on each of those frames there are different vartaal = 1,2,3,4,5 codes. but i think thats where the problem lies.. one of those codes is wrong but i cant figure out which one. can someone help me?


code: on (rollOver) {
gotoAndPlay("over");
_level1.leds.gotoAndPlay("bbin");
_level1.foto.gotoAndPlay("bbin");
if (_root.vartaal == 1) {
_level1.text.gotoAndPlay("nlbbin");
} else if (_root.vartaal == 2) {
_level1.text.gotoAndPlay("enbbin");
} else if (vartaal == 3) {
_level1.text.gotoAndPlay("fabbin");
} else if (_root.vartaal == 4) {
_level1.text.gotoAndPlay("dubbin");
} else if (_root.vartaal == 5) {
_level1.text.gotoAndPlay("espbbin");
}
}

Passing Variable From _level0 To _level1
I have a button inside an MC on _level0 with this code:
PHP Code:



on (release) {
    _global.mb = 100;
}




Then on _level1 I have this code in a frame:
PHP Code:



trace("mb = "+mb);




But the trace always returns "undefined". Am I not understanding global variables? or am I writing it wrong?

AttachSound() In _level1... Keypress Isn't Working
hi there,

for some reason, when loading the organ, the 'keypress' doesnt play the sound, but the 'press' will... this is very weird to me. It works when previewingit. Just not live when its loaded into _level1. heres the code

on (press, keyPress "y") {
stopAllSounds();
Y = new Sound(this);
Y.attachSound("yaps");
Y.start();
}

Any help here would be very much appreciated thankyou.

Tim

Copyright © 2005-08 www.BigResource.com, All rights reserved