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




Flv Problems: Preloading/playing



Code:
on (release) {
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
netStream.setBufferTime(5);
myVideo.attachVideo(netStream);
netStream.play("http://www.mediamentale.com/design_mm/pscreds.flv");
preloader.onEnterFrame = function(NetStream) {
var l = NetStream.bytesLoaded();
var t = NetStream.bytesTotal();
var getPercent = l/t;
loadBar._height = getPercent*60;
loadText = Math.round(getPercent*100)+"%";
loadTitle = "Photosynthesis";
if (getPercent == 1 && t != 0) {
delete this.onEnterFrame;
}
};
}
Hi all,

here's the code....nothing seems to be working with it, short of the FLV actually loading (though it doesn't want to move past the first frame). the preloader isn't touching my loadBar,loadText, or loadTitle, though similar code is working for JPG preloads. i'm sure there's something simple i'm missing, but i'm not used to working with FLVs. Thanks in advance.



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-01-2004, 03:35 PM


View Complete Forum Thread with Replies

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

Preloading Then Playing FLV
This is my first post here adn I'm new to flash so please take it easy on me.....

Basically here's what I'm trying to accomplish and would like a little guidance....


On the first frame, I'd like to begin preloading a video while I just have a few normal effects & logos going across the stage. Then, on the Xth frame (lets say 100), I'd like to begin playing that FLV video. Once the video is done I want to redirect the browser to my main page.

Any suggestions?

Preloading Flv Without Playing
Yeah so I've been looking for about 4 hours how to make a video preload without playing. I'm looking to make a video preload, move some things around with script, and then play the video flawlessly. I've managed to preload the video and halt it from playing by setting the bufferTime to the duration, but this still makes the video play once it has preloaded. I need to preload, then move something, then play. Can anyone help?

Here's the code I'm using:

Code:
var connection_nc:NetConnection = new NetConnection();
connection_nc.connect(null);
var stream_ns:NetStream = new NetStream(connection_nc);
var theduration:Number;

tlm.linevideo.attachVideo(stream_ns);
stream_ns.play("some video url");

stream_ns["onMetaData"]=function(obj){
theduration = Math.round(obj.duration);
stream_ns.setBufferTime(theduration);
}
checkBytesLoaded(stream_ns);


function checkBytesLoaded(my_ns:NetStream) {
tlm.onEnterFrame=function(){
var vidper:Number = my_ns.bytesLoaded/my_ns.bytesTotal;
var pctLoaded:Number = Math.round(vidper* 100);
_root.thefeather.thetext.htmlText=pctLoaded;
if (pctLoaded >= 100) {
delete this.onEnterFrame;
//some function would go here
}
}
}

Preloading A Scene While Another Is Playing
I am trying to generate text to allow one scene to show "loading" text on screen, and disable clicking on that button until the scene loads. I can now disable the button, and get the loading text to appear, but I cant get the loading text to dissappear when the scene is loaded. I am trying to avoid using the Depracated commands from within Flash MX. Please help.

The file is located at http://www.stsperformance.net

Any help is appreciated.

Playing A Movie During Preloading
I currently have a simple preloader that just waits for all the frames to be loaded, and tehn starts the movie.

What I would like to do is while this preloading is taking effect is to have a small animation playing, the animation itself is only a few frames, but i would like it to take as long as the loading takes.

so the loading and the animation finish at the same time.

any suggestions?

Preloading External Swf Without Playing
Hi everyone, im a newbie to flash, so I hope you'll understand what Im talking about. Thanks for helping =)

I'm trying to make a preloader for 5 external swf without making them play right away.

i have a movieclip that loads 5 different external .swf using loadMovie()
So I have 5 buttons for each external .swf
note, these 5 external .swf loads into the same movieclip holder.

so far, the tutorials i looked at tells me to make a preloader for each external swf, but I do not want to do that because the point of this flash is to time how long it takes someone to do all 5 activities in these external .swf. And so i want them to load all in the beginning of the main flash and i do not want them to show until the button is pressed for them.

Any hints? tutorials? code? anything!!

thank you very much,
kinoko

Preloading Movies And Playing Them Later?
Hello, apologies if this seems like a redundant question... i've been reading through all the turorials and forum threads i can find, and am just confused at to what exactly i need to do next.... my first time trying to use preloaders but am finding i need them in order to make my project run smoothly....

my situation: want to preload 5 swf files into my main movie, and have them at the ready to play when i want them to (either by an onEnterFrame or onPress).

i started working with some preload array script from Scotty i found on one of the threads, but elsewhere i've seen info about putting extra frames into the uploading swfs and am unsure what i need to do with this or how it would fit in with the below code. right now, when i try to play one of the uploaded swf files nothing is happening, and i'm guess my code is wrong there too, but don't know what to put....

....pretty new at all this and feeling rather clueless.... help??!!?

here's what i've got thus far, on first frame of main movie, just don't know where to go from here....


Code:



stop();
movieArray = new Array("ams1voice.swf", "apmmvie.swf", "ccmvie.swf", "clientsatprinciple.swf", "cycle.swf". "govmvie.swf");
var j = 0;
var loadTot = 0;
function preload() {
var mvieH = this.createEmptyMovieClip("container"+j, 999+j);
mvieH.loadMovie(movieArray[j]);
var temp = this.createEmptyMovieClip("tmp"+j, j);
temp.onEnterFrame = function() {
var t = mvieH.getBytesTotal();
var l = mvieH.getBytesLoaded();
var loaded = Math.round((l/t)*100)/movieArray.length;
bar._xscale = loadTot+loaded;
info.text = "loading movie...";
//or
//info.text = loadTot+loaded+" percent loaded"
if (t == l && t>5) {
//mvieH._visible=0;
loadTot += loaded;
j++;
nextMovie();
delete this.onEnterFrame;
}
};
}
function nextMovie() {
j<movieArray.length ? preload() : (info.text="", bar._visible=0);
}
preload();
apmholder.preloadSwf("apmmvie.swf");
amsholder.preloadSwf("ams2.swf");
//etc etc

thanks for any help!!

Playing A Movieclip While Preloading
I am trying to figure out how to connect a preloader with a movieclip I made. Essentialy what I want to happen is for the heart graphic to start out black and white and as the percentage preloaded increase, the color version of the heart I masked will appear. Here is the link to the .FLA file. I have a basic mask over the colored version of the heart that I motion tweened to move. Now that I have this setup, how do I plug it into a preloader to enable it to sub as a load bar. Partially coloring the image as more of the document is loaded.

Thanks for your help on this.

Greg

Link:

www.gregwrightdesigns.com/heart_loader.fla

Preloading Movies While Others Are Playing
Hi all,

I have several movies that will be loaded into a main movie. I am loading the movies when the user chooses to open each movie. The problem is that then the user has to wait until each movie loads. Is there any way to change this?

Thanks

Flv Problems: Preloading/playing
Code:
on (release) {
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
netStream.setBufferTime(5);
myVideo.attachVideo(netStream);
netStream.play("http://www.mediamentale.com/design_mm/pscreds.flv");
preloader.onEnterFrame = function(NetStream) {
var l = NetStream.bytesLoaded();
var t = NetStream.bytesTotal();
var getPercent = l/t;
loadBar._height = getPercent*60;
loadText = Math.round(getPercent*100)+"%";
loadTitle = "Photosynthesis";
if (getPercent == 1 && t != 0) {
delete this.onEnterFrame;
}
};
}
Hi all,

here's the code....nothing seems to be working with it, short of the FLV actually loading (though it doesn't want to move past the first frame). the preloader isn't touching my loadBar,loadText, or loadTitle, though similar code is working for JPG preloads. i'm sure there's something simple i'm missing, but i'm not used to working with FLVs. Thanks in advance.

Preloading An SWF Without The Timeline Playing Out
Hello all my people. I have a slight issue with preloading an external swf. The preloader works fine it is pretty basic. However when the preloader is working, Ondrox.swf is playing out it's own timeline. When the loader is complete the clip is already halfway completed.

I have solved this problem in the past by putting a stop(); on the first frame of the external swf. Then targeting the external swf timeline with gotoAndPlay("2"); but this was in school and I have since forgotten how target the external timeline.

Is there any way play the swf only after the loading is complete?

Code:

import flash.display.Loader;       
import flash.display.LoaderInfo;

var myLoader:Loader = new Loader();
var myRequest:URLRequest =       

new URLRequest("ondrox.swf");
import flash.net.URLRequest;

myLoader.load(myRequest);

myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showLoadResult);

import flash.events.Event;
import flash.events.ProgressEvent;

var loadProgress_txt:TextField = new TextField();
import flash.text.TextField;

function showPreloader(evt:Event):void {
   addChild(loadProgress_txt);
}

function showProgress(evt:ProgressEvent):void {
   loadProgress_txt.text = "loaded:"+evt.bytesLoaded+" from "+evt.bytesTotal;
}


function showLoadResult(evt:Event):void {
   removeChild(loadProgress_txt);
   addChild(myLoader);
}

Preloading A Flash File While Another Is Playing
Let's say I have about 10 swf files that make a whole presentation and each is about 400-700k. Is it possible to play one of the files then have the next file load while the first one is playing, then play, then have the next one load ect. If it is possible will it effect the playback of the file that is playing? Your help on this matter is much appreciated!

Preloading A Percentage Of The File Then Playing
Is it possible to preload a moive only to a certain percentage and then play the moive while the rest loads? or is there not much point in doing that. Im asking because I have a moive that is 1.7mb and its file size is far to big and i dont quite know the best way to get it on to the net.
Thanx alot

Playing Problem In A Mp3 Preloading Player
I'm making a mp3 player on flash, which get mp3 url from a xml file, and preload it in flash,after loading, mp3 will begin to play then , i have made most of it, but i come across the problem that when loading completed, mp3 didn't play as I want! I've try to explain the actionscript and mark the problem related place red, looking forward to you reply and Thanks in advance!

I have uploaded the file, if the url in xml is dead, you could change one


Code:
var myTxt = new Array();
var musicUrl = new Array();
var musicName = new Array();
var musicXml = new XML();
var mySound = new Sound();
musicXml.load("musicList.txt");
//musicList.txt is the XML file
musicXml.ignoreWhite = true;
System.useCodepage = true;
//-------------------------the function that loading the mp3, ---------------------
var checkProgress = function (xmlObj) {//xmlObj actually is a mp3 Object
mySound.stop();
//let music not to play at the beginning
onEnterFrame = function () {
var bLoaded = xmlObj.getBytesLoaded();
var bTotal = xmlObj.getBytesTotal();
var pLoaded = int((bLoaded/bTotal)*100);
if (bLoaded == bTotal and bLoaded>=100) {
mySound.play();
//when loading complete, play the mp3, here is the problem, mp3 don't play after loadingtrace("bloaded == btotal "+"bLoaded="+bLoaded);
delete this.onEnterFrame;
} else {
trace("milliseconds elapsed: "+getTimer());
trace("bytesLoaded: "+bLoaded);
trace("bytesTotal: "+bTotal);
trace("percent loaded: "+pLoaded);
trace("---------------------------------");
}
};
};
//-------------------------------------------------------------------------------
musicXml.onLoad = function(success) {
if (success) {
trace("musicList.xml is loaded");
fetchTxt();
//提取XML数据的函数
} else {
trace("musicList.xml isn't loaded");
}
};
//------------------------the function that get info from xml file-----------------------------
//------------------------and also make the btns---------------------------------------
//------------------------it's has no problem------------------------------------------
function fetchTxt() {
for (i=0; i<musicXml.firstChild.childNodes.length; i++) {
//myTxt数组用来存放值在XML文件里的路径
myTxt[i] = musicXml.firstChild.childNodes[i].attributes;
}
trace("myTxt's length is "+myTxt.length);
//----------------以下把XML里的值存入news_arry数组中-----------------
childNodes1_len = musicXml.firstChild.childNodes.length;
for (i=0; i<childNodes1_len; i++) {
//music_array记录音乐名
musicName[i] = myTxt[i].musicName;
musicUrl[i] = myTxt[i].musicUrl;
trace("the theurl in xml is "+musicUrl[i]);
trace("the musicName in xml is "+musicName[i]);
//trace("xml data is "+myTxt[i].thename);
//trace("news_array[i] is "+news_array[i]);
}
//--------------------以下制作按钮--------------------------------------------
this.createEmptyMovieClip("newBtn", 100);
newBtn._x = 0;
newBtn._y = 5;
for (i=0; i<childNodes1_len; i++) {
//复制17个按钮MC,因为影片的高度只放得下这么多
this.attachMovie("btn", "newBtn"+i, 101+i);
//trace("btn txt's size is"+btn.size);
eval("newBtn"+i).createTextField("btn_txt", 102, 0, 0, 10000, 20);
eval("newBtn"+i).btn_txt.text = musicName[i];
//-----------------------设置字体样式------------------
temp1.btn_txt.text.multiline = true;
temp1.btn_txt.text.wordWrap = true;
temp1.btn_txt.text.border = ture;
myformat = new TextFormat();
myformat.color = ox000000;
myformat.bullet = false;
myformat.size = 13;
myformat.underline = false;
temp1.btn_txt.setTextFormat(myformat);
//-----------------------------------------------------------
eval("newBtn"+i)._x = 0;
eval("newBtn"+i)._y = i*16+7;
//16是两个按钮_y的距离
eval("newBtn"+i)._alpha = 0;
eval("newBtn"+i).gotoURL = musicUrl[i];
eval("newBtn"+i).onRelease = function() {
mySound.loadSound(this.gotoURL, true);
checkProgress(mySound);
trace("you clicked on:"+this.gotoURL);
};
eval("newBtn"+i).onRollOver = function() {
this._alpha = 100;
delete this.onEnterFrame;
btn_status = "onRollOver";
};
eval("newBtn"+i).onRollOut = function() {
this.onEnterFrame = function() {
if (this._alpha>=0) {
this._alpha -= 25;
}
};
btn_status = "onRollOut";
};
}
}

Help With Preloading Mulitple Swfs Before Playing?
i've searched the forum and google but didn't really come up on anything solid except for this:
http://www.flash-creations.com/notes...ic_loadjpg.php

my as experience is ok but not enough to dissect it in order to do what i want to do.

i have a few swf's that i'd like to preload before playing a slide show.

imgMC is the name of an empty mc that's on the stage where the pic_??.swf files will be loaded into.
what happens is that it will preload the first swf and play, once that swf file is done playing, the slide show it will preload all over again the next swf file.

can someone please help with a solution on how to preload all of the swfs before if begins the slide show?

code: function proceed () {
onEnterFrame = function () {
if (imgMC.getBytesLoaded () != imgMC.getBytesTotal ()) {
progressbar._xscale = 100 * imgMC.getBytesLoaded () / imgMC.getBytesTotal ();
} else {
startSlide ();
delete onEnterFrame;
}
};
}

this is how my pic array is set up.

code: pictures = ["pic_1.swf", "pic_2.swf", "pic_3.swf"];

also can this be done using the MovieClipLoader?

any help will greatly be appreciated.

Preloading And Playing Multiple .flv Files
Hi all,

I'm making a small .flv video player that allows the user to watch 3 different videos. When they press a button to play one of the videos, the player preloads and plays an advertisement before preloading and playing the video they selected. After watching the advertisement one time, they can watch the 3 videos without having to watch anymore ads.

I've got this working alright, but I've got a very long-winded approach that is making it difficult to add the preloader to the videos. I'm hoping someone can suggest a better way of doing this.

I'm attaching the .fla for your reference.

Thanks in advance for the help!

Loader Playing While Preloading Is Still Loading
i got a strange thing
i made the UIloader instance of loader
and moving bar instance of preloader_mc
and when test it

loader play before the preloader complete
here is the codes which i typed


Quote:




loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
loader.addEventListener(Event.COMPLETE, onComplete);
function onProgress(e:ProgressEvent):void
{
var loaded:Number = loader.bytesLoaded;
var total:Number = loader.bytesTotal;
preloader_mc.scaleX = loaded / total;
}

function onComplete(e:Event):void
{
removeChild(preloader_mc);
removeChild(outline_mc);
}

Help With Preloading Mulitple Swfs Before Playing?
i've searched the forum and google but didn't really come up on anything solid except for this:
http://www.flash-creations.com/notes...ic_loadjpg.php

my as experience is ok but not enough to dissect it in order to do what i want to do.

i have a few swf's that i'd like to preload before playing a slide show.

imgMC is the name of an empty mc that's on the stage where the pic_??.swf files will be loaded into.
what happens is that it will preload the first swf and play, once that swf file is done playing, the slide show it will preload all over again the next swf file.:confused:

can someone please help with a solution on how to preload all of the swfs before if begins the slide show?

ActionScript Code:
function proceed () {
onEnterFrame = function () {
if (imgMC.getBytesLoaded () != imgMC.getBytesTotal ()) {
progressbar._xscale = 100 * imgMC.getBytesLoaded () / imgMC.getBytesTotal ();
} else {
startSlide ();
delete onEnterFrame;
}
};
}




this is how my pic array is set up.

ActionScript Code:
pictures = ["pic_1.swf", "pic_2.swf", "pic_3.swf"];




also can this be done using the MovieClipLoader?

any help will greatly be appreciated.

Help: Preloading Many Jpgs While Movie Is Playing And Using Them When They Are Loaded
Hi, please bear with me.. there is something I don't understand...
I have some sort of a tile puzzle using different images...
I create the tiles using actionscripted masking which works fine...
What I would like to do now is preload three images... and when they are fully loaded attach them to many different 'holder' movie clip which I will later mask.
Becouse of this I use many movie clips that contain the same image and get masked in different points.
Meanwhile while these masked clips are showing and the user is playing around with them I would like to keep preloading more pics so that when they are loaded the user can click a 'new' button a see a new puzzle with new pics....

My problem is the following.. say I preload one image inside an invisible clip..
once it is loaded how do I make copies of it and attach them to different holder clips...
I thought I'd use a duplicateMovieClip command.. but I found this:
http://www.macromedia.com/support/fl...nts/dupswf.htm
that says:

///
The duplicateMovieClip action only works on objects actually in the movie clip and not on loaded movies.

Solution
There is no known work around at this time except to actually load the movie a second time.

///
Hope I made myself clear enough.. sorry.. english is not my first language.. neither is actionscript.. as you can tell :-))
Thanks
Sergio
[Edited by smarques on 07-19-2002 at 06:35 AM]

Preloading W/o Loaded Swf Playing First Frame's Actionscript
Just what the subject says. I need to update an existing flash app that needs to be backwards compatible with our previous content. The new app includes preloading, but a problem we're having is that the first frame of the preloaded swf (loading just into a hidden mc) automatically plays and therefore, even tho stopped, will execute any script on that frame.

Can anyone think of a workaround? Like being able to negate any command or variable sent to any possible location until a later time?

Preloading External Movies While Playing Main Swf
I'm willing to bet this has been answered here somewhere, but I've yet to find it, sorry in advance folks.

Here's my problem...

I need to preload one swf while playing another. Each are at about 700k at this point.

I've created a movie (with sound) that has become too large in file size and I need to break it into two. Since there are two songs in total, I simply have made two swf's to break it up, one to load onto the end of the first one.

Let's call them A.swf and B.swf.

Normally, preloading's not a problem for me, but in order to keep the movie seamless I need to start B.swf at the end of A.swf without a preloading break.

How DO I do that? Can I preload that second swf while the first one plays, THEN have the second one play?

Beer's on me for answering, thanks!

Preloading Movies In The Background And Playing As Loaded
Hi.

Ok. This is the plan. I have 4 swfs. What I would like to do is preload the intitial one, then as that one gets to the end of its animation it starts loading movie 2, then loops as it finishes playing again (and possibly again, depending on how long it takes movie 2 to load) until number 2 is loaded, then at the end of 2 it starts loading number 3 and loops until 3 is loaded, and so on...

These 4 movies can only be visible on the stage at one time (i dont want to replace them, just make them invisible once the new one kicks in).

The end of the 4th movie just stops.

Please!!!! i know this is posssible, can someone help??

Thanks,

Chris

Preloading Multiple External Swfs But Not Playing
I understand how to load external swfs into an container with the loadmovie command. I also understand I could make that container invisible so I don't see the movie right away.

However, I want to script a preloader that loads swfs without starting them - just gets them into memory.

Anyone know how to do this and then play them on command?

Thanks!

Preloading And Playing Multiple Flvs Without A Pause
Hi,
I've searched around and haven’t really found anything definitive about this. I’m trying to preload five flv files and then get them to play one after the other with as little pause in between as possible. I’m thinking I might need to create five netstreams and then pause them, check to see if they’re loaded, start playing then first when they are with the others hidden, then after flv one is done show the container for flv two, etc. I’ve done a test and I still get a bit of a jump in between flvs. Has anyone done then and got it to work without that hiccup?

Thanks.
Paul

Preloading Multiple SWFs Into Cache And Playing Them Sequentially
Hello

I've seen a lot of posts on this subject, and I promise I've tried endlessly to make sense of the solutions that other people have posted. But I cannot seem to get any code to work my my purposes, so I decided to post my own thread.

I have a main parent Flash movie that I need to load 7 exteral SWFs into. Each of the SWFs is like its own scene in a longer movie. The final parent movie should play each external SWF movie sequentially so that it appears as one combined movie. I want to use a preloader for the first couple of loaded SWFs (maybe the first 2-3) so that the parent movie does not start playing until those movies are fully loaded. Then I want to continue to preload the rest of the external SWF files into the cache so that they are fully loaded by the time the parent movie gets to playing them. Does this explanation make sense?

Basically, I have a long Flash animation that I decided to split up into several individual movies. I've using the parent movie to seamlessly string together my individual movies to give the appearance of cohesion. I know how to use the LoadMovie function to load the SWFs into empty movie clips. That's no problem. However, I'm having difficulty with the prelaoder aspect. I am optimizing the parent SWF for the web, and it's important that the video plays seamlessly, so I cannot put individual preloaders onto each external SWF. They have to preload at the beginning so that when each individual SWF is called, it's already loaded and no preloader is required.

Can anyone please help me with this?? I'm working under kind of a tight deadline, and I tried to the best of my ability to solve the problem using comments from previous posts, but I have been unsuccessful. Thanks again for anyone's help.

Preloading Multiple SWFs Into Cache And Playing Them Sequentially
Hello

I've seen a lot of posts on this subject, and I promise I've tried endlessly to make sense of the solutions that other people have posted. But I cannot seem to get any code to work my my purposes, so I decided to post my own thread.

I have a main parent Flash movie that I need to load 7 exteral SWFs into. Each of the SWFs is like its own scene in a longer movie. The external files are called:

mc1.swf
mc2.swf
mc3.swf
mc4.swf
mc5.swf
mc6.swf
mc7.swf

The final parent movie should play each external SWF movie sequentially so that it appears as one combined movie (so none of the loaded SWFs are actually playing at the same time - they should only play one at a time, one after another). I want to preload mc1.swf, mc2.swf and mc3.swf into the cache before the parent movie starts playing (and I would like to include a progress bar to indicate loading status). Once those SWFs are preloaded, I would like them to start playing sequentially while the rest of the SWFs load in the background. Does this explanation make sense?

Basically, I have a long Flash animation that I decided to split up into several individual movies. I've using the parent movie to seamlessly string together my individual movies to give the appearance of cohesion. I have determined that I should use the MovieClipLoader Class and loadClip() to accomplish what I am trying to do. However, I have a very limited knowledge of actionscripting, so this has been a major challenge for me.

I am optimizing the parent SWF for the web, and it's important that the video plays seamlessly, so I cannot put individual preloaders onto each external SWF. They have to preload at the beginning so that when each individual SWF is called, it's already loaded and no preloader is required.

Is there any way someone could write out some sample code for me please? Any help would be GREATLY appreciated because I am working under a bit of a tight deadline.

Thanks in advance.

Preloading Child Movieclips Individually And Playing Them AFTER They're Fully Loaded
i just want each of my child movieclips to play AFTER they're fully loaded individually. Could somebody please help me out? where did i go wrong here? what did i miss? Please help me out. thank you.

this is what i have right now:

loader_mc._visible = false;
picLoader._visibility = false;

var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);

myListener.onLoadProgress = function(target_mc,bytesLoaded,bytesTotal) {
loader_mc._visible = true;
picLoader._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
loader_mc.bar_mc._xscale = pctLoaded;
if (bytesLoaded >= bytesTotal) {
loader_mc._visible = false;
}
}


btn_1.onRelease = function () {
mcLoader.loadClip("child_mc_01.swf",picLoader);
}
btn_2.onRelease = function () {
mcLoader.loadClip("child_mc_02.swf",picLoader);
}
btn_3.onRelease = function () {
mcLoader.loadClip("child_mc_03.swf",picLoader);
}

Newbie Question Re: Starting, Preloading, Then Playing A Video Clip
I've got flash 8 pro and I'm also trying out two or three other software packages. All I really want to do is create a video clip for a website that sits there and waits for someone to hit the play button, goes into a preloader the first time, play the video when it's sufficiently loaded then stops and returns the scrubber to the starting point.

I've followed several tutorials to create a preloader and a couple work nicely with a loader bar, percentages, and pop in a large jpeg with it's time. However, whenever I try putting in the video clip it doesn't work.

I've used the pro 8 video import wizard to create the files to include the nice controllers. I've followed the tutorials, to include finding the glitches and making changes to the preloader works.

So what's the trick to getting a composite movie with preloader, video clip with controller, to the website in parked mode waiting for a viewer to hit "play" and starting the movie with "loading" and then the video.

On2 has a nice preloader set up, but I don't want to pay that much just to get a preloader and the movie start. Swish Video is easy to use, but no preloader. Can't get Swish Video and SwichMax to merge at all. Wimpy does a great job with audio, but kind of klunky with video--no really workable pre-loading.
MCH

Having Some Trouble With Loading, "preloading", And Playing Sound...
Not sure whats going on here. I am completely novice so please excuse my code examples. Well, here goes...

Use the media player...
Download Source...

Occasionally(not everytime, but enough to feel quirky) when i load the movie, the actionscript to preload the sound does not work. any suggestions?

also need to know how i would create a bar that says how much of the song has played. i assume that it would be similar to the preload bar(in theory) but dont know how to get the song length or how much of the song has played into a variable

Preloading A Movie But Not Playing It While Another Movie Is Running
I need a few tips on how I make sure some flash movies are preloadet while the first movie is played, so they can be ready to be played when chosen without having to wait for them to load then.

Got any ideas to get me started in the right direction please?

Flash Player Not Playing Not Playing Properly Low Bitrate Sound
Hi,
I have created a flash audio player which can play streaming audio (mp3) files and it takes data from external xml file. Everthing is working fine. But when i used a low bitrate mp3 file (size 600 kb, time 3min approx) , it plays the audio with max speed and get ended in 30 seconds. The same audio file is playing normally in windows media player, or winamp,etc.
Plese give me some idea what is happening ........
Thanks,
Gunjan

Check If Movie Clip Finish Playing Before Playing Next
I'm trying to figure out how to create a conditional variable script to check to see if one of the 4 movies are finished before starting the next selected one.

I have 4 menus with 4 movie clips that have an opening and closing animation in them.
When clicking the one of the buttons I would like it to check and see if any of the movie clips are in the open position. Then have the movie that is in the open position play it's closing animation. Then play the selected category movie that the person clicked on.

I know it's all done with variables but just cant figure out how to put it together.

here is what i have so far.

menuStatus = 0;
trace(menuStatus);
but1.onPress = function() {
if (menuStatus == 0) {
menuwork.gotoAndPlay("start");
menuStatus = 1;
} else if (menuStatus == 2) {
resetMenus();

}
};
but2.onRelease = function() {
if (menuStatus == 0) {
menuwhoweare.gotoAndPlay("start");
menuStatus = 2;
}else if (menuStatus == 1){
resetMenus();
}
};
function resetMenus() {
if (menuStatus == 1) {
menuwork.gotoAndPlay("close");
menuStatus = 0;
} else if (menuStatus == 2) {
menuwhoweare.gotoAndPlay("close");
menuStatus = 0;
}
}

thanks for any help in advance

How Do I Check To See If A Sound Is Already Playing Before Playing When Pressing Play
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.

heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusc.

ActionScript Code:
on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}
Thanks

Playing A Certain Frame, After A External Swf File Has Started Playing?
Hi,
This is my first post here.

I need to know how to have a certain frame in my movie start playing, after a external movie I have has started playing.

The problem is basically sync., and I want a certain frame to play only after the external movie begins to play.

I'm using...

loadMovie("http://www.alainshep.com/alain.swf", 66);
if (playing) {
gotoAndPlay("begin");
} else {
gotoAndPlay("start");
}


The external movie plays after it loads, but I just don't know how to set it up for the frame I want to play after it has started playing.

Please Please someone help me..

Preloading .swf Before Preloading Main Movie
Ummm

Things are getting complicated lol

I have my main movie going ..AND I actually managed to get a pre-loader working ...

and it's all ok as long as you have adsl or cable connection - otherwise it is REALLY messy.

The main .swf uploads onto the web .. but the secondary swf have not yet loaded .. and so it is all out of synch .. if you wait a while and refresh you get it ... but argh it is horrible .....

so .. is it possible to block the preload of the main movie until it has preloaded its secondary swf's ??

I should imagine it's recoding the actions AGAIN .. can any one get me started please ..

Is this often a problem if you add swf to a main movie ???

tyyyy all

julia

How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.


Code:
//SOUND LOAD

var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);

function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}

function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}

//SOUND PLAY

snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);

function sndPlay(evt:Event):void{

var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?

thank you

How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.


Code:
//SOUND LOAD

var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);

function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}

function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}

//SOUND PLAY

snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);

function sndPlay(evt:Event):void{

var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?

thank you

How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.


Code:
//SOUND LOAD

var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);

function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}

function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}

//SOUND PLAY

snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);

function sndPlay(evt:Event):void{

var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?

thank you

When A Sound Stops Playing So It Can Start Playing Another Sound :Monitoring Playback
I'm attempting to do a very simple thing and I'm very perplexed. My girlfriend is an opera singer and all I'm trying to do is advance the audio track when the song finishes playing to go to the next frame. On the surface it seems easy, however I can't seem to figure it out. Perhaps you can help?

Check out the movie here: http://www.earthgrid.com/earthgrid/valentina.html


Here's my code its on frame 2 in the movie



Code:
stopallsounds();
s2.close();
s3.close();
var s1:Sound = new Sound();
s1.loadSound("Agnus_Dei.mp3", true);
s1.start();
stop();
Explanation:: the flash movie has buttons that allow you to navigate between the 3 different music tracks.

when you click on a button, first I close the loading of the previous track, ie. s2 and s3, if they are still loading.

What I'd like to do is insert a command that advances to the next track (which happens to be on the following frame, 3) ONLY when the first audio track is finished PLAYING, not finished 'loading'

something like:
s.addEventListener(Event.SOUND_COMPLETE, gotoandplay (3);
);

so that when Agnus Dei finishes playing it goes to the next frame which starts the next track.

but that' doesn't seem to work.

I found this URL in Adobe's support site:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000283.ht ml

it says this:

Your application might want to know when a sound stops playing so it can start playing another sound, or clean up some resources used during the previous playback. The SoundChannel class dispatches an Event.SOUND_COMPLETE event when its sound finishes playing. Your application can listen for this event and take appropriate action, as shown below:


Code:
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;

var snd:Sound = new Sound("smallSound.mp3");
var channel:SoundChannel = snd.play();
s.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);

public function onPlaybackComplete(event:Event)
{
trace("The sound has finished playing.");
}
>> However, when I try to paste in this code into a frame in Flash CS3 it gives an error saying I have to put it in a 'package'
I tried that, putting this code into a file and saving it as a .as file


I really don't get how to do this Package thing in CS3, so I couldnt get the example to work.

If so please contact me Please help!

Help Required Progress Indicator Bars. NOT PRELOADING BARS AND NOT A PRELOADING QUE
Help required ! progress indicator bars. NOT PRELOADING BARS AND NOT A PRELOADING QUESTION!

OK I have a swf called audio.swf which just contains a 15 minute streaming audio file that it just dragged along the time line.

I want to have some visual indicators in the swf, so that the user has some info of what is going on:

What I require within the swf are the following:

1.Progress Bar: How much of the movie has been played. This will obviously go up as the timeline for the swf progresses.
2.Streaming bar: Giving the user an indication of the amount of swf that has currently been downloaded.
3.Time (minutes and seconds) that the movie clip has been playing for
4.Elaped time (time remaining)

As you can see I have attached no fla, as I am sure that these 4 visual indicators are all fairly simple to code of any of you action script daddies out there.

Any help on one or all the 4 things I require would be brilliant.

If anyone could help me this would be more than appreciated.
Cheers

PRELOADING (dynamic Preloading?)
dear all

i hope someone could give me tips how to do this:

i have one main scene and 7 navigation-points. each of the 7 scenes are external movies which should be loaded.

but can they load in the background too, even if the user didnt select a point yet? and when he does, the progress bar would automaticly fill up as much as the movie is loaded already. and it should continue loading all the scenes in the background, while he is in one section.

i hope you know what i mean, excuse my english.

looking forward for a help asap. thanks a lot in advance!

PreLoading Scenes (PRELOADING)
Hi everyone. Ive had my website running for a while now www.coriolis-effect.co.uk Its nearly done all but preloading really. I want visitors to be shown that something is happening rather then just waiting. This has caused a fair percent of people to leave the site straight away especially those with crap connections. Anyway Ive had a look around on the forum a bit for help and I can't see anything about Scenes and preloading them. Maybe there is a way to just preload so many frames? Any help appreciated Lewis

http://www.purgeme.co.uk/lewis/Corio...lis-Effect.fla

°°°keep The Sound From Playing If It Is Already Playing
Hi FlasherZ,

I add this code to my buttons but it didn't work - can you fix it. Do I have to define a variable "playing" in the first frame???

I read this tutorial, chapter "How to Start, Stop and Loop a Sound Object" and everything works fine but if I hit the on button I hear 2 sounds playing, if I hit the button again, I hear 3 sounds playing at the same time - U know what I mean, so I wanted to use the code in the tutorial with the variable "playing".

Here is the link to the tutorial:
http://www.kennybellew.com

I would appreciate some advices.

Omitofo-
Attila

MX PRO AS 2.0 Incongruity In 1.swf Between Playing 1.swf & Playing 1.swf In 2.swf
Salutations to all Kirupians and Visitors!

I am in need of some assistance. I have searched the forum and tutorials, and did not find the solution for the problem I have. Hopefully I am in the correct forum! <- my ability to identify the type of problem I am having is apart of why I haven't solved the problem, and therefore, I don't think I have enough knowledge to have concrete beliefs whether or not this posting belongs in Actionscript or MX. Any opinions?

I am learning how using flash is like using legos. if you have two eight hole pieces, and you put them together using only two holes, the lego structure will not be as strong or work so well. seems like you have to cover the entire basis (put all eight holes into the eight pegs) for the program to work, and I am reading the help section for this, although if anyone knows of some good books that hold valuable knowledge and wisdom, I would certainly like to know about them, as I am dedicated to learning flash.

I have 1.swf, that in order to get it to operate as I have programed it, I must play it in the flash player. Playing it in Flash Professional does not work in its entirety because of conflicts in the enter key's duties. The 1.swf works as it should when played in the flash player outside of Flash Professional MX 2004.

Herein lies the problem. When I am loading 1.swf into presentation style 2.swf, and then play 2.swf in the Flash Player, the key board functionality of 1.swf (most specifically the enter key) does not operate as the 1.swf Actionscript 2.0 defines. I have created a projection file as well, to see if there was any other behavior that might occur, but the result were the same. Has anyone experienced this before and/or know how to fix this issue?

I truly appreciate any help that can be given.

Here is the section of the code dealing with the keys:
I have tried separating the different if(Key.isDown(Virtual Key Code) statements into different keyboard listeners, but to no avail.
If in order to solve this issue - if the kind Kirupian reading this stuff needs more code, let me know, as I'll have the rest of the comments finished shortly.

I am beginning to wonder whether an .swf file has a hierarchy for keyboard listeners between .swf files being loaded and the ones doing the loading?

Could there be some standard structure that my code has some type of interference with and that is the cause for the malfunctioning .swf?

//1.swf is loaded into a empty MC from within 2.swf.
this.createEmptyMovieClip("a_mc", 0);
loadMovie ("relative_file_name_1.swf", a_mc);

var re:Object = new Object();
//Keyboard listener

//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++
//----------------------------------------------
re.onKeyDown = function() { // sets the key object's duties if (Key.isDown(190)) { // determines if the key pressed is the wanted key
//the comma key
stop();
// stops and sends the playhead back one frame
gotoAndStop(_currentframe-1);
}
if (Key.isDown(191)) { // makes sure that the needed key is the one pressed
//the period key
stop();
// stops and sends the playhead forward one frame
gotoAndStop(_currentframe+1);
}
if (Key.isDown(13)) {
//the enter key
if (z == _level0.gtFrame) {
//if the focus is on the go to frame text box(gtFrame)
var c:String = new String(gtFrame.text); //takes the //input from the text box and turns it into a string
var d:Number = parseInt(c); // turns the string into a //Number
oo.cla(d); //Frame.as object basically performs //gotoAndStop(var a:Number)
} else if (z == _level0.check) {
//if the focus is on the check box
check.selected = !check.selected;
} else if ((z == _level0.strt_loop_txt) || (z == _level0.end_loop_txt) || (z == _level0.rb1) || (z == _level0.rb2) || (z == _level0.rb3) || (z == _level0.ps_txt)) {
//if the focus is set on any of the custom loop's radio //components or text boxes
if (thread) {
//if moving from a play reverse to a play loop action
thread = false;
clearInterval(b);
}
if (threadtwo) {
//if moving from a play reverse loop to play loop
threadtwo = false;
delete onEnterFrame;
clearInterval(bb);
// this is needed to end the processes in case there is a change from play reverse loop to play
}
if (aaa) {
//if a pause interval has been set - aaa is set true when a pause interval has been called
aaa = false;
clearInterval(eee); // eee is the interval that runs a pause effect
}
//This series of code is similar to the play_btn code if (check.selected == true)
//sets up the var for the loop and calles the needed methods to make the loop function var iiiii:String = new String(strt_loop.text);
//take the text from the start loop input //text field, signifying the first frame in the //loop
var jjjjj:Number = parseInt(iiiii);
// turn that string into a number so the // computer can utilize the value
var kkkkk:String = new String(end_loop.text);
//take the text from the total # of frames //in the loop text field
var lllll:Number = parseInt(kkkkk);
// turn the Total #Of Frames In The string // into a Number
var nnnnn:Number = lllll+jjjjj;
// this line is necessary to determine which // frame is the end of the loop
oo.cla(jjjjj);
//Frame.as object basically performs //gotoAndStop(var a:Number)
// takes the playhead to the beginning of // the loop
play();
// set the loop/playhead into motion
onEnterFrame = function () {
if (_currentframe == nnnnn) {
// evaluates when the loop //has reached the userdefined //end of loop
oo.cla(jjjjj);
// becuase this is not a play reverse loop, we can // send the playhead back to the beginning of the loop // when the end of loop is reached.
if (rb1.selected) {
// this is continuous loop, no pause
play();
} else {
stop();
//if this is any // other type of // loop, it will stop // between // iterations
}
}
if (rb2.selected) {
// if the 'pause' radio button is // selected
txt:String = new String(ps_txt.text);
// take the variable form the // input text field
rr:Number = parseFloat(txt);
// must keep the decimal from a greater degree of accuracy, hence float
if (isNaN(rr) || rr<0) {
// just in case there is nothing in the field or a negative number
rr = 1;
// it will be set equal to one second
}
qq = _global.sp(rr);
// method call to return the # of iterations a loop must // run to simulate the pause in seconds
cc = setInterval(_global.ps(qq), 17);
// sets the interval for calling the pause method
aaa = true;
// when this variable is true, it activates code that will shut down the cc Interval
}
if (rb1.selected || rb3.selected) {
if (aaa) {
// using aaa in this way will reduce the # // of times this clear interval is called to // only those times when the setInterval // has been called
aaa = false;
clearInterval(cc);
}
}
};
}
}
};

Key.addListener(re);

Maybe I could send you an email with the file .fla minus the embedded video(otherwise the file size is 13mb, which I can only send 10mb right now).

thank you for your time!!

Playing Another Swf After One Finishes Playing
Hello.

My question is: how can I play an swf after the first one finishes playing?

I know I can do a load movie, but I don't have access to the first swf (or fla) that I'm loading first to add the code in the last frame to load the next. I hope this makes sense. ;/

Can I use an event handler? how?

Thanks1

Mac IE Playing Flash Is Inconsistent With PC IE Playing Flash?
Guys,

My supervisor has informed me that he has read somewhere that IE in mac is inconsistent in playing Flash objects (and its scripts, Actionscript or otherwise) with IE in PC. Is this issue discussed or listed somewhere? Please help.

Thanks


biggie


The Man of Tomorrow is forged by his battles today.

PRELOADING A MC...is It Same As Preloading A Swf
i have a site where i want to load closer shots of thumbnails and i have the close shot in a MC with a frame infront of it that has it preload it..

my question is that i dont want my whole site to wait for those images to load....

i want my site to stream and then preload the MC if they want to see close ups....

am i doing this right!?

thanks in advanced,
mannyme80

Preloading Swf's
I have a movie which contains two external swfs. I want the whole site to preload. At the moment my preloader only affects the initial movie, how can i preload the swfs and have them recognised by my preloader as well as the main movie.

Thanks

Preloading A MC
Hi! I want to preload a MC, and once it has done this i want it to jump to the next frame, so that the movie continue to plays.
I have got the movie clip to load into a target which is in the first frame, so i want it to jump to the next frame once it has loaded.
If anyone can help i would be much happy!

cheers

Preloading A .swf
im wondering how u preload an external .swf file ?

i got an interface with buttons, and when u press any of the buttons it will call another .swf file that plays an animation of a door closing.

now i want the next .swf to be preloaded at the backside off the door while its closed. after the preloading is complete i want the doors to open and have the preloaded .swf visible.

the door is at "level 10" and i have the other .swf clips at "level 9"

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