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








MovieClip Loader


Hi beloved AS Gurus,


I have a quick question regarding the MovieClip Loader Class.

Is it possible to use the same MovieClip Loader to load multiple clip at the same time. The code I'm thinking of would look something like this :


ActionScript Code:
var mcLoader:MovieClipLoader = new MovieClipLoader();

for(i=0 ; i<10 ; i++){
         mcLoader.loadClip("myjpg"+i+".jpg", eval("mc"+i));
}

mmm now that I look at it AI suppose that wouldn't be very useful... So then would it be possible to dynamically create various mcLoaders on the fly ?




ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 12-14-2006, 09:35 AM


View Complete Forum Thread with Replies

Sponsored Links:

Loader In A Movieclip?
Hi
I've had problem searching with my querys on this site so I'll ask instead.

I have about 250 pictures in a flashfile... now since I've got so many pictures it will take a while for the average wiever to go through all of them.
What I want to do is a kind of loaderbar on one side with percentage and I want it to to keep on counting while I look at the pictures until it reaches 100%.
Is it possible to have a movieclip inside the scene which is using the getBytesLoaded(); ?

I have a problem to check my loader 'cus I have a really fast connection... (even though my file is 8mb large and I throw away the .swf file in temporary internet file directory)

thanks
Rob

View Replies !    View Related
Loader Or Movieclip?
Ok it took me ages to do this. I got my swf loading into a Loader component, and the loadbar loads it into the loader. Works nicely. But ive lost the interaction with the swf inside the loader. This is due to levels.

I am presuming i can't asign the level of the swf inside the loader? But i can if i load the swf into a movieclip?

I'm hoping this isn't the case, because i can't use a loadBar with a movieclip and swf inside it, well i couldn't do it anyway.

Please help and avice

View Replies !    View Related
Movieclip Loader In AS3
hi,
i have a question
i download flash as3 demo version today
i already use flash mx 8 , and have to many projects and components for Macromedia Flash MX 8 Professional.
so i test Flash CS3 . this is very great..
so i know that i can use my Flash 8 FLA (AS2) sources in FlashCS3 (AS3).
but , i can not use AS2 and AS3 OR Flash 8 Component and Flash CS3 Components together !
so i have a question , that : can i load an Flash8 ( AS2 ) with MovieClipLoader in AS3... ?!
( load old swf in new swf )!

View Replies !    View Related
Loader To A MovieClip
I am pre loading images from an XML file in AS3 and then displaying them later. First I loop through the XML to get the images and then load them into a movieclip. Later when i make the swf image ive loaded visable i want it to play. The problem I'm having is that when i try to tell the swf to play by using the getChildByName its telling me it can't play because its a loader and not a movieclip. How can i convert this loaded swf to the movieclip it should be so i can tell the swf to play??!? Im all out of ideas.

where i grab the images, load them and name them:
var numImages = xmlData.content.*.image.length();
var sceneArray = new Array();
var imageArray = new Array();
var imageHolder = new Array();
var i;
for (i=0; i<numImages; i++) {
imageArray = xmlData.content.*.image.text();
sceneArray = xmlData.content.*.image.@s;
imageHolder = new MovieClip();
var theScene = new Loader();
theScene.load(new URLRequest(imageArray[i]));
imageHolder[sceneArray[i]] = theScene;
imageSpot.addChild(imageHolder[sceneArray[i]]);
imageHolder[sceneArray[i]].alpha = 0;
imageHolder[sceneArray[i]].name = "scene" + sceneArray[i];
}

where i try to make it play:

if (imageSpot.getChildByName("scene14") != null) {
imageSpot.getChildByName("scene14").alpha = 1;
MovieClip(imageSpot.getChildByName("scene14")).pla y();
fade:Tween;
fade = new Tween(imageSpot,"alpha",None.easeNone,0,1,1,true);
}

PLEASE SOMEONE HELP!! thanks.

View Replies !    View Related
Still MovieClip Loader
Hello,

I am trying to make a movieclip loader that has the fallowing functions.
Think that you loaded an image to an container, and you want to load another image.
Normally when you click a button to load, the preloaded image disappears and thhe preloader starts to count and when it reaches 100 percent you see the new image. I want to do is, during the loading process I want the image to stay and after 100% percent loaded, previous one disapperas wnd we see the new one.
I tried the fallowing:


Code:
function loadScene(scene:String, target:MovieClip) { //LoadScene+
trace("LoadScene Called");
target.bar._visible = false;
target.container._x = 100;
target.container._y = 0;
target.my_mc = new MovieClipLoader();
target.preload = new Object();
target.my_mc.addListener(target.preload);
target.preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
target.container._alpha = 0;
target.bar._visible = true;
duplicateMovieClip(target.container, "container2", target.getNextHighestDepth());
target.container2.loadMovie(scene+".jpg");
target.bar._alpha = 80;
target.pText._visible = true;
};


target.preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
target.container._alpha = 0;
target.bar._width = (lBytes/tBytes)*600;
target.pText.text = "% "+Math.round((lBytes/tBytes)*100);
};
target.preload.onLoadComplete = function(targetMC) {
target.container.fadeIn();
target.pText._visible = false;
target.bar._visible = false;
trace(targetMC+" finished");
removeMovieClip(target.container2);
};
_root.yScale(target.bar, _root.wh[scene]);
_root.yScale(target.mc_containerbg, _root.wh[scene]);
target.my_mc.loadClip(scene+".jpg", target.container);

} //loadScene-

View Replies !    View Related
MovieClip Loader
Hi guys...

How can I go about testing if there is a movieclip loaded into a "holder" MC on the stage?

The basic principle is I have a few buttons on the stage...2 of which cause different external swfs to load into a "holder" MC. Now, when you click away from that certain page, I'd like to play an "out" animation...

but of course, no point in playing the out animation if there is nothing loaded into the holders.

I'm loading the external swfs via the MovieClipLoader class, if that matters.

Thanks.

View Replies !    View Related
MovieClip Loader Question
Hi,
I am using movieclip loader to know when clips are loaded so that I can pass variables to them etc.
But the problem I am having is that when I want to load new clips, how do I test when THEY are loaded, so I can pass variables to them also?
I thought I could just add a new onLoadInit function underneath, but if I do that...then the original clips that load take their variables from the new onLoadInit function and not the old one.
Thanks
Ross

View Replies !    View Related
[F8] Useing A Movieclip For A Loader
I need to know how make a loader that translate the bits loaded in to moving a movieclip along it’s time line. Let me explain if the movieclip had 100 frames and the flash is half loaded he movie clip would be at frame 50.

Thanks

View Replies !    View Related
[F8] Useing A Movieclip For A Loader
I need to know how make a loader that translate the bits loaded in to moving a movieclip along it’s time line. Let me explain if the movieclip had 100 frames and the flash is half loaded he movie clip would be at frame 50.

Thanks

View Replies !    View Related
[F8] MovieClip Loader Seems To Crash IE
Guy's I've a funny problem, I've just changed all our code in our projects to loadClip() from loadMovie() so I can test for errors etc. fine

But now IE crashes 99% of the time on a slow connection while something is loading and you close the window. bam crash, not flash but IE

Anyone help or any ideas??

View Replies !    View Related
Random Movieclip Loader
Alright so I'll just get down to it. I have created 2 different movie clips in my flash file that I've given an instance name of "clip1" and "clip2". I'm trying to have them load in the blank "mcHolder" movieclip I've created and placed into scene1. I have one frame on Scene1 and 4 primary layers that are in this order:

1) actions layer
2) mcHolder mask (888px X 257px) set to view layer as an outline
2) mcHolder layer
3) background layer

I have stop(); at the end of both individual movie clips so they will stop. What I am ultimately trying to achieve is have the two different clips load randomly when the web page is loaded with the embedded .swf file in the webpage. Each time the page refreshes, the flash banner loads its random clip (even though there are only two). Appreciate an help!



Chris

View Replies !    View Related
Movieclip Loader OnLoadError
hi i have movieclip preloader with onLoadError function :

function onLoadError(mc:MovieClip, errorCode:String, httpStatus:Number) {
error_display = "Error: " + errorCode + " httpStatus: " + httpStatus;
}

error_display is dynamic text variable to show the error.when i try to load a.swf i got these error msg
Error: LoadNeverCompleted httpStatus:200

did anybody know what httpstatus 200 mean ? and how to handle this error so the swf can completly loaded. is it the problem on my a.swf(the file that being loaded) ?
any response will be very appreciated,thanks before

View Replies !    View Related
PreLoader And MovieClip Loader
For some reson my preloader and my MovieClipLoader won't work together.

When they are together (on difrent senes) when the preloader is done loading it goes to the main content but stays at the movie clip loader screen and none of the external files loads and the btns dont work.

heres the code for my movie clip loader

Code:
//-----------Initialization---------\
myLoader.contentPath = "main"
extLoader_mc._visible = false;
var currentPage;
stick("gh_mc");
//-----------------------------------\


//--------Movie Clip Loader----------\
var mcLoader:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
mcLoader.addListener(myListener);

myListener.onLoadProgress = function(target_mc,bytesLoaded,bytesTotal) {
extLoader_mc._visible = true;
var pctLoaded = Math.round(bytesLoaded/bytesTotal*100);
extLoader_mc.extLoaderBar_mc._xscale = pctLoaded;
if (bytesLoaded > = bytesTotal) {
extLoader_mc._visible = false;
}
}
mcLoader.loadClip("main.swf",myLoader);
//-----------------------------------\
heres the code for my preloader
Code:
stop();

var yChange = 130;
var yStart = 450;

myInterval = setInterval (preload,100);

function preload() {
var current = _root.getBytesLoaded();
var total = _root.getBytesTotal()
var pctLoaded = Math.round(current/total*100);
mask_mc._y = yStart - yChange/100*pctLoaded;

if (current >= total) {
gotoAndStop("site",1);
clearInterval(myInterval) ;
}
}

View Replies !    View Related
Access A Movieclip From Loader
Hi guys,

guess this is pretty simple just that I googled and do not have any luck. hope any of you can help. thanks in advance.

i have 2 swf: flash1.swf and flash2.swf.

there are 2 movie clip in flash2.swf: mc1 and mc2

I have to use flash1.swf to load flash2.swf dynamically using loader class.

my question:

how do I only make mc1 within flash2.swf to have a button function dynamically??

I know if I want to make the whole flash2.swf to become button I just have to:


Code:
var _loader2:Loader = new Loader( );

addChild( _loader2 );

_loader2.load( new URLRequest( "flash2.swf" ) );

_loader2.addEventListener( MouseEvent.CLICK, someFunc );
but I just cannot do this:

Code:
_loader2.mc1.addEventListener( MouseEvent.CLICK, someFunc );
anyone any idea??

thanks!

View Replies !    View Related
Converting Loader To MovieClip
Hi Guys,

I am able to load an image on to the screen with the following code:


ActionScript Code:
var imageLoader:Loader = new Loader();

imageLoader.load(new URLRequest("images/test.jpg"));
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageComplete);
           
function imageComplete(evt:Event):void {
  addChild(imageLoader);
}

However I need to convert this image to a MovieClip and have tried by casting with the following code:


ActionScript Code:
var tempMovieClip:MovieClip = new MovieClip();
tempMovieClip = imageLoader.content;

I get the error: 1118: Implicit coercion...

Any help or suggestions would be greatly appreciated. Cheers.

View Replies !    View Related
Movieclip Loader / Player
Hello everyone,

I'm a noobie and am trying to create some sort of player.
This is the problem.

I want to load in swf files and play them 1 by 1. So if the first movieclip has finished playing, then te second had to begin playing.

I managed to load the files in my "masterplayer", but can't figure a way to play the second when the previous has finished.

Please help me,

Thanx in advance

View Replies !    View Related
PLEASE HELP With Movieclip Loader And Unload MC
I have a site that has some buttons that load an MC inside this MC is a button MC that loads an external SWF. Inside this SWF I have a close button and when you click close it runs to last frame which has this code:
stop();
_root.holder.unloadMovie();

The SWF will not unload. I guess because it's inside MC that's inside another MC so i'm not sure if this should have level in the unload code?
Here is a screen of my site setup:
http://img442.imageshack.us/img442/6500/popupsc4.jpg

View Replies !    View Related
MovieClip Loader Class
Is the MovieClip Loader class still available in CS3 or is there another way to do this?

View Replies !    View Related
Please Help On The Loader.content To Movieclip
Hello there,
I have been search around and got some mixed solutions, summarized as follow:
If I need to load external swf into the main swf file, I need to Loader with appropriate URLRequest for this purpose.
After loaded, you can listen to the complete event and addChild the loader.content to the main swf.
Because I have a stop on the loaded swf first frame, I need to start the swf with a button. Some solutions on the net pointed that to make this happened, you need to cast the loader.content to MovieClip and have to through a tricky way to accomplish it like

var movie:*=loader.content ;
var clip:MovieClip=movie;
clip.gotoAndPlay(4);
.....
I tried this method and still got Type Coercion failed ::cannot convert flash.display to MovieClip
Please help, don't know why some experts said it is working while I can not get it to work. Thanks in advance

View Replies !    View Related
From Loader To Movieclip And Other Content
Hello all!

I wonder if someone knows about this.
I have an XML-file which holds some info about picture and text.

A designer have made some mc's and I have to load the pictures (which has URL from XML) into this mc-animation.
I can only load the images into the loader and then I'm totally lost, I cant get the image from the loader in memory into the animated timeline mc. Any clue to how this is done? I have tried addChild but this doesnt help me attach the loaded picture to the anim_mc. or...?

The designer also have a textlayer, which is put in a mc and then animated. And the text from XML must go into the textfield and be animated.

any hint would be very appreciated. There must be some kind of command I don't know or have overlooked.

//Thanks
Peter

View Replies !    View Related
Prob With MovieClip Loader()
hi,

I am trying to load 2 swf in my master.swf via MovieClipLoader class, one is "image.swf" and other is "line.swf".The prob is that its loading "image.swf" but not line.swf.
As I want line.swf to appear after image.swf i placed it on frame 10.

here's my code:on Frame 1

stop();
var myMovieMCL:MovieClipLoader = new MovieClipLoader();
myMovieMCL.loadClip("imageTransition.swf", 1);


//here the code on frame 10
stop();
var mclListener:Object = new Object();

myMovieMCL.loadClip("line.swf", 5);
mclListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("ERROR!");
}
myMovieMCL.addListener(mclListener);

whats the prob? i checked from bandwidth profiler its not even entering the 10 frame.Why ?,

thanks

View Replies !    View Related
MovieClip Loader Code
Hi everbody,

I created a simple loader and converted it to a component.
I can place it in a timeline, and in the actions layer write this code:


Code:
this.onMouseUp=function(){
loader_mc.the_mcl.loadClip("image.jpg", loader_mc._parent.holder_mc);
}
But if I try to do the same without the onMouseUp, as below, it does not work:


Code:
loader_mc.the_mcl.loadClip("image.jpg", loader_mc._parent.holder_mc);
I am using a MovieClipLoader object inside the loader.

Could anyone please help me figuring out what I amsoing wrong?
Thanks

View Replies !    View Related
Movieclip Holder With Pre-loader
Hi guys.

I am using the kirupa preloader tutorial (http://www.kirupa.com/developer/mx/p...epreloader.htm) and everything is fine and dandy. But as soon as the preloader is used on movie that is loaded from an external swf into a movieclip holder the preloader does not work.

Would any of you know if there is something obvious that would cause this to happen?

Thanks - A.

View Replies !    View Related
Loader Component Vs MovieClip
Hi,
Using the MovieClipLoader class, what is the difference between loading the external files into a Loader Component or into an empty movie clip. Will one be quicker? They both worked for me, but I've read using the Loader Component is better. Can anyone confirm this? I would think that avoiding components would make things faster/less file size.

View Replies !    View Related
Convert Loader Into MovieClip
It probably has a simple answer but i can't figure it out, i've googled a ton.



Quote:




var imageLoader:Loader = new Loader();
var image:URLRequest = new URLRequest((location.text()[+t]));
imageLoader.load(image);
addChild (imageLoader);





When i trace it it says "object loader" and i can't manage depth with a loader object (i don't think)

or am i going to have to use another movieclip to contain it

Throws an implicity coersion error if i try to use this code


Quote:




setChildIndex(event.target,numChildren - 1);

View Replies !    View Related
Movieclip Loader And Masking .PNG
Someone please help. I'm about to put my head through the monitor. I am importing images with transparent backgrounds and I"m trying to mask them against a certain color background which I can change to other colors giving the image the appearance of changing colors.

In other words, I just want the outlines of the imported images to be visible against the background. I've used my movieclip loader and my setMask() however you can see a square image instead of the curves and corners of the visible image. How can I get around this? How can I get Flash to ignore the alpha transparent part of the image?

Home that makes sense. Any help would be greatly appreciated. Thanks.

Bo

View Replies !    View Related
Help With Random MovieClip Loader?
Hi Guy's, Gal's and Other's...My question is I want to load a different movie clip's when the site load...

When the site fist loads

Code:
_root.mc_EmptyTrunk.loadMovie("./Flash/mc_Trunk.swf");
stop();
Trunk loads then from the trunk

Code:
_root.mc_EmptyLogo.loadMovie("./Flash/mc_Logo.swf");
stop();
The Logo loads

I want to load a random clip in before it loads the Logo...
say 7 or 8 different clips into "_root.mc_EmptyRandom"
how do i even start this?

Thanx,
Babalou

View Replies !    View Related
Load Bar With MovieClip Loader
I'm trying to create a load bar for this preloader . Here's the code:

var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var con:MovieClipLoader = new MovieClipLoader();
var conL:Object= new Object();

conL.onLoadProgress=function(target,loaded,total){
percent.text=Math.round((loaded/total)*100) + "%";
}

conL.onLoadInit= function(){
loader.visible=false;
percent.text="";
}
con.addListener(conL);
con.loadClip("bimmer.swf",container);

The preloader works perfectly, but I need a load bar ; can anybody add the line of code that would be grand....

View Replies !    View Related
Movieclip Loader Class
I'm having issues with a few things. First, is it better to preload an external swf on the main timeline, or the external swf timeline (If you want to transition in and out of pages)? I've been looking for an answer to that questions for days!! Second, I put together a website and I have three separate containers to load swf's into (container_1, container_2, & container_3) in my main movie. Container_1 & container_2 load simultaneously on 3 button events, container_3 is the same but 2 button events & on a higher level. I'm having a great deal of trouble trying to figure out how to go about preloading these containers, and secondly, transitioning the loaded swf's. I think I've worn out google with this search because everytime I go there now it just gives me the finger!

View Replies !    View Related
Frame Loader Using MovieClip/Mask?
Hey all, this is my first post here. I been studyin and readin up on all the tuts here and they have helped an incredible amount...i have a question though...i want to make a frame loader where a movie clip will slide a square down over a section of my scene, while it is closed, it will load the frame i need, then, when it is loaded the square will slide up revealing the new frame... i saw this done at www.rosscopperman.com and i really like the way they did that? I hope this makes sense, i been tryin to figure it out for a coupe days now and i just cant seem to get it.
If anyone can help me out, id appreciate it
thanks
jim

View Replies !    View Related
Movieclip Loader Destroying Game
Hey guys, hope you can help me on this one I need to create a single flash movie that will then load up another flash file (a game)

Now I have the flash loader working great, I pass the filename to it and it loads up the correct game, however there is one small problem (well not really small big but anyways) you cant use the keyboard to control the game anymore

I have tried searching for a fix to this but everywhere tells me to put the keyboard functions into the flash loader itself and that isn't an option as the flash loader file will be loading up multiple different games depending on what the users wants to view.

So my question is this... How can I get my event listeners working again.

Thanks in advance!

Code:
stop();

var myMCL = new MovieClipLoader();//create an instance of MovieClipLoader
myMCL.onLoadStart = function (targetMC)
{
var loadProgress = myMCL.getProgress(targetMC);
}
myMCL.onLoadProgress = function (targetMC, loadedBytes, totalBytes) {
}
myMCL.onLoadComplete = function (targetMC)
{
var loadProgress = myMCL.getProgress(targetMC);
}
myMCL.onLoadInit = function (targetMC)
{
}
myMCL.onLoadError = function (targetMC, errorCode)
{
}

myMCL.loadClip("http://www.theurl.com/swf/theswf.swf", "thegame");


Thats the preloader, as you can see it stays on the single frame so any ideas?

View Replies !    View Related
Re-using Loader To Load More Then 1 Movieclip Dynamically
Hi,

I want to create a very simple movie which has a stage of 800x400.
On that movie I have 1 movieclip called "flashClip" and 2 buttons named "myButton1" and "myButton2"
I want my movie to load the external file eekhoorn.swf into my movieclip when I press "myButton1" and eekhoorn2.swf when I press "myButton2".
And the code below also WORKS !


myButton1.addEventListener(MouseEvent.CLICK,button 1Pressed);
myButton2.addEventListener(MouseEvent.CLICK,button 2Pressed);

var loader:Loader = new Loader();
flashClip.addChild(loader);

function button1Pressed(evt:Event) {
loader.load(new URLRequest('eekhoorn.swf'));
}
function button2Pressed(evt:Event) {
loader.load(new URLRequest('eekhoorn2.swf'));
}



But, I only want 1 of the 2 flash movies to play inside of my movieclip container. If you now press myButton1 , wait 5 seconds and press myButton2, then I can clearly hear that both eekhoorn.swf and eekhoorn2.swf are playing, while in fact only the last one clicked should play.

It looks like my loader object loads EXTRA data when you click, but it also keeps the old data which was still in it.
Eekhoorn.swf is around 3Mb here on my harddrive, and I allready tried clicking 100 times on the buttons and really saw my memory usage grow by 300Mb.



Is there a nice way to be able to load different swf files into a movieclip one after the other (so not together) ?


Kind regards,

Thanks for any help,


Bart

View Replies !    View Related
Loader Object Reference From MovieClip
Good afternoon coders. I'm trying to reference a loader Object on the maintime line from within a MovieClip. More clearly, when I press one of my buttons (myCars or myVideos) I need my transition movieclip named container to play. Once the movieclip reaches a particular frame, I need the code in that frame to run.


First, here's the code on the main timeline:


import flash.display.*;


var my_loader:Loader = new Loader();
addChild(my_loader);

var container:blue=new blue();
container.name = "myContainer";
container.x=10.0;
container.y=74.0;
this.addChild(container);


var lastLoaded:String;

myVideos.addEventListener(MouseEvent.MOUSE_DOWN, loadTheBaby);
myCars.addEventListener(MouseEvent.MOUSE_DOWN, loadTheCars);


function loadTheBaby (e:MouseEvent):void{
if(e.currentTarget.name !=lastLoaded){
lastLoaded=e.currentTarget.name;
container.gotoAndPlay("motivate");

}
}

function loadTheCars (e:MouseEvent):void{
if(e.currentTarget.name !=lastLoaded){
lastLoaded=e.currentTarget.name;
container.gotoAndPlay("motivate");

}
}

Now, here's the code I need to run when the movieclip named container reaches a certain frame:

stop();

//lastLoaded=e.currentTarget.name;
my_loader.load(new URLRequest(lastLoaded+".swf"));
my_loader.contentLoaderInfo.addEventListener(Progr essEvent.PROGRESS, loop);
my_loader.contentLoaderInfo.addEventListener(Event .COMPLETE, done);

function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(my_loader);
gotoAndPlay("closeup");
}



Here are the error messages:


1120: Access of undefined property my_loader.
1120: Access of undefined property lastLoaded.


the variable lastLoaded is on the main timeline, and the loader Object my_loader is also on the main timeline. So, I believe I need to reference the loader Object and the lastLoaded variable on the main timeline from within a movieclip. I tried root.my_loader; I tried parent.my_loader to no avail. I even tried to put the loader object and the lastLoaded var in the movieclip and ran into a laundry list of errors. Is there a new way to access objects and variables on the main timeline from within a movieclip? Please steer me in the right diirection. Thanks for reading.


xFLASHSTUDENTx

View Replies !    View Related
Loading Movieclip From The Flash Itself As A Loader
I need a preloading movieclip when i click on the shuffle_btn. I want the movieclip to play for one second and display the movie on the screen. Its a simple question but i dint get any idea how to do this. can anyone help me? I just wanna load an animation when user clicks shuffle_btn button in my code below. I have the 1 sec mc ready with me. I tried _visible and setInterval, but in vain. can anyone help meout??



Code:
stop();
//loading videos and pictures from the respective folders
//random function to generate two random numbers, for the shuffle program
space._visible = true;
vid.contentPath = "C:/RANDOM/VIDEOS/vid1.flv";
pic.contentPath = "C:/RANDOM/IMAGES/pic1.gif";
shuffle_btn.onRelease = function() {
this.space.loadScreen.gotoAndPlay("start");
var num1:Number = Math.round(Math.random()*4);
var num2:Number = Math.round(Math.random()*4);
trace(num1);
trace(num2);
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
vid.contentPath = "C:/RANDOM/VIDEOS/vid"+num1+".flv";
pic.contentPath = "C:/RANDOM/IMAGES/pic"+num2+".gif";
trace(vid.contentPath);
trace(pic.contentPath);
};
play_btn.onRelease = function() {
//var count: Number = 0;
vid.play();
};
stoop.onRelease = function() {
vid.stop();
};

Regards and thanks in advance....

Roshan kolar

View Replies !    View Related
Loader - Do They Effect Movieclip Playback?
Hey Guys,

I'm just curious to find out if there is some sort of limit to the number of loaders you can have loading at one time. As with my current code it seems to disrupt the playback of my movie clip although there are no significant hikes in cpu usage at all when this is occuring.

What i'm try to do is build a preloader that will load all my thumbnails for buttons and the thumbnails for my sub gallery prior to displaying a gallery page.

I can have any number of thumb buttons (100 +) if i want and each of those buttons will have at most 36 thumbnails for that subgallery. The loading of the images for the thumbnails is fine but when i fire them off for my subgallery thumb images, i run into the problem. I fire the loading off in a for loop and am trying to keep track of the load progress so i can display the percentage loaded on the screen.

This is proving quite challenging since i never know how many images for the thumb buttons or how many images for each sub gallery there are. What i've implemented so far is a system that upon loading an xml file in but before loading the page...i have a general function which is called the minute one of the loaders has a ProgressEvent fired. The problem i've isolated is that the load call


Code:
current_loader.load(new URLRequest(itemToLoad));
causes my preloading movieclip (its a looping animation) to halt or play slower than it should (almost as if its out of memory or something).

Does anyone have any ideas what might becausing this? Or perhaps a solution? My best guess was possibly i've got too many loaders loading at one time? But how else do i avoid this and still keep tracking of the num of bytes loaded?

cheers for any help!
stace

View Replies !    View Related
Quick Movieclip Loader Question
I need to preload dynamic jpeg thumbnails, do I use the movieclip loader class to do this? Does this produce the same results as a standard preloader, ie. load bar, % loaded etc. ?

Thanks

View Replies !    View Related
Stream Sound And MovieClip Loader
Simple question for experienced Actionscripters:
I have a moviclip (pics_mc) with a long amount of pics transitions which have to be synced with an mp3 sound located in separated layer in the maintimeline.

This swf file, when published, it's going to be loaded into my main Flash app via MovieClipLoader (in order to download it ENTIRELY before playing it).
Question is:
If I set my MP3 song in (pics_mc) as Stream in the property panel (instead of event), will the size of the Mp3 be included in the totalBytes in the onProgress Listener of the MovieclipLoader that loads the swf? or, on the contrary, as It is a streaming sound the totalBytes include everything, but the streaming sounds?

Thanks in advance to everybody for your replies :)

View Replies !    View Related
Reusable MovieClip Loader Question
Why is that when I change the paths of my external files(file.swf) that the preloader doesn't show up? It only shows up when the external files are loaded from a web address.

Thanks in advance.

View Replies !    View Related
Making A External Movieclip Loader ?
How do I put a global loader into this code, so that it loads every movieclip before it shows, so that the user wont wonder why the sections is not showing upp until 20 seconds after the click.... ?


Code:
getSwf.loadMovie("Startsida.swf");

this.btnLunch.onRelease = btnLunchRelease;
this.btnMiddag.onRelease = btnMiddagRelease;
this.btnBestall.onRelease = btnBestallRelease;
this.btnInfo.onRelease = btnInfoRelease;
this.btnKarta.onRelease = btnKartaRelease;
this.btnCatering.onRelease = btnCateringRelease;

function btnLunchRelease() {
getSwf.loadMovie("Startsida.swf");
}
function btnMiddagRelease() {
getSwf.loadMovie("Startsida.swf");
}
function btnBestallRelease() {
getSwf.loadMovie("Startsida.swf");
}
function btnKartaRelease() {
getSwf.loadMovie("Startsida.swf");
}
function btnInfoRelease() {
getSwf.loadMovie("Startsida.swf");
}
function btnCateringRelease() {
getSwf.loadMovie("Startsida.swf");
}
And.. anyknow know how to maybe simplify this code ?

Kissies!

View Replies !    View Related
Question: MovieClip Loader Class?
Is it possible to load a mc using the movie clip loader class then tween it to slide into a specific location and point on the time line?

Nevermind...it's working now.

View Replies !    View Related
Passing Variables From Loader/movieclip To Another
Lets say i have one movieclip, on click, i would like to pass some information (such as its id or name) to another movieclip/loader. How do i do that? I need to do that? This is because the movie clip to be clicked displays images dynamically and so its id is not constant.

Hmm. I think i am phrasing this question in a very confusing way..

View Replies !    View Related
Image Loader To Movieclip From Extern .as
Hi all!

I'm new here at Kirupa and also pretty noob when it comes to AS3.

I'm working on a slideshowproject (like all newbees do!) and I'm stuck trying to load an image into a movieclip.

I have my loader in a class called "Image.as" and by doing some traces I can see it works fine. But when i try to send the image to the movieclip (which I have named "_mc") I have on the stage I just get the "Acces of undifined property _mc". What am I missing? After the file has loaded from the Internet the Image.as calls the function imageLoaded:


Code:
function imageLoaded(e:Event):void {
//Load billedet
_mc.addChild(pictLdr);
trace("If you see this, the file has loaded correctly.");
}
In my .fla I have done this to add the empty movieclip to the stage:

Code:
var _mc:MovieClip = new MovieClip;
//Add _mc to stage
addChild(_mc);
_mc.width = 550;
_mc.height = 400;

var imageloader:Image = new Image;
I think I'm too old to learn anything new! Been stuck for days!

If you need to see all of the code I can copy/paste it. It's not that large.

View Replies !    View Related
MovieClip Loader Displays Only On One Frame
Hi Everybody.

I have wriiten a code on Frame1 to load an image in a MovieCLip(already on Stage). Now that's only visible in Frame1, if i goto some other frame example-5 and use "insert Keyframe" or "Insert Blank Keyframe" it shows me nothing inside the Movie Clip.
But when i copy the code from Frame 1 then it shows the image inside at Frame where the code has been copied.

So is it limited to only 1 frame in which ActionCode is there? Or how do i tell that keep displaying image inside the MovieClip.

Thanks.

View Replies !    View Related
Movieclip Loader Woes. Cant Get It To Work
Trying to get this Movieclip loader to work but all I get is:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 5: There is no property with the name 'onLoadStart'.
adloader.onLoadStart = function(targetMC) {

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 12: There is no property with the name 'onLoadComplete'.
adloader.onLoadComplete = function(targetMC) {

Total ActionScript Errors: 2 Reported Errors: 2

What am I doing wrong?


ActionScript Code:
var adloader:MovieClipLoader = new MovieClipLoader();
//
adloader.loadClip("scorptest.swf", "header_mc");
//
adloader.onLoadStart = function(targetMC) {
    var loadProgress:Object = adloader.getProgress(targetMC);
    var loaded:Number = loadProgress.bytesLoaded;
    var total:Number = loadProgress.bytesTotal;
    adprogress_txt.text = loaded+" of "+total+" bytes loaded";
};
//
adloader.onLoadComplete = function(targetMC) {
    adprogress_txt.text = "";
};

View Replies !    View Related
Set Alpha To MovieClip That Receive Loader
Well i have one problem when i addChild a Loader into a MovieClip and when the Loader Complete i need set an Alpha to this Movieclip. I tryed use e.target.parent or e.currentTarget.parent but is no permitted to LoaderInfo Object.

Bellow the code:
Code:

var pictList:Loader = new Loader();
pictList.load(new URLRequest(listResp.categorias[pi].vitrine));
pictList.contentLoaderInfo.addEventListener(Event.COMPLETE, showPicList);
proc.picture.alpha = 0;
proc.picture.addChild(pictList);

function showPicList(e:Event):void
{
   trace(e.currentTarget.parent);
   // (e.currentTarget.parent as MovieClip).alpha = 1;
}

If anyone have some idea please help me.
Thanks in advance.
XD

View Replies !    View Related
Loader Object Reference From MovieClip
Good afternoon coders. I'm trying to reference a loader Object on the maintime line from within a MovieClip. More clearly, when I press one of my buttons (myCars or myVideos) I need my transition movieclip named container to play. Once the movieclip reaches a particular frame, I need the code in that frame to run.


First, here's the code on the main timeline:


import flash.display.*;


var my_loader:Loader = new Loader();
addChild(my_loader);

var container:blue=new blue();
container.name = "myContainer";
container.x=10.0;
container.y=74.0;
this.addChild(container);


var lastLoaded:String;

myVideos.addEventListener(MouseEvent.MOUSE_DOWN, loadTheBaby);
myCars.addEventListener(MouseEvent.MOUSE_DOWN, loadTheCars);


function loadTheBaby (e:MouseEvent):void{
if(e.currentTarget.name !=lastLoaded){
lastLoaded=e.currentTarget.name;
container.gotoAndPlay("motivate");

}
}

function loadTheCars (e:MouseEvent):void{
if(e.currentTarget.name !=lastLoaded){
lastLoaded=e.currentTarget.name;
container.gotoAndPlay("motivate");

}
}

Now, here's the code I need to run when the movieclip named container reaches a certain frame:

stop();

//lastLoaded=e.currentTarget.name;
my_loader.load(new URLRequest(lastLoaded+".swf"));
my_loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop);
my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, done);

function loop(e:ProgressEvent):void
{
var perc:Number = e.bytesLoaded / e.bytesTotal;
percent.text = Math.ceil(perc*100).toString();
}

function done(e:Event):void
{
removeChildAt(0);
percent = null;
addChild(my_loader);
gotoAndPlay("closeup");
}



Here are the error messages:


1120: Access of undefined property my_loader.
1120: Access of undefined property lastLoaded.


the variable lastLoaded is on the main timeline, and the loader Object my_loader is also on the main timeline. So, I believe I need to reference the loader Object and the lastLoaded variable on the main timeline from within a movieclip. I tried root.my_loader; I tried parent.my_loader to no avail. I even tried to put the loader object and the lastLoaded var in the movieclip and ran into a laundry list of errors. Is there a new way to access objects and variables on the main timeline from within a movieclip? Please steer me in the right diirection. Thanks for reading.


xFLASHSTUDENTx

View Replies !    View Related
Loader For Dynamic Loading JPG In A Movieclip Or Level
how to get a loader for loading a jpeg file being loaded dynamically in a movie clip ..


a percent .. loader would be great ..

some help .. guide .. tip

thanx for reading this post

View Replies !    View Related
Movieclip Loader W/ Frame Based Preloader
I want to use the Movieclip Loader class and have a preloader that show it's progress based on a timeline animation. Can anyone show me a simple way to do this?


Code:
//MoiveClip Loader
function loadExt(movieName, targetMovie) {
var mcListener:Object = new Object();
mcListener.onLoadStart = function(target_mc:MovieClip) {
};
mcListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
// This is what I am not sure about?
progressBar_mc._currentFrame = (bytesLoaded/bytesTotal)*100;

};
mcListener.onLoadInit = function(target_mc:MovieClip) {
};
var image_mc:MovieClipLoader = new MovieClipLoader();
image_mc.addListener(mcListener);
image_mc.loadClip(movieName, targetMovie);
}

View Replies !    View Related
MovieClip Loader-Display Loaded Movies At Once
Hello,

What I am trying to do is to send multiple swfs, loading on diffrernt levels, to a movieclipLoader and have them all load or display at one time. As of right now, they display as they load.

Do I need to put some code in the onLoadComplete or onLoadProgress listeners to accomplish this?

Any help will be greatly appreciated.

View Replies !    View Related
Trouble With Loader Component Inside MovieClip..
I have an instance of a Loader component called imageLoader inside of a movieClip....

I attach the MovieClip to the stage dynamically using the following:


Code:
for(var i:Number = 0; i < 15; i++){
var depth:Number = this.getNextHighestDepth();
tiles[i] = this.attachMovie("mc2", "mc2" + depth, depth);
tiles[i].imageLoader.contentPath = "1_01.jpg";
tiles[i].onRelease = function(){
moveTile(this);
};
}
The problem I'm having is that


Code:
tiles[i].imageLoader.contentPath = "1_01.jpg";
doesn't load the image into the loader but when I set the content path of the loader (using parameters in the property inspector) I get the result I'm after.

Why doesn't the loader respond when I set it's content path dynamically?

Cheers.

View Replies !    View Related
Circle Preloader + Movieclip Loader Class = ?
I am trying to make a circle preloader, so i need to convert it to be frame based. Can one help me understand why this is not working?

Check it out: http://0-style.com/test/test.html
Zip with Fla: http://0-style.com/test.zip


Code:
function loadExtMov(movieName, targetMovie, transEnabled:Boolean) {
var mcListener:Object = new Object();
mcListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
status_txt.text = Math.round((bytesLoaded/bytesTotal)*100);
// Radius Preloader
frame = int(bytesLoaded/bytesTotal/100);
tellTarget (progress_mc) {
gotoAndStop(frame);
}
};
var image_mc:MovieClipLoader = new MovieClipLoader();
image_mc.addListener(mcListener);
image_mc.loadClip(movieName, targetMovie);
}
loadExtMov("1.jpg", container_mc);

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved