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




LoadClip



I'm loading jpgs into a gallery with loadClip.

Once loaded I can control the jpgs' _height, _width and _alpha properties but although the _x and _y properties trace as having changed, the jpeg does not move.

Here is my code:


Code:
//LOAD IMAGE///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

public function loadImage( i:Number):Void {

if( i !== undefined) {
currentImage = i;

}

moveThumbnails();

var imageLoader:MovieClipLoader = new MovieClipLoader;
var imageListener:Object = new Object;
imageLoader.addListener(imageListener);

imageListener.onLoadInit = Delegate.create(this, imageLoaded);

imageLoader.loadClip(imageArray[currentImage -1], galleryContainer.imageContainer_mc);
}

//ON IMAGE LOADED/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

private function imageLoaded(thisImage):Void {
thisImage._x = -100;
thisImage._alpha = 50;
thisImage._height = 250;
}
Thanks



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-09-2006, 08:15 PM


View Complete Forum Thread with Replies

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

LoadClip Help Please
hello,

i'm trying to load swf's into my movie but am experiencing strange stuff (movie not stopping on the frames i tell it to..)
if i use:code: on (release)
{
loadMovie("about.swf", "");
} shouldn't that load the swf into the top left corner of the root time line and replace the existing movie?

thanks because i'm getting pretty confused here!

- monkeybrainz

LoadClip()
Yoh yoh... I use the loadclip to load different jpgs to an mc just like a photogallery.

But when I use the _alpha on the mc,
it only works to set it to 0.

If I set it to 100 when it is loaded, the mc is visible at all time.
( even when it is loading ).

Anyone had similar problem ?

Is LoadClip AS2 Only?
does loadClip only work if your movie is exported using actionScript 2?

[F8] LoadClip
Is it possible to load multiple swf files into one empty movie clip on different depths then be able to switch between those depths. If so, can someone help me with the code?

Thanks,
~SC

LoadClip() Help
I have a loadClip function work fine locally, but when I upload the same exact files in the same folder and run off the server I get a URLNotFound error with the HTTPstatus = 0. Do I need to set some server configuration parameters or something?

BTW, I'm calling a relative path and the SWF is in the same folder as the JPG.

For example: loadClip("name.jpg", MC);

Thanks!

LoadClip
When I use loadClip for some reason...and this is where I need help...all the MCs within the loaded clip play...all the stop actions are ignored...help.

Using Loadclip On A Cd
I have created a flash presentation with extensive use of loadclip. Loadclip is pulling swf files from a swf folder. Works perfectly when testing it in the Flash. The problem is when I publish the swf files to html.

I am using swfobject to load the main movie, which in turns calls the external swfs. These external swfs are not loading. What url string do I need to use in loadclip so these external movies will play from a cd.

Here's is my index.html page.


Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>EERD Virtual Tour</title>
<link href="css/global.css" rel="stylesheet" type="text/css" />
<link href="css/main.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/swfobject.js"></script>
</head>

<body>
<div id="container" class="textSm black">
<div id="flashcontent">
</div>
<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("swf/mainEERDVT.swf", "EERD", "950", "620", "8", "#000000");
so.write("flashcontent");
// ]]>
</script>
</div>
</body>
</html>
Thanks, Tim

How To Use Loadclip
Hello,
I would like to know how to apply loadclip to the following code so when I click a thumbnail the selected JPEG thumbnail it will load with the transition effect. Thanks,
WonderWendy







Attach Code

import mx.transitions.*;
import mx.transitions.easing;

this.createEmptyMovieClip("image_mc", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
//do something
};
mclListener.onLoadComplete = function(target_mc:MovieClip) {
//do something
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
TransitionManager.start(target_mc,
{type:Blinds, direction:Transition.IN,
duration:2, easing:None.easeNone,
numStrips:10, dimension:0});
};
var image_mcl:MovieClipLoader = new MovieClipLoader();
image_mcl.addListener(mclListener);
image_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg", image_mc);

Using LoadClip With Xml
I am new to actionscript and I am using a tutorial I found to see what info I could bring in when you click on an icon.

The setup:

I have an xml file with tags defined. I am using a carosel tutorial, and when clicked the icon moves and then the other icons fade away and then dynamic text is displayed that is defined in the xml document. What I want to do is load a swf file. I have been successful loading one swf file, but it loads with all parent icons. I am using the loadClip parameter.

Action Script:

casey is the instance name of my holder object for my swf files, my error lies in the function released () section.









Attach Code

import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;

var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 130;
var home:MovieClip = this;
theText._alpha = 0;
casey._alpha = 0;

var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
var t = home.attachMovie("item","item"+i,i+1);
t.angle = i * ((Math.PI*2)/numOfItems);
t.onEnterFrame = mover;
t.toolText = nodes[i].attributes.tooltip;
t.content = nodes[i].attributes.content;
t.casey = nodes[i].attributes.casey;
t.icon.inner.loadMovie(nodes[i].attributes.image);
t.r.inner.loadMovie(nodes[i].attributes.image);
t.icon.onRollOver = over;
t.icon.onRollOut = out;
t.icon.onRelease = released;
}
}

function over()
{
//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sover");
sou.start();

home.tooltip.tipText.text = this._parent.toolText;
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}

function out()
{
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}

function released()
{
//added by casey for loading swfs
var mcl:MovieClipLoader = new MovieClipLoader()
mcl.loadClip("test.swf",casey)
//end of caseys code

//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();

home.tooltip._alpha = 0;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.xPos = t._x;
t.yPos = t._y;
t.theScale = t._xscale;
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
delete t.onEnterFrame;
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
var tw6:Tween = new Tween(casey,"_alpha",Strong.easeOut,0,100,1,true);
theText.text = t.content;
var s:Object = this;
tw.onMotionStopped = function()
{
s.onRelease = unReleased;
}
}
}
}

function unReleased()
{

//BONUS Section
var sou:Sound = new Sound();
sou.attachSound("sdown");
sou.start();

delete this.onRelease;
var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
var tw:Tween = new Tween(casey,"_alpha",Strong.easeOut,100,0,0.5,true);
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
if(t != this._parent)
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
}
else
{
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
tw.onMotionStopped = function()
{
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
t.onEnterFrame = mover;
}
}
}
}
}


function moveTip()
{
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height/2;
}

xml.load("icons.xml");

function mover()
{
this._x = Math.cos(this.angle) * radiusX + centerX;
this._y = Math.sin(this.angle) * radiusY + centerY;
var s = (this._y - perspective) /(centerY+radiusY-perspective);
this._xscale = this._yscale = s*100;
this.angle += this._parent.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
speed = (this._xmouse-centerX)/2500;
}[h]Text[/h][h]var tw:Tween = new Tween(casey,"_alpha",Strong.easeOut,100,0,0.5,true);[/h]

























Edited: 03/18/2007 at 03:32:29 PM by noobkc

LoadClip On PC Vs. MAC
Hi, I noticed that if I perform a LoadClip of an image, it works on a PC, but not on a MAC. Does anyone know why?

LoadClip For .png?
Hey Kirupians,


I've been using :

PHP Code:



my_mcl.loadClip(url:String, target:Object ) : Boolean 




for my .swf and .jpg loading, but it doesn't allow for .pngs to be accessed this way. I can't seem to find the right code to use for .png's.. anyone know?

Thanks

~ Lacuna

LoadClip For .png?
Hey Kirupians,


I've been using :

PHP Code:



my_mcl.loadClip(url:String, target:Object ) : Boolean 




for my .swf and .jpg loading, but it doesn't allow for .pngs to be accessed this way. I can't seem to find the right code to use for .png's.. anyone know?

Thanks

~ Lacuna

LoadClip()
i'm use this code:

ActionScript Code:
my_mc=new MovieClipLoader();
listener=new Object();
 
listener.onLoadComplete=function(target){
 my_mc2.gotoAndPlay(2);
}
my_mc.addListener(listener);
my_mc.loadClip("photo.jpg",this.my_scene);

but my_mc2 start before photo.jpg loaded
i don't understand!!!

and other problem:

i read from photo.xml the target from photo.
if i load with my_scene.loadMovie(numberPhoto[number]) it's work(i don't control de loading)
if i load whith photo.loadClip(numberPhoto[number],this.my_scene) don't work(loadClip it should have the loader function)

Using MovieClipLoader.loadClip()
say I have

code: mc.loadMovie("http://someurl.com/somepic.jpg")
playnow=true;

How would I use MovieClipLoader.loadClip() to add a listener, so I can invoke playnow only after the clip has loaded? I couldn't figure out how you reference the movie.

Problems With Loadclip
im having problems telling movieclip to start after they are loaded...
im doing this

createEmptyMovieClip("nav", 0);
mcl.loadClip("navi.swf", nav);

i have this code in the listener section....

mclListener.onLoadComplete = function(mclname)
{
trace("finished");
nav.gotoAndStop(2);
}

a trace and the command to tell the loaded movie to goto its second frame. the trace is coming back in my output window but the movie clip i loaded is not going to the second frame like it is supposed to...

the navi.swf is a movie with a blank 1st frame with a stop action and a navigator bar clip on the second frame.

ive tried everthing....please help....it tried _parent.gotoAndStop(2);,_level0.nav.gotoAndStop(2) ;, _root.gotoAndStop(2);, i tried placing it outside the listner function. for some reason i can't tell the newly loaded clip to play no matter what?

Help Please With Preload And Loadclip
Hi guys, i've got two problems the first one is this:

1) I've got an swf called preload.swf, in the first frame i've got this code:

percentual = Math.round((_level1.getBytesLoaded()/_level1.getBytesTotal())*100) add "%";

_root.loader.gotoAndPlay(Math.round((_root.getByte sLoaded()/_root.getBytesTotal())*100));

and then in the second an i condition...

well, everthing works ok... but animated preloader suffer a problem... when it loads the loader seem to play example 55,56,55,56 frame and this gives a weird effect on the animation... i think it's a problem of getting datas from an external swf from level1, because when i try getting information from _root the evolution of loader is fine (55,56,57,58 etc)... there's way to find a solution to this?

Because if I use a preloader inside level1 i get preload starts from 50% because of a lot of actionscript.


the second question is this:
2) is it possible to load inside a movieclip together 1 external jpg and a symbol from library?


Thanks all
Evol

LoadClip And Position JPG
I am trying to load thumbnail images dynamically, then position them vertally. Then turn them in to buttons. Below is my attempt. The images load, but do not space. Any ideas?


Code:
var vSpace:Number = 3;
var totalWheels:Number = 20;
var alphaOver:Number = 20;
//MoiveClip Loader
function loadExtMov(movieName, targetMovie) {
var mclListen:Object = new Object();
mclListen.onLoadStart = function(target_mc:MovieClip) {
//action
};
mclListen.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
//action
};
mclListen.onLoadError = function(target_mc:MovieClip) {
trace("ERROR: The external file "+movieName+" did NOT load");
};
mclListen.onLoadComplete = function(target_mc:MovieClip) {
//action
};
mclListen.onLoadInit = function(target_mc:MovieClip) {
trace("The external file "+movieName+" was loaded in to"+target);
spaceImg();
};
var thumb_mcl:MovieClipLoader = new MovieClipLoader();
thumb_mcl.addListener(mclListen);
thumb_mcl.loadClip(movieName, targetMovie);
}
//Load Image loop
function imageSelect() {
for (i=0; i<=totalWheels; i++) {
thumbHolder = createEmptyMovieClip("img"+i+"_mc", i);
loadExtMov("images/w"+i+".jpg", "img"+i+"_mc");
}
}
imageSelect();

//position images
function spaceImg() {
for (i=0; i<=totalWheels; i++) {
_root["img"+i+"_mc"]._y += _root["img"+i+"_mc"]._height+vSpace;
// buttons
}
_root["img"+i+"_mc"].onRelease = function() {
loadMovie("images/portraits/img0.jpg", _root.img_mc);
};
_root["img"+i+"_mc"].onRollOver = function() {
_root["img"+i+"_mc"]._alpha = alphaOver;
};
_root["img"+i+"_mc"].onRollOut = function() {
_root["img"+i+"_mc"]._alpha = 100;
};
}

Random Loadclip
Hi
I was wondering if it was possible to load a random .swf in an empty movieclip: let's presume I have a upper banner with photos; it would be cool if the images, loades as external .swf, could change every time i refresh the page (and the main movie as well). Is it possible?

Loadclip In As2.0 Class
Hi,

I've got a problem using loadclip in a as2.0 imagecontainer class.
It works fine when i place the image container on Stage, but when I attach the clip dynamically with attachmovie, nothing happens. this is what the class looks like. Does anybody have any ideas about this?

when i do a trace in the loadImage function everything seems to be normal, nothing is null or undefined...

Code:
class imagecontainer extends movieclip
{
function imagecontainer()
{
target = createEmptyMovieClip("target")
}

function loadImage( file )
{
var lc = new MovieClipLoader()
lc.addListener(this)

lc.loadclip( file, target )
}

}

in the .fla file i write something like this:

var im = attachMovie("imagecontainer", "image", 10)
im.loadImage( 'file.jpg' )

LoadClip Issue Help
Hi,
Im loading swf files in my movie with the loadClip Method.

When im testing it on my local machine it work great, but when im uploading it to the hosting server, it loads the first swf file but when i click to load another movie instead of the first , it fails and says "url not found".

But...if i have those swf filles cached it works.

p.s

HELP !

[F8] Using Loadclip In FireFox
I've juste complete a web site that I've publish on a Linux server. But all my LoadClip functions are not working when I'm using Firefox. I've tested my site on a Windows server and everything worked fine. Is there something I can do or an other function I can use to be able to load an external .SWF using FireFox and a linux server?

Here is the function Im using :

var myLoader:MovieClipLoader = new MovieClipLoader();
myLoader.loadClip("content\MyMovie.swf","mcMyMovi e");

Thanks.

LoadClip(), For Loop, _x Pos...
Hey all... Looking for a little direction here. Just now getting into XML and dynamic menu creation and all... Working on a little slideshow action, but having a hard time getting my clips positioned.

I can load everything. it's all there. What I can't do, is position each clip based on the loop iteration, that is... current clip's X is = i * (clip width + spacer) (code below)

Basically, everything traces as I need it to, except for the iteration! it onlly traces as the final, in this case, 4. The result being all the thumbs stacked on top of one another. I've tried dozens and dozens of variations of my script... now I'm at a loss. can someone tell me where the problem is?

Thanks,
-BK



code:

spacer = 1;
posX = 100;
posY = 100;


////////// load XML
var gal_xml = new XML();
gal_xml.ignoreWhite = true;
gal_xml.onLoad = function(success){
if (success){

//////////// create sets and thumbs arrays
var sets = this.firstChild.childNodes;
var thumbs:Array = this.firstChild.firstChild.childNodes;

var setHolder:MovieClip = _root.createEmptyMovieClip("setMenu",_root.getNext HighestDepth());
setHolder._x = posX;
setHolder._y = posY - 21;

var thumbHolder:MovieClip = _root.createEmptyMovieClip("container", _root.getNextHighestDepth());
thumbHolder._x = posX;
thumbHolder._y = posY;


///////////// create title menu
for(s=0; s < sets.length; s++){
var item = setMenu.attachMovie("menuItem", "set_"+ s, setMenu.getNextHighestDepth());
var setX:Number = s * (item._width + spacer);
item.menuText.text = sets[s].attributes.menuTitle;
item._x = setX;
}

////////// Create Thumbnails
for(t=0; t<thumbs.length; t++){
tHolder = container.createEmptyMovieClip("thumb_"+ t, container.getNextHighestDepth());
thumb = thumbs[t].attributes.thumb;
mcl.loadClip(thumbs[t].attributes.thumb, tHolder);
trace(thumb);
}
}
}


////////// thumbnail listener and loader
var mcl:MovieClipLoader = new MovieClipLoader();
var mclListener:Object = new Object();

mclListener.onLoadStart = function(_mc:MovieClip) {
}

mclListener.onLoadProgress = function(_mc:MovieClip) {
}

mclListener.onLoadInit = function(_mc:MovieClip) {
trace(_mc);
}


///// go
mcl.addListener(mclListener);
gal_xml.load("imagePath.xml");

The LoadClip Method
I recently ran into some problems when duplicating a movie clip, and then I found this...


Quote:




If you used MovieClip.loadMovie() or the MovieClipLoader class to load a movie clip, the contents of the SWF file are not duplicated. This means that you cannot save bandwidth by loading a JPEG, GIF, PNG, or SWF file and then duplicating the movie clip.




I am loading pictures from a database in my current project, and the same picture will be reused several times. Do I have to reload the picture everytime I want to use it? How can I avoid this. Is there a way to save a picture to some variable, movieclip, or common space (such as a library), and then reuse it whenever it is needed?

No Sound With LoadClip
I'm using loadClip to create a preloader for my game. Everything works perfectly except the sound which for some reason doesn't play at all when the game is loaded through the preloader. If I load it directly it plays fine though.

Any ideas?

LoadClip GetProgress
Hi there! I am new here. I am having some problem with my code. I am using loadclip in a container and I am using getProgress with interval. The problem is that when I simulate download test my flash it works perfectly and show me the status of downloading swf in my container. But when I upload that site the loader does not work. here is my code.

import mx.transitions.Tween;
import mx.transitions.easing.*;

var scene:String = new String();
var project:String = new String();
var portfolio:String = new String();
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
var chk:Boolean = new Boolean();
chk = true;

mcLoader.addListener(listener);
mcLoader.loadClip("media/mainBg.swf",image);

var interval:Object = new Object();
interval.id = setInterval(checkProgress, 100, mcLoader, image, interval);

function checkProgress(mcLoader:MovieClipLoader, image:MovieClip, interval:Object){
var progress:Object = mcLoader.getProgress(image);
percentage = Math.floor((progress.bytesLoaded / progress.bytesTotal) * 100);
val = percentage + "%";
setProperty("loader", _xscale, percentage);
if(progress.bytesLoaded == progress.bytesTotal) {
clearInterval(interval.id);
if(chk){
var motionTween:Tween = new Tween(image, "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 1, true);
motionTween.onMotionFinished = function(){
_root.image.play();
}
chk = false;
}
}
}

function loadPortfolioList(portfolio:String){
_root.attachMovie(portfolio + "_mc", portfolio + "MC", _root.getNextHighestDepth());
eval(portfolio + "MC")._x = 333;
eval(portfolio + "MC")._y = 482;
var motionTween:Tween = new Tween(eval(portfolio + "MC"), "_alpha", mx.transitions.easing.Regular.easeOut, 0, 100, 1, true);
}

function jump2Scene(scene){
if(scene == "residential"){
gotoAndPlay("residential", 1);
}else if(scene == "mainPage"){
gotoAndPlay("mainPage", 1);
}
}

function loadAnotherMovie(project:String, image:MovieClip){
mcLoader.loadClip("media/" + project + "/" + project + ".swf", image);
interval.id = setInterval(checkProgress, 100, mcLoader, image, interval);
}

stop();

[MX04] LoadClip()
I use loadClip() to load a lot of swf files into my movie. I uploaded the site to the server. Sometimes I get an error while the movie tries to load one swf file few times in different movieclips one by one. onLoadError() returns "URLNotFound" (but I know for sure that the file existents). Sometimes this process succeeds with no error (it loads one swf file few times in different movieclips).

I tried to reload the swf file inside the onLoadError(). But it didn't solve the problem.

Any ideas?

LoadClip() Problem
Hi

I have a training course im putting together with actionscript 2. Iv created a pre-loader with this code:


Code:
var listener = new Object();

var mcl = new MovieClipLoader();

mcl.addListener(listener);

listener.onLoadProgress = function(target_mc:MovieClip,bytesLoaded:Number,bytesTotal:Number){
var percentage:Number = bytesLoaded/bytesTotal*100;
//and then you do what you want with the percentage..


}
listener.onLoadInit = function(){
//when its done loading do what you want.
_root.ClipHolder2.slide1.gotoAndPlay(2);

}

createEmptyMovieClip("ClipHolder2",getNextHighestDepth());
mcl.loadClip("course1.swf",ClipHolder2);


it loads the clip in fine, but the actionscript in the "course1.swf" doesnt seem to work at all when its loaded up

I mean slide1.gotoAndPlay(2) here works, but its only showing the text and graphics on that slide and not running the actionscript to play the mp3 file

Ideas?

LoadClip Question
This is a stupid question I am sure but after dynamically loading images into a MC. The MC is no longer targetable. (Is that a word? Oh well.) If I don't load the jpeg then all my onRollOvers and stuff work fine.

What do I need to do?

Why Isn't LoadClip Working?
Hey everyone!

i'm quite an advanced actionscripter and i can't understand why loadClip forSWFs isn't working!

I'm creating the moviecliploader, and using it to load an external SWF. i know that it loads because i used the onLoadInit to check if it loads, but i just don't see the movie! i also checked by loading a jpg and that works as well.

is there something that i'm not aware of?

thanks

hers's my simple code:

var myMCL:MovieClipLoader = new MovieClipLoader ();
myMCL.loadClip("gov.swf","container");

LoadClip For A Beginner
Hi there,

I am a reflasher really. Haven't used flash since version 4 so I am way behind.
Have php experience too.
Anyway I am having a problem loading in swf files using loadClip.

On the main timeline frame 1 i have:
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();

myMCL.addListener(myListener);

I then have a script:
on (release) {
myMCL.loadClip("about.swf", container1);
}

which is three levels down. It is a movie clip inside a movie clip.
Heirarchy is as follows: scene1/navbar/nav

I cannot seem to get the "about.swf" file to load onto the top level in a movieclip called container1 instance name container1.

Hope this all makes sense.

Cheers

LoadClip Issues
I have an empty mc in my main swf called mcThemePreview. I want to load an mc into it so I do this:


ActionScript Code:
var owner = this;
var mclThemePreview = new MovieClipLoader();
mclThemePreview.onLoadInit = function()
{
    trace("xPreviewScale = " + owner.mcThemePreview.txtXPreview.text);
    trace("yPreviewScale = " + owner.mcThemePreview.txtYPreview.text);
};
mclThemePreview.loadClip(thisFamilySwf, mcThemePreview);

The actionscript is all seperate from my fla files. When I change the value of my textfields, which is set in my fla, and then republish everything, the values aren't changed with the trace statement. Is there something that I am doing wrong or something that I am not doing that I need to be doing? I can't figure it out.

Jason

Why Not? (MCLoader.loadClip)
trace(chargeur.loadClip(urrentMap[drawmapx][drawmapy].image_str,loadimageshere_mc))

aways traces false!!!???

The problem is that since it always traces false and it doesn't load anything ecoute.onLoadInit() is never called.

loadimageshere_mc's declared earlier:
var loadimageshere_mc:MovieClip;

This is my code in case it makes any difference:

ActionScript Code:
lengthUsed++;
        //createEmptyMovieClip("loadimageshere_mc",0-lengthUsed)
        //loadMovie(currentMap[drawmapx][drawmapy].image_str,loadimageshere_mc);
        var chargeur:MovieClipLoader= new MovieClipLoader();
        var ecoute:Object=new Object();
        ecoute.onLoadInit=function(){
            trace("ecoute.onLoadInit=function()");
            eval("BitmapData_"+String(NextBuff)+".draw(loadimageshere_mc)");
            imagesLoadedSoFar[1][lengthUsed]=eval("BitmapData_"+String(NextBuff));
            createEmptyMovieClip("mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy), drawmapx+drawmapy*100);
            eval("mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy)+".attachBitmap(imagesLoadedSoFar[1][lengthUsed], 2)");
            //duplicateMovieClip(imagesLoadedSoFar[1][lengthUsed], "mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy), drawmapx+drawmapy*100);
            set("mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy)+"._x",drawmapy*50);
            set("mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy)+"._y",drawmapx*50);
            yep=0;
            trace(target_mc);
            trace(eval("mapHolder_mc.t_"+String(drawmapx)+"_"+String(drawmapy)));
        }
        chargeur.addListener(ecoute);
        trace(chargeur.loadClip(urrentMap[drawmapx][drawmapy].image_str,loadimageshere_mc));
        imagesLoadedSoFar[0][lengthUsed]=currentMap[drawmapx][drawmapy].image_str;
        nextBuff++;
Also the whole thing is in a function that's called 2500 times if it makes any difference...

LoadClip Problem
I have a problem and wondering if anyone could help.
Part of code:

------------------------

for (i=0; i<nodes.length; i++) {

_root.createEmptyMovieClip(movieName[i],_root.getNextHighestDepth());
mcLoader.addListener(myListener);
mcLoader.loadClip(photo[i], _root[movieName[i]]);

}

------------------------

Everything works just fine, but all my pictures start loading all at the same time (makes sense, because the loop works faster than loadClip ) . I want them to be loaded one by one. The site is code only and I don't want to change that. I've tryied to delay the loading process with setInterval , but no good results. Any ideea?

LoadClip Error...
Hi all,

When I run this on my timeline it works fine


Code:
mcl.loadClip(Math.floor(Math.random() * 6) + ".jpg", this);
I changed the code so that it will load a specific image but when I run this it gives me an error! Any ideas?

Code:
mcl.loadClip(Math.floor("1.jpg", this);
This is the fucntion at the beginning of my movie, but don't need to change that just need to edit the above line...


Code:
var mcl:MovieClipLoader = new MovieClipLoader();

function onLoadInit(targ:MovieClip):Void
{
// Fade to 100 in 3 seconds using the easeoutquad tween
targ.alphaTo(100, 3, "easeoutquad");
}

// Start the MCL working
mcl.addListener(this);

SetMask() And LoadClip()
Hi all.

I have created a movie clip which has three layers.

layer 1. Is the mask the code is:

PHP Code:



onClipEvent(load){
    _root.mcPicture.setMask(this);





larer 2. is the picture which is a normal picture and the instance name is mcPicture.

layer 3. is the blured picture.

Now this all works fine no problems. The settings are flash player 8 and action script2 and saved as picture.swf

now when i try to load the swf into another swf using the loadClip() function now the movie loads fine but the mask dosent work?!

does anyone know why this could be?

the settings of the movie i am loading picture.swf into are the same as picture.swf .

Help would be great!

thanks in advance

LoadClip Bloating?
Code:
//Turning Movie Poster Back On
poster_mc._visible = true;

//Loading and Formatting Movie Poster
var myMCL:MovieClipLoader = new MovieClipLoader();
var ml:Object = new Object();
ml.onLoadInit = function(target_mc:MovieClip) {
target_mc._height = 152;
target_mc._width = 102;
}
myMCL.addListener(ml);
_root.createEmptyMovieClip("poster_mc",1);
myMCL.loadClip(mimgurl1, poster_mc);
stop();
This is the image display code I use for a movie rating system. Every time you switch to view the next movie, it sets poster_mc.visible = false. Every time it finishes the animation, it executes the code above.

So my question is this, every time it sets poster_mc's visibility to true and loads a different image, is the old image under the new one or is it replaced?

If it's still just sitting under the new image, how can I get rid of it to avoid bloating?

Can AS3 .swf MovieClipLoader.loadClip(AS2.swf);
Hey I'm new to AS3.

I'm makeing a Interface and i'd like to use AS3.
If the interface is in AS3 can i use MovieClipLoader to load in AS2 files?

Another thing in the AS2 file that i'll be loading in there are function calls to the main time line. e.g.
_level0.functionName(sameVar);
Will this simply call a function from the AS3 interface??


Tips and links to making the move would be appreciated.

Thanks Baz.

Loadclip Not Working
i am trying to preload an image, and when its done, it is displayed with an MC. I have done this hundreds of times, but for some reason, it is only showing a gray box.

im using this code ... from within _root.imageloader

ActionScript Code:
loadBar._visible = false;
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);
preload.onLoadStart = function(targetMC) {


image1mc._visible = false;
loadBar._visible = true;


};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {

loadBar._width = (lBytes/tBytes)*100;

};
preload.onLoadComplete = function(targetMC) {

image1mc._visible = true;
loadBar._visible = false;

};

preload.onLoadInit = function (targetMC)
{
        targetMC._width = 450;
        targetMC._height = 338;
}
//default image
my_mc.loadClip("image1.jpg","imagemc");

i have specified the path as "image1.jpg", but for some darned reason nothing happens.

LoadClip And PreLoaders
I am trying to finish a website that I created in Flash. It has one main swf which then loads each page's content into itself. Originally I did not have any preloaders set up and I used loadMovie for each of the pages. When I added a preloader I changed everything to loadClip. However now the content of each page is on a level higher than the main swf and the drop down navigation bar, which is in the main swf, is hidden behind the loaded content.

To try to fix that problem I made the navigation bar a seperate swf and am now using loadClip to load it on a higher level than the content so that it appears in front. But now I cannot get the actionscript on the buttons in the navigation bar to work.

There are several ways to solve this problem that might work but I don't know enough about actionscript to know how to do them.


Code:
CODE MAIN PAGE:
var topmenu = this.createEmptyMovieClip("topmenu", "50");
topmenu._x = 52;
topmenu._y = 136;
loadMovie("menu.swf", "topmenu");

bar._visible = false;
border._visible = false;
var empty = this.createEmptyMovieClip("container", "1");
empty._x = 96;
empty._y = 207;

my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);

preload.onLoadStart = function(targetMC) {
trace("started loading "+targetMC);
container._visible = false;
border._visible = true;
pText._visible = true;
};

preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
pText.text = Math.round((lBytes/tBytes)*100)+"%";
};

preload.onLoadComplete = function(targetMC) {
container._visible = true;
border._visible = false;
pText._visible = false;
trace(targetMC+" finished");
};

my_mc.loadClip("home.swf", "container");


stop();

this.topnav_mc.home_btn.onRelease = function() {
my_mc.loadClip("home.swf", "container");
topnav_mc.gotoAndStop("closed");
};
this.topnav_mc.services_btn.onRelease = function() {
my_mc.loadClip("steelservices.swf", "container");
topnav_mc.gotoAndStop("closed");
};

this.topnav_mc.ftp_btn.onRelease = function() {
getURL("ftp://orangecountyironworks.org/", "blank");
topnav_mc.gotoAndStop("closed");
};
this.topnav_mc.contact_btn.onRelease = function() {
my_mc.loadClip("contact.swf", "container");
topnav_mc.gotoAndStop("closed");
};
this.topnav_mc.aboutoci_btn.onRelease = function(){
my_mc.loadClip("about.swf", "container");
};
this.home_btn.onRelease = function() {
my_mc.loadClip("home.swf", "container");
};
this.about_btn.onRelease = function() {
my_mc.loadClip("about.swf", "container");
};
this.services_btn.onRelease = function() {
my_mc.loadClip("steelservices.swf", "container");
};
this.projects_btn.onRelease = function() {
my_mc.loadClip("residential.swf", "container");
};
this.testimonials_btn.onRelease = function() {
my_mc.loadClip("testimonials.swf", "container");
};
this.news_btn.onRelease = function() {
my_mc.loadClip("news.swf", "container");
};
this.ftp_btn.onRelease = function() {
getURL("ftp://orangecountyironworks.org/", "blank");
};
this.contact_btn.onRelease = function() {
my_mc.loadClip("contact.swf", "container");
};

CODE ON MENU SWF
stop();
this.projects_btn.onRelease = function() {
gotoAndPlay("projects");
};
this.about_btn.onPress = function() {
gotoAndPlay("about");
};
this.aboutoci_mc.onPress = function() {
_root.loadClip("about.swf", "content");
gotoAndPlay("closed");
};

LoadClip Behaviour
Hello

I'm trying to create a loader that will load external files on clicks of menu buttons.
Now, this is done easly with LoadClip, with listener and onLoadProgress/Init/Complete methods.
The problem occurs when you are to press another button that loads a different file, as it will automatically unload a previous file even before the new starts to load.
If I want to show the previous file, while the new one is being loaded i'd have to load it into a different container (empty movie clip) and once this is done, unload the old file using unloadMovie.
I can think of several ways of doing this, but all of them would have to be hardcoded and farr from self explanatory.
What I'm looking for is some function or other elegant solution to this task.

button code:

ActionScript Code:
mcButton1.onRelease = function():Void
    {
        fLoad("http://www.mydomain.com/myfile.swf");
        clearInterval(nInterval);
        nInterval = setInterval(fFadeIn,5,mcLoader);
    };

really ugly solution

ActionScript Code:
function fLoad(sTargetFile:String):Void
    {
        if (bSwitcher) {
            MCL.loadClip(sTargetFile, mcHolder1);
            bSwitcher = !bSwitcher;
        }
        else {
            MCL.loadClip(sTargetFile, mcHolder2);
            bSwitcher = !bSwitcher;
        }
       
    }

oListener.onLoadComplete = function(sTargetFile:MovieClip):Void
    {
        clearInterval(nInterval);
        nInterval = setInterval(fFadeOut,5,mcLoader);
        if (bSwitcher) {
            mcHolder2._visible=true;
            mcHolder1._visible=false;
           
        }
        else {
            mcHolder2._visible=false;
            mcHolder1._visible=true;
        }
       
    }

Problem With Loadclip
the probelm is once game.swf loaded. this button can't be clicked any more.
what is worng?check the code:

on (release) {
_root.createEmptyMovieClip("game_mc", this.getNextHighestDepth());
var _mcl:MovieClipLoader = new MovieClipLoader();

myListener = new Object();
myListener.onLoadInit = function(target_mc:MovieClip) {
target_mc._x = -Stage.width/2;
target_mc._y =-50;
target_mc._width = 900;
target_mc._height = 600;
target_mc._lockroot = true;
_root.quitgame_mc.onRelease = function() {
game_mc.unloadMovie(_mcl);

};
};
_mcl.addListener(myListener);
_mcl.loadClip("game.swf", "game_mc");
_root.quitgame_mc._visible = true;
}
please help:.thanks

Flash 7 & LoadClip.
Hi,

I use the following code in flash 7 . I cant see my pic file even though I can see in flash 8. My gif file is not animated one.
Can anyone help me on this? And I specify my movie clip width and height but it always return me 0. I use trace to display my movie clip width and height.
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
container._x =10;
container._y =10;
this._width = this._width-0.1;
this._height = this._height-0.1;
mcLoader.loadClip("C:\TheSu\Projects\flash\171006\logo\SQ.gif", container);
container._xscale =100;
container._yscale = 100;

function onLoadInit(mc:MovieClip) {
trace("onLoadInit: " + mc);
}
thanks,
with regards,

LoadMovie Vs LoadClip
i load a movie using mc.loadMovie("name.swf");
one by one.
works fine on my machine but when I try running the mani swf at my machine
from another machine in networke it loads some clip but not all.
While the same works on network also when i use moviclip loader
class.loadClip() method
Does anyone have idea why.

Set Property After LoadClip
Hi Community!

I am trying to use loadClip to randomly load in an external SWF (this part works great) and then to adjust the alpha of the loaded clip (ultimately I'll have the alpha adjusted according to the level the clip loads on, so different clips will have different alphas). Can't seem to change any property of the loaded clip, please help!

Thanks!!











Attach Code

////////////////////////// loading movies and randomness
var levelNumberCamera = Number;
levelNumberCamera = 10;
var mclListener:Object = new Object();
mclListener.onLoadStart = function(target_mc:MovieClip) {
//do something
};
mclListener.onLoadComplete = function(target_mc:MovieClip) {
//do something
};
mclListener.onLoadInit = function(target_mc:MovieClip) {
this._alpha = 40;
};
var myMCL2:MovieClipLoader = new MovieClipLoader();
myMCL2.addListener(mclListener);


var cameraOn = function(){
levelNumberCamera += 1;
load_which_one = Math.round((Math.random()*15));
load_this_one = "camera-trigger" + load_which_one + ".swf";
myMCL2.loadClip(load_this_one,levelNumberCamera);
};


/////////////////////button trigger
myButton.onRelease = function() {
cameraOn();
};

LoadClip Question
i was just reading a post regarding loading mc's into child clips and i am wondering if what i want to do is even possible?

i have a movie where i load several thumbnails into a horizontal panel. i would like to load a single .gif into each of the new thumbnail mc's so that when the thumbnail is rolled over, the .gif appears. here is the code of what i have that is not working:

if there is another route i should take, i would love to hear it. thank you for any help/advice!







Attach Code

var container:MovieClip = mainContainer.createEmptyMovieClip(prodID[j], mainContainer.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var imageListener:Object = new Object();
mcLoader.addListener(imageListener);
mcLoader.loadClip(imagePath + prodID[j] + ".png", container);

var rollovermc:MovieClip = container.prodID[j].createEmptyMovieClip("rollovermc", container.prodID[j].getNextHighestDepth());
var mcLoaderR:MovieClipLoader = new MovieClipLoader();
var imageListenerR:Object = new Object();
mcLoaderR.addListener(imageListenerR);
mcLoaderR.loadClip(imagePath + "rollover" + ".gif", rollovermc);

FlashVars And LoadClip
I have a master.swf that loads flashvars variables from html. The master.swf also loads several external swf's via loadClip. The FlashVars information works fine in the master; however, none of the externally-loaded movie clips recognize the flashvars. Any idea how to get the flashvars data to also work in the loaded clips?

LoadClip XML Children
loadClip is not working... What is the reason for this:

trace(nodes.childNodes[1].firstChild); // images/IMG_01.jpg

loadClip(nodes.childNodes[1].firstChild, mc); // dosn't work

loadClip("images/IMG_01.jpg", mc); // does work


If I were to use loadMovie it would work... but I need to use loadClip because I need listeners.
In other words, if I used loadMovie then I could just make a for loop and load them all at the same time... but I need to load them one at a time, in order.









Attach Code

myG = new XML();
myG.ignoreWhite = true;
myG.onLoad = function(success) {
allimages = this.childNodes.length;
var nodes:Array = this.childNodes;
thisHome.createEmptyMovieClip("targetMC",this.getNextHighestDepth());
thisHome.targetMC._x = 17;
thisHome.targetMC._y = 369;
loadImages(nodes);
};
i = 0
var thisHome:MovieClip = this;
loadImages = function (nodes:Array) {
var mc:MovieClip = thisHome.targetMC.attachMovie("imageThumb","img"+i,i+1,{_x:i*27});
var imgLoader:MovieClipLoader = new MovieClipLoader();
mc._width = 25;
mc._height = 17;
var earl = nodes[i].childNodes[1].firstChild;
imgLoader.loadClip(earl, mc.fullThm);
trace(earl)
i++
if (i<allimages){
loadImages(nodes);
};
};

Problem Regarding LoadClip
I'm trying to load large images in runtime using loadClip. My images are maybe 4000x3000 pixels or something similar. After they are loaded I want to resize them to Stage.

For some reason Flash can't load the whole image. As "_width" instead of 4000px I always get the maximum 2880px. WHY ? I've used "container_mc.loadMovie("sample.jpg")" and still the same. I can't get pass the 2880px.
Here is the code:










Attach Code

var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
var listener:Object = new Object();
Stage.scaleMode = "noScale";

listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
progressDwl = int(bytesLoaded/bytesTotal*100);
};
listener.onLoadInit = function(target:MovieClip):Void {
trace(target._width) //2880
// resize code
};
mcLoader.addListener(listener);
mcLoader.loadClip("sample.jpg",container);

LoadClip Stop
Hi.

Recently I came up with a problem: I want to stop loading procedures that have start with loadClip() function.

Example: Suppose that I am loading a huge picture ~2MB in my swf file with loadClip() and I track it's progress with onLoadProgress() function. I also have a button X, that I want to cancel the loading when pressed. Is there any way to do it?

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