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




Stopping Movie From Playing Till Certain Percent Has Loaded



Hi im using the netStream object to play an external FLV.

my question is if someone is on a low bandwidth then the movie will keep jamming when the playhead catches upto the amount downloaded...

part of the code is


Code:
netStream_ns.onStatus = function(info:Object):Void{

if(info.code=="NetStream.Play.Start"){

//movie has started playing so lets start playhead
playbackProgress();
}
if(info.code=="NetStream.Play.Stop"){
currVideoNum++;
if(currVideoNum>totalNumVideos){currVideoNum=1;};
playVideos(currVideoNum);

}
}

so flash starts playing movie autmoatically when a certain amount has downloaded..

the question is how do I decide MYSELF when to start the playing of the movie for e.g i may want it to start playing only after at least 30% has of the movie has been downloaded..

thanks in advance



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-08-2005, 01:22 PM


View Complete Forum Thread with Replies

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

Playing Movie After Specific Percent Loaded
Hello,

Can someone suggest a way to load a movieclip so that when 50% is loaded, the movie will begin to play?

Thank you!

Stopping Timeline Till External Mp3 Starts Playing
Hi:

Can we stop the timeline till an external mp3 loads and starts playing.. If so can someone help me..

In my 1st frame of the movie there is code to load the external mp3.. but the timeline starts automatically.. can we stop that..

Thanks

[CS3] Button Over With Movie Clip Playing Till The End, With Mouse Not On The Hit?
[CS3] Actionscript2 - How can I create a Button Over with a movie clip symbol in it, playing till the end, even when the mouse is not anymore on the hit?!

Basically, I need a button like this:

UP: invisible
Over: movie clip symbol of 20 frames
Down same movie clip symbol of 20 frames
Hit: a square that covers the movie clip symbol

I don't want the movie clip to suddenly stop playing for example at frame 12, when the user is not anymore on the hit shape... I d like the movie clip to not suddenly stop but I d like it to end in its own time at frame 20. Do you know the script to do so? Where do I place the script? on the button? on the movieclip symbol?

Thanks for your help, if you can help!!!

How To Make One Movie Wait Till Another Is Loaded?
Hi,

I'm working on a flash site that has a different movie for each page. To add a transitioning effect, I'm trying to insert a fade clip into the navigation process so that when a link is clicked, the old content fades out and then new page fades in.

Rather than go in and edit 30 pages in the site, I'm making a single movie on the top layer that is simply a solid box the color of the background, and it fades in, making the old content appear to actually fade out.

So, when someone clicks a button, it calls a function that 1) runs the fader, 2) turns all the old content off, 3) turns the fader off, and 4) plays the appropriate movie.

my script w/out the fader is someting like this:

function clear_main () {
// play the fadeout here
setProperty ("/content_fade", _visible, true);
tellTarget ("/content_fade") {
gotoAndPlay (2);
}
// this is the part that's not working right ..
// i need to make it wait from right here within the function maybe with a while loop???
ifFrameLoaded("/content_fade", "done") {
//setProperty ("/content_fade", _visible, false);
}

// clear everything in the main content area
setProperty ("content_home", _visible, false);
setProperty ("content_about", _visible, false);
..... etc ......

} .. then when the function is done, the script on the button goes ahead and plays the next movie.

What I need a little help with here, is, how do I script it so that it will wait until the "fadeout" movie is finished, and then make the layer set to invisible, and then go and play the next movie?

I think it's something with the ifFramesLoaded function, but I'm having a tough time with it and would like to see how those of you who are more familiar with it would go about doing this.

Thanks a lot for any advice!

z33man
[Edited by z33man on 08-26-2002 at 05:39 AM]

Preloader Not Showing Till Movie Fully Loaded
I've made a preloader for my movie (1.5 mbs), but when it is loading online, the screen is blank until the movie is fully loaded and then the preloader blinks by briefy and then goes to the main movie. Why is this happening?

Nick

[F8] How To Make Movie Wait Till The External Swf Is Loaded?
My question is in 2 parts:

1- I want to preload both -my main movie and an external movie, before it acually plays the main movie, how do i do that?

2- does my external swf get cashed this way? so if i used another main movie would it detect that i already cashed the external file before?

my preloader code is:
Code:
stop();
var total:Number;
var loaded:Number;
var percentage:Number;
this.onEnterFrame = function():Void {
loaded = this.getBytesLoaded();
total = this.getBytesTotal();

percentage = (!isNaN(loaded/total)) ? Math.ceil((loaded * 100)/total) : 0 ;
if(percentage > 100) percentage = 100;
this.loaderbar_mc._xscale = percentage;
this.loadertext_txt.text = ""+percentage+"%";
if((loaded == total) && (total>100)){

gotoAndPlay("init");
delete this.onEnterFrame;
}
};
thank you guys

Sync-ing MC To Percent Movie Loaded
This is a preloader question. I thought I had the preloader beat, but this ine perplexes me. I want to have an MC draw at the same rate the movie is loading. I can only think of one way and that one way would take all day. Any thoughts? Please see the attached sample to get a little idea as to the extent of the MC.

Thanks in advance.

T

Want To Play Movie At 50 Percent Loaded
I have a preloader that plays the movie once the movie is completely loaded.
This is not necessary, 50 % or even less would be fine : Here is my code much appreciatin in advance for any one who can help ....


_root.stop();
PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
if(PercentLoaded != 100){
setProperty(loading_bar, _xscale, PercentLoaded);
} else {
gotoAndStop(3);
}

Help With Stopping A Movie, And Then Playing It Again.
I'm trying to make a flash movie, and I have text popping up. And I want to have a button after the text so when you click it, the text goes away and the movie starts up again.

Like this, text pops up, people read, and when they are done, they click the button to continue the movie. But I have no idea how to do this simple task. Please help!

Stopping And Playing Movie With Keys
I've been trying to place a script in a movie that allows the user to stop and start the movie at will (it's a presentation). I don't want specific stopping points (specific frames). I also want to use the space bar.

To try and get started, I created a blank script movie clip and then brought it onto the maintime line. I then attached this script in the objects action window onto this script movie clip.

onClipEvent (enterFrame) {
if (Key.isDown(Key.SPACE)) {
stop;
}
}

Playing And Stopping Movie Clips.
Ok, hopefully a simple one, i've got two movie clips - both 20 frames long. I want one to play, then stop and then the next one to play. I want to do this by placing them in frames 1 & 2 in scene 1.

What script do I have to add to make them do this? I've tried putting stops and goto and play's on them, but to no avail.......... anyone?

I'm using Flash MX by the way.

Thanks

Olli

Playing And Stopping Movie In Server
Hi, I had a server machine running some Flash files.

One of the files (PlayMovie.swf) actually plays another swf file from the local computer. Meaning I need to have this file (test.swf) in my local drive and what the PlayMovie.swf does is to loadMovie("C:\Video\test.swf")

On PlayMovie.swf, I have 2 buttons to control the playback. stopBtn and playBtn.

As I want to control the size of the video size in PlayMovie.swf, I used createEmptyMovieClip to create an empty movieclip and load the swf into the movieclip.

Heres the codes:

_root.createEmptyMovieClip("videoHolder1", 10);
_root.videoHolder1.loadMovie("C:\Video\test.swf" );
_root.videoHolder1._x = 22.7;
_root.videoHolder1._y = 65;
_root.onEnterFrame = function()
{
if(_root.videoHolder1._width > 1)
{
_root.videoHolder1._width = 300;
_root.videoHolder1._height = 200;
delete _root.onEnterFrame;
}

}
stopBtn.onRelease = function(){
_root.videoHolder1.stop();
}

playBtn.onRelease = function(){
_root.videoHolder1.play();
}

What happens is when I run the swf (double click on the file) on the server, the play and stop does work.

But when I open up my browser and surf to my server IP address (say http://myserver//PlayMovie.swf), the play and stop doesn't work! It has no effect on the test.swf playing.

Why is this so?

Stopping A Movie When Playing In Reverse
Hi All,
I have a movie with a number of stop points. When you click the next button it plays an animation foward, then when you hit the back button it plays backward with the following script on the button:

on (release) {
reverse(_root);
}

this following code is in the first frame of the timeline:

function reverse(timeline) {
timeline.onEnterFrame = function() {
if (timeline._currentframe>1) {
timeline.prevFrame();
} else {
delete timeline.onEnterFrame;
}
};
}

It plays backwards ok but I am wanting it to stop where the stop actions are on the timeline.
Any ideas? would be much appreciated.

Thanks

New To ActionScript...stopping/playing Movie
I'm new to ActionScript (within days). I've been thrown this project which has a few simple Flash elements.

One is five photos that need to fade at different times to another. I've made these movie clips that loop. However, I'd like them to start playing at different times so there is always one photo changing.

Therefore, the first frame should stop all but one movie clip from playing. 10 frames later the clip called Photo2 should start, 10 frames later Photo3, etc.

I've tried:

Photo2.stop(); on the first frame (applying the same to the other four clips). But I get an error that says "Access to undefined property [movie clip name]". I've used Photo2.play(); as the frame event when I want to start the clip playing. The above error is given to me on those events as well.

What am I doing wrong? This seems pretty simple but it's absolutely giving me fits.

Playing And Stopping Movie In Server
Hi, I had a server machine running some Flash files.

One of the files (PlayMovie.swf) actually plays another swf file from the local computer. Meaning I need to have this file (test.swf) in my local drive and what the PlayMovie.swf does is to loadMovie("C:\Video\test.swf")

On PlayMovie.swf, I have 2 buttons to control the playback. stopBtn and playBtn.

As I want to control the size of the video size in PlayMovie.swf, I used createEmptyMovieClip to create an empty movieclip and load the swf into the movieclip.

Heres the codes:

_root.createEmptyMovieClip("videoHolder1", 10);
_root.videoHolder1.loadMovie("C:\Video\test.swf" );
_root.videoHolder1._x = 22.7;
_root.videoHolder1._y = 65;
_root.onEnterFrame = function()
{
if(_root.videoHolder1._width > 1)
{
_root.videoHolder1._width = 300;
_root.videoHolder1._height = 200;
delete _root.onEnterFrame;
}

}
stopBtn.onRelease = function(){
_root.videoHolder1.stop();
}

playBtn.onRelease = function(){
_root.videoHolder1.play();
}

What happens is when I run the swf (double click on the file) on the server, the play and stop does work.

But when I open up my browser and surf to my server IP address (say http://myserver//PlayMovie.swf), the play and stop doesn't work! It has no effect on the test.swf playing.

Why is this so?

Playing And Stopping A Movie With Help Of Buttons
Hi,
I have made a flash .fla file in which i have few layers. In one layer named movie i have a .swf movie which i had exported to the library. I also have a background screen in another layer in which this movie should paly. Now i want play and pause buttons to control the .swf movie. I am actually new to action Sript and tried to do it but no result. Can anybody please help me. i want the movie to stop when i click the stop button and it should play again when i click the play button.

Thanx
Naaz

Playing And Stopping Movie In Server
Hi, I had a server machine running some Flash files.

One of the files (PlayMovie.swf) actually plays another swf file from the local computer. Meaning I need to have this file (test.swf) in my local drive and what the PlayMovie.swf does is to loadMovie("C:\Video\test.swf")

On PlayMovie.swf, I have 2 buttons to control the playback. stopBtn and playBtn.

As I want to control the size of the video size in PlayMovie.swf, I used createEmptyMovieClip to create an empty movieclip and load the swf into the movieclip.

Heres the codes:

_root.createEmptyMovieClip("videoHolder1", 10);
_root.videoHolder1.loadMovie("C:\Video\test.swf" );
_root.videoHolder1._x = 22.7;
_root.videoHolder1._y = 65;
_root.onEnterFrame = function()
{
if(_root.videoHolder1._width > 1)
{
_root.videoHolder1._width = 300;
_root.videoHolder1._height = 200;
delete _root.onEnterFrame;
}

}
stopBtn.onRelease = function(){
_root.videoHolder1.stop();
}

playBtn.onRelease = function(){
_root.videoHolder1.play();
}

What happens is when I run the swf (double click on the file) on the server, the play and stop does work.

But when I open up my browser and surf to my server IP address (say http://myserver//PlayMovie.swf), the play and stop doesn't work! It has no effect on the test.swf playing.

Why is this so?

Playing And Stopping Movie In Server
Hi, I had a server machine running some Flash files.

One of the files (PlayMovie.swf) actually plays another swf file from the local computer. Meaning I need to have this file (test.swf) in my local drive and what the PlayMovie.swf does is to loadMovie("C:\Video\test.swf")

On PlayMovie.swf, I have 2 buttons to control the playback. stopBtn and playBtn.

As I want to control the size of the video size in PlayMovie.swf, I used createEmptyMovieClip to create an empty movieclip and load the swf into the movieclip.

Heres the codes:

_root.createEmptyMovieClip("videoHolder1", 10);
_root.videoHolder1.loadMovie("C:\Video\test.swf");
_root.videoHolder1._x = 22.7;
_root.videoHolder1._y = 65;
_root.onEnterFrame = function()
{
if(_root.videoHolder1._width > 1)
{
_root.videoHolder1._width = 300;
_root.videoHolder1._height = 200;
delete _root.onEnterFrame;
}

}
stopBtn.onRelease = function(){
_root.videoHolder1.stop();
}

playBtn.onRelease = function(){
_root.videoHolder1.play();
}

What happens is when I run the swf (double click on the file) on the server, the play and stop does work.

But when I open up my browser and surf to my server IP address (say http://myserver//PlayMovie.swf), the play and stop doesn't work! It has no effect on the test.swf playing.

Why is this so?

Stopping Nested Movie Clip From Playing
Hey everyone,

I have a nested movieclip that is looping and I'd like to stop the
movie clip from the top level first frame

I've tried this piece of code:

_root.picture0.real_button.onEnterFrame = function(){
this.stop();

}

but it keeps looping.

Any help would be much appreciated

Stopping A Loop/playing Movie Clips Within One
Hi guys I have a movie clip on loop (refer to this post for my .fla -http://www.kirupa.com/forum/showthread.php?t=191373)


I have some masking mc's I want to play within the loop (but not have it loop, just play at a particular frame and stop)- how would I go about doing that?

I'm so stuck, any help would be greatly appreciated!

Thanks!

Norton Stopping My Flash Movie From Playing In Browser
Hi everyone,

I was banging my head against the proverbial brick wall for hours till I suddenly thought... "I wonder.. what if.. Norton..."

My embedded flash movie playd fine in my browser when the address was "C:Apache...index.html", but it didn't play while browsing "http://localhost/.../index.html", nor did it on my server. Everything is fine now that I have disabled Norton Internet security.

The dimensions of the movie are: 728x90 pixels, which is, I think, standard banner ad. Is this why Norton is disabling it? How do I get around Norton?

Thanks,
fm

Checking If Movie Loaded Into An Instance Has Fully Loaded B4 Playing
Hi,

I'm building a site that streams a series of small movies into some preset into instances on the _root timeline but are paused on an empty frame 1 until needed. So while the first movie is playing the second movie is already being loaded and is cued on frame 1 ready to play.

However, if the timeline tells the loaded movie (i.e. _root.content ) to play frame 2 before this movie has finished loading it will not play. This shouldn't happen because the movie loaded into _root.content should have loaded, but I need a failsafe.

Is there a way to run a routine once the _root timeline is finished to constantly check the status of the movie being loaded in _root.content and then play once it is loaded.

I've tried running this code in a routine:

if (_root.content._framesloaded >= _root.content._totalframes) {
_root.gotoAndPlay(2)
}

..but I'm not sure if it will work.

I really want to avoid a preloader (each movie is only about 10k big )

Any help would be greatly appreciated

Cheers

Stopping Loaded Movie Clip
HI,
could anybody explain me how to control a loaded movieclip.

1) I have loaded a moviclip in a target using command
loadMovie ("images\module07\anim_01.swf", "movie");
where imagesmodule07 is directory name & anim_01.swf is loaded file, & "movie" is the target in which I have loaded the movieclip

2) Now if on click of a button I want to stop the anim_01.swf at a particular frame say _currentframe . what is the best to control it & what command should I use.

please help me. i'm stuck up

Stopping FLV In Loaded Movie Clip
Okay... I have a Shell site that I'm loading different swf Clips into depending on the button press. In this Clip is loading a streaming FLV. When I go to press another button in the Shell to load a new Clip, the FLV continues from the last Clip continues to play! How do I stop it?

thanks!

Stopping FLV In Loaded Movie Clip
Okay... I have a Shell site that I'm loading different swf Clips into depending on the button press. In this Clip is loading a streaming FLV. When I go to press another button in the Shell to load a new Clip, the FLV continues from the last Clip continues to play! How do I stop it?

thanks!

Stopping A Loaded Movie With ..hitArea?
this (old) scroll code is in a movie that is loaded into the main movie.

timeline:

startDrag("track", true);
setProperty("track", _visible, "0");
stop();


inside the symbol:

dX = ../track:_x-230;
ypos = ../track:_y;
if (Number(ypos)<60) {
ypos = 60;
}
setProperty("", _x, _x-dX/14);

reset = _xscale/100*360;
if (Number(_x)>Number((230+Number(reset)))) {
setProperty("", _x, _x-(_width/2));
} else if (Number(_x)<Number((230-reset))) {
setProperty("", _x, Number(_x)+Number((_width/2)));
}

so as you prolly know, this then reacts to the mouse movement in the main movie. i prefer it to only read when the mouse is near the scroller and i can't seem to figure this out.

i have this code in the mainmovie timeline but its not working either:

this.onMouseMove = function(){

if(_root._xmouse >= 500 || _root._ymouse <= 400){

_root.slider.stop();

}

thats the area i want the mouse to work in, only activating the scroller when its in the bottom left area of the main movie.

there's got to be a very simple solution to this and i can't figure it out. please help.

thank you

Stopping Sound In Another Loaded Movie.
I have a main index.swf which has a bg track within an MC (myMusic) and i have buttons to stop and play the track.

Code:
on(press){
stopAllSounds();
myMusic.gotoAndStop(1);
}
The index.swf also has an empty MC in which I have other movies loading into, for example "mainmenu.swf". Now, main menu has a button to stop the sound playing in myMusic. with the same code above but the sound only stops for a minute and then begins to play. How do i get the loaded movie to contol the sound in the parent movie?

Playing A Loaded Movie Clip (loaded In A Different Level)
I really don't understand the problem here, I'm loading a swf containing a movie clip with 2 frames with Stop(); on each. The file is loaded on _level5 so I tried this:

Code:
tellTarget (_level5.musicmc) {
gotoAndStop (2);
}


but instead of telling the musicmc movieclip to go to frame 2, it tells it to the main timeline to go to frame 2 and stop...What's the problem, when I use "Debug Movie", I can see the:
_level5
......._level5.musicmc (....... = spaces)

what's wrong, it seems to don't want to tell the MC to go to frame 2. I passed many hours on this simple d*mn thing and I really can't find out...


BTW, I'm using Flash 5

[FMX] Stopping Loader And Interval Before Movie Is Completely Loaded
I have a button that loads an external swf using the movie clip loader. The problem is if I want to stop the moving from loading before it is completely downloaded I can't. The movie still loads.

I thought using clearInterval would stop this, but it doesn't seem to be the problem. I have attached my actionscript and test fla's.

You can view the movie here: http://www.visualscientists.com/vste...rinterval.html

If you click the orange square it will load an external swf. If you click the yellow square it will unload the movies and clearInterval.


Thanks!


ActionScript Code:
#include "lmc_tween.as"var _nInterval:Number;var _nIntervalFlipContent:Number;var _nFlipInterval:Number;var _nFlipBackInterval:Number;//clear intervalfunction unloadContent():Void{    clearInterval(_nInterval);    clearInterval(_nIntervalFlipContent);    clearInterval(_nFlipInterval);    clearInterval(_nFlipBackInterval);    trace(_nIntervalFlipContent);    unloadMovie("_parent.mc_flip");    unloadMovie("_parent.mc_flipcontent");}//portfolio flipvar my_mcflip:MovieClipLoader;my_mcflip = new MovieClipLoader();var myListenerFlip:Object = new Object();myListenerFlip.onLoadInit = function(target_mc:MovieClip) {};myListenerFlip.onLoadComplete = function(target_mc:MovieClip) {    function loadFlipFade():Void{        loadFlipContent();        loadWorkPad();        trace("loadcomplete");        clearInterval(_nFlipInterval);    }    _nFlipInterval = setInterval(loadFlipFade, 400);    };my_mcflip.addListener(myListenerFlip);// load flip functionfunction loadFlip():Void{    _parent.createEmptyMovieClip("mc_flip", _parent.getNextHighestDepth());    my_mcflip.loadClip("work_flip.swf", "_parent.mc_flip");    _parent.mcHolderwork._visible = false;     trace("load flip");}//portfolio flip contentvar my_mcl2:MovieClipLoader;my_mcl2 = new MovieClipLoader();var myListener2:Object = new Object();myListener2.onLoadComplete = function(target_mc:MovieClip) {    trace("transform");    target_mc._alpha = 0;    target_mc._visible = false;    function contentIntro():Void{        target_mc._visible = true;        target_mc._alpha = 0;        //mcHolder.tween("_alpha", 100, 5, sTween, 0.020);        target_mc.alphaTo(100, 2, sTween, 0.005);        clearInterval(_nIntervalFlipContent);    }        _nIntervalFlipContent = setInterval(contentIntro, 0);};my_mcl2.addListener(myListener2);function loadFlipContent():Void{    _parent.createEmptyMovieClip("mc_flipcontent", _parent.getNextHighestDepth());    my_mcl2.loadClip("flipcontent.swf", "_parent.mc_flipcontent");    trace("flipcontent loaded");}mc_btn.onRelease = function():Void {    trace("mc_btn clicked");        loadFlip();};mc_btn2.onRelease = function():Void {        trace("mc_btn2 clicked");        unloadCo

How To Stop Till Data Is Loaded?
Hi,
I have a movie that accesses ASp pages twice, once for loading teh data in azmovieclip at start ofmovie and another to update database with movie input text at end of movie. it works only at a very low frame rate also sometimes it doesnt work unless i publish movie and then view it in html. If i increase my frame rate to default 12 fps, it doesnt work, probably teh time of access to ASP is not small enuf to fot in higher frame rate.

the second time i do a loadvars.sendandload to update the database... how do i stop teh movie if data hasnt been loaded... when i increase the framerate...

Thnaks,
shilps

Ext Swf Not To Start Till Fully Loaded
hi

i have the script below thats working well for the preloader
to annouce the ext swf loading but it is still starting before
it's fully loaded and is stalling 3/4 thru as completes loading,
i want it to start later or start when its fully loaded....how do
i modify the script to do this......thanks

stop();
this.onEnterFrame = function() {
loading = _root.content.getBytesLoaded();
total = _root.content.getBytesTotal();
percent = percent-(percent-loading/total*100)*0.350000;
per = int(percent);
percentage = per+"%";
bar._width = per*1.310000;
if (percent>99.500000) {
_root.content._alpha = 100;
_root.content.gotoAndPlay(2);
play();
delete this["onEnterFrame"];
percent = 0;
}

};

Why Does My Pre-loader Not Show Up Till It's 60% Loaded ?
Well, I got this preloader from Moock about a year ago, and it works great except for the fact that the dynamic textfields that display the TotalBytes, Loaded, percentage, etc. don't immediately show up, in fact, it shows up at about 50-60% loaded, which means a user stares at a blank screen for the first 50% !!
Can anyone tell me what I'm doing wrong ?

In my main movie,
the preloader is on the first frame. the name of the frame is "loading", and then the real movie starts at frame named "beginMovie".

so here's the code which occurs on a frame after "loading", but before "beginMovie":

var loadAmount = _totalframes;

// If the required number of frames have finished loading...
if (_framesloaded == loadAmount) {
// ...start the movie
gotoAndPlay("beginMovie");

} else {
// ...otherwise, display the load status
// then go back and check load progress again.

// First, determine the loaded and total kilobytes.
loaded = Math.round(getBytesLoaded() / 1024);
total = Math.round(getBytesTotal() / 1024);
percent = Math.round((loaded/total) * 100);

// Display the loaded kb, total kb
bytesLoadedOutput = loaded;
bytesTotalOutput = total;
per = percent + " %";

gotoAndPlay("loading");
}

can anyone help me please??
thanks!

Preloader Wait Till I'm Fully Loaded?
I've been struggling hard with my first preloader. I'm using a first scene which waits in frame 1 until _root.getBytesLoaded() is equal to total. Then it calls nextScene(). In my second scene I have only 1 mc instance called Engine. This mc loads all the rest of my page dynamically with attachMovie(). So most of my assets are being exported in the linkage settings to be usable by the Engine mc. To be able to test this with my cable modem I added a 2 meg sound file to my movie so that it would take awhile to download.

My problem is that when I publish and upload my movie and then test it with my browser, it seems to load the whole movie (both scenes) before anything happens. Once everything is loaded my preloader (scene1) flys by really fast and it breaks right into Scene2.

My guess is that the exported mc's are getting loaded before scene1 gets loaded?

Help plz!


Craig

Looping In A Function Till Textfile Is Loaded
Hello there,

I have a function which loads a textfile and the following line in my script send the Flash movie to a specific frame depending on a variable from this textfile.

But the textfile isn't loaded yet when the line of code (to jump to frame) is called....

Any idea how to build a loop inside this function to see if the file is loaded and then call the jump code?

THE CODE:

Code:
function buildScr(h,o,d,v) {
lastvar = "";
loadVariablesNum ("h" add h add "_o" add o add "_d" add d add "_v" add v add ".txt",0);
bg.q.gotoAndStop(type);
}

Delay GotoAndPlay Till External SWF Is Loaded
I'm using this code on a button:

on (release) {
gotoAndStop("sheryl");
_root.audiomc.loadmovie("sheryl.swf");
_root.cdmc.loadmovie("sherylcd.swf");
spectrum.gotoAndPlay("start");
}

It works great, but I want to modify it so that the last line ...

sprectrum.gotoAndPlay("start");

doesn't happen untill both of these actions:

_root.audiomc.loadmovie("sheryl.swf");
_root.cdmc.loadmovie("sherylcd.swf");

have completed...meaning the external SWF's have loaded completly. How do I do this?

If it makes a difference, I currently do not have any preloaders in place.

Thanks

Javascript Not Working Till The Swf Is Fully Loaded
I have a movie the needs to be played in full for a person to click a "next" button.

At the end of the movie i have an fscommand and in the html file i have javascript that displays a pop up if the movie hasn't been played in full. If it has been played, the next button works.

This all works ok, except if the movie hasn't loaded fully, then the next button can be clicked and ignores the javascript.

Any solutions.. can it be done a better way than I have the code at the moment?

http://www.bbuzzed.cx/irm/2_Weet-Bix_Brett.html


(the next button just goes to a non existing page at the moment)

MX 2004: Pausing Clip Till Loaded
Hi,

I have a clip, and i want it to pause until its all loaded then start playing.

But the trace in the following code, which is on the 2nd frame of the main timelime, keeps returning 'undefined'

percentage = math.Round((this.getBytesLoaded()/this.getBytesTotal())*100);
trace(percentage);

if (percentage == 100) {
gotoAndPlay(4);
}
else {
gotoAndPlay(1)
}

I cant see why that isnt working, since 'this' is pointing to the only thing it can point to, the main timeline.

Any ideas?

Cheerz
Dwayne

Stop Execution Till Movieclip Loaded?
Hi all,

my first post here. Just fell in love with ActionScript and started creating
my first classes and code.
I need help so bad cause I am completely stuck here.
I want to load a movieclip that contains code and variables in its timeline.
Of course these assets cannot be accessed till the movieclip is loaded. For
that reason I played around with actionscript and managed to create
some functions that will safely tell me that the clip is loaded completely.
However I do not know how to stop the execution of actionscript until
this functions flag me that the clip is there ready to be used.
I searched the internet and found some delay functions with setinterval
involved but that is not what I need.
Is there any way to stop execution until some event happens. I tried
a while loop but the movie crashed, probably because no other messages
are dispatched during such loop. I do not know.

For example>
loadAssets("firstSlide.xml"); >> load all clips listed in XML file

menu1._visible = true; >> I get here too soon, clips are not loaded yet!!!!

Would like to stop execution between the two above lines until loadAssets
tell me that firstSlide.xml is completely loaded.


Thanks
Ramon Lopez

Javascript Not Working Till The Swf Is Fully Loaded
I have a movie the needs to be played in full for a person to click a "next" button.

At the end of the movie i have an fscommand and in the html file i have javascript that displays a pop up if the movie hasn't been played in full. If it has been played, the next button works.

This all works ok, except if the movie hasn't loaded fully, then the next button can be clicked and ignores the javascript.

Any solutions.. can it be done a better way than I have the code at the moment?

http://www.bbuzzed.cx/irm/2_Weet-Bix_Brett.html


(the next button just goes to a non existing page at the moment)

Flv Netstream Wait Till 30% Loaded Then Play
Hey this is basically how I have created a media window.
I want the first flv file to load and play. This works fine but What I would like to mash into the equation is a detector for the bytesloaded and if it has loaded say 30% then start playing.
It is a temporary pause the logic of the function is fine but my methods are not. If you know what i mean.

This is the pob: videoLoad_then_play();


Code:

var loaderInterval = setInterval(videoLoadStatus,100);
var loaderAmount:Number;
function videoLoadStatus(){
loaderAmount = net_stream.bytesLoaded / net_stream.bytesTotal;
loader.loadbar._width = loaderAmount * loadbar_Width;
loader.scrub._x = net_stream.time / duration * loadbar_Width;
videoLoad_then_play();
}

function videoLoad_then_play(){
if(loader.loadbar._width >= (loadbar_Width/5)){
net_stream.pause();}
delete videoLoader_then_play();
}
Is there a beter way to do this. The delete and the interval dont seem to be in patnership.

Percent Loaded
how do i have a movie display the percent loaded?

thanx!
austin

Percent Loaded?
From what I've read it looks like there's no way to inform the user how long the data being recieved into flash will take to load or what percentage has loaded etc... is that correct?

Percent Loaded
below is the code i have that displays bytes loaded vs bytes total
i prefer to have a simple % loaded text display

function progressHandler(event:ProgressEvent):void {
trace("progress:", event.bytesLoaded, event.bytesTotal, int(event.currentTarget.percentComplete) + "%");
myLabel.text = event.bytesLoaded + " of " + event.bytesTotal + " bytes loaded.";

how can this be accomplished ?

thanks

A Time Left Till Loaded Script For A Preloader
Hi i need a time left till loaded script dose any one have one please that i could use thanks prefrably in flash 5 but mx or mx 2004 will be ok

A Time Left Till Loaded Script For A Preloader
Hi i need a time left till loaded script dose any one have one please that i could use thanks prefrably in flash 5 but mx or mx 2004 will be ok

Wait Till ClipA Is Loaded Before Loading ClipB
I have image.jpg loading into movieclip target "ClipA". I also have a background.swf loading into movieclip target "ClipB". How can I load background.swf into "ClipB" only after image.jpg is fully loaded into "ClipA"?

Thank you for your help.

Percent Loaded Problem
Guys i have a 3 dynamic text feilds...called bytest, bytesl, and percent.

its in a 2 frame mc and here is the code i put in the first frame where the feilds are located in both frames'


Code:
bytest = _root.getBytesTotal()/1000;
bytesl = _root.getBytesLoaded()/1000;
percent = _root.getBytesLoaded()/_root.getBytesTotal+"%";
now my bytest and bytsel work but my percent feild says

Infinity% and if i take out the +"%" in the action script it says Infinity... please help me ... what am i dioing wrong???????

LoadMovie / Loaded Percent Of
I'm making a graphics section for my web page and I don't want people to wait around for the graphics to load to see the whole section so I figured that I could make little mcs that load in a specified swf with the picture in it. i want to put a little loading bar below where each picture will be displayed but im not sure how to use the getBytesLoaded in accordance with loadMovieClip to get the right data to display in the loading bar. thanks for your help.

Showing Loaded Percent
As I learned Flash some months ago, I was told this code to give to the first frame as preloader:

if (Number(_framesloaded)>=Number(_totalframes)) {
gotoAndPlay (3);}
else {
percents = Math.round((_framesloaded/_totalframes)*100 );}


I was also told that Flash could not recognize if some part of a frame is loaded, so - if I have a Flash consisting of three frames, in preloader it will only be shown 33, 66, 99-100% loaded. But as the time goes, I had visited many flash site, and found out, that alost everyone have loading in percents one after another (1%, 2%, ...)

So I need help - how to do it?
Thanks a lot.

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