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








Problems With Variables & MovieClipLoader.loadClip() Function.


Hello,

I'm making a XML photogallery. Im using a MovieClipLoader to load multiple images on the screen at the same time.

I've assigned variable path to hold image[p].childNodes which returns gallery/051102.jpg.
eg. path = image[p].childNodes;
trace(path); //returns gallery/051102.jpg

so when I load the image into the MovieClipLoader,
eg. mcLoader.loadClip(path, image);
no images show up.

if i subsitute path with,
eg. mcLoader.loadClip("gallery/051102.jpg", image);
image gallery/051102.jpg shows up!

Any help is appreciated. Thank you.
irok




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 10-28-2006, 06:54 PM


View Complete Forum Thread with Replies

Sponsored Links:

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.

View Replies !    View Related
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.

View Replies !    View Related
BUG? - MovieClipLoader.loadClip()
I've developed an app. in MX2004 which uses the MovieClipLoader.loadClip() method and the loadInit listener. I have tested the script with success in the IDE. However when I run the .swf via the web I encounter mixed results. I should note that that I have tested using both absolute and relative paths for the "url" parameter and have had the same results regardless.

Is this a know bug in MX2004? Is there any solid documentation from Macromedia regarding this issue? I have not been able to find it if so. Any help would be greatly appreciated. Thanks!

simple sample:

http://endologik.com/dev/loadClip

Fails to load image on:
PC's-
IE 6
Mozilla

Mac OSX-
Mozilla
Safari

Succeeds to load image on
Mac OSX-
IE 5.2.3
Opera
Omni Web

sample's script:

// BUTTON EVENT =======================================
btn_mc.onPress = function()
{
my_mcl.loadClip('images/aquatics01.jpg', 'images_mc');
};
// LISTENERS ==========================================
var my_mcl:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
loadListener.onLoadInit = function(target_mc)
{
display.text = target_mc + ' was loaded';
};
my_mcl.addListener(loadListener);
//======================================================

View Replies !    View Related
BUG? - MovieClipLoader.loadClip()
I've developed an app. in MX2004 which uses the MovieClipLoader.loadClip() method and the loadInit listener. I have tested the script with success in the IDE. However when I run the .swf via the web I encounter mixed results. I should note that that I have tested using both absolute and relative paths for the "url" parameter and have had the same results regardless.

Is this a know bug in MX2004? Is there any solid documentation from Macromedia regarding this issue? I have not been able to find it if so. Any help would be greatly appreciated. Thanks!

simple sample:

http://endologik.com/dev/loadClip

Fails to load image on:
PC's-
IE 6
Mozilla

Mac OSX-
Mozilla
Safari

Succeeds to load image on
Mac OSX-
IE 5.2.3
Opera
Omni Web

sample's script:

// BUTTON EVENT =======================================
btn_mc.onPress = function()
{
my_mcl.loadClip('images/aquatics01.jpg', 'images_mc');
};
// LISTENERS ==========================================
var my_mcl:MovieClipLoader = new MovieClipLoader();
var loadListener:Object = new Object();
loadListener.onLoadInit = function(target_mc)
{
display.text = target_mc + ' was loaded';
};
my_mcl.addListener(loadListener);
//======================================================

View Replies !    View Related
Problems With MovieClipLoader.loadClip()
Hello. I am having issues with loading SWFs through the MovieClipLoader.

Here is the general setup:

• MovieClip object with 1) preloader and 2) container for video. Is passed a parameter to find the content to load.
• Using MovieClipLoader and its events, loads a SWF into the empty container displaying preloader until loaded and then stops and waits for transport controls on _root to do its thing.

PROBLEM: Works fine at loading the clip, but the dimensions of the video container are not the size that I was expecting; the clip displays larger. The container object, as well as the source SWF, are setup to be the same size.

SIDE PROBLEM: Trying to see if the preloader in the MovieClip actually works given it does not appear onLoadProgress fires.

As for the project itself:

• clips that I am loading are relatively large. Compressed as much as I can for quality and embedded within the SWF range from ~4MB to ~46MB. As such, I obviously want to load on demand rather than embed the movies.
• All videos represent the same time series. However, they do not sync. As such, I need to be able to control the videos through ActionScript in order to specify the frame to show in an arbitrary number of slave movies based upon the position of the master clip.
• In addition, I need to be able to duplicate the clip and run simultaneous to the first clip, but at a different start position, e.g., one starts at 9:00am, the other at 12:00pm.

Help on the sizing issue; as well as any comments, pointers, or examples on the construct of this Flash; are greatly appreciated.

View Replies !    View Related
MovieClipLoader.loadClip(URL,mc) Issue
Hi,

I have just migrated from Flash MX /Actionscript 1.0 to Flash 8/Actionscript 2.0 and started to replace mc.loadMovie() with mcl.loadClip() in my programs mainly because i want to take advantage of the preloading listeners etc. in the MovieClipLoaderClass

I have come across one issue which is driving me insane!

i am reading in an XML file which contains a list of paths to images i want to load in. For example:

<image> images/category1/01.jpg </image>
<image> images/category1/02.jpg </image>
<image> images/category2/01.jpg </image> etc..

and i store these paths in an array called imageArray

now using actionscript 1.0 in flash mx i would write something like

mc.loadmovie(imageArray[0]) and my image would load.

using ActionScript2.0 in flash 8 i write

mcl.loadClip(imageArrray[0],mc) and the image DOES NOT load.

if i change the line to read

mcl.loadClip(""+imageArrray[0]+"",mc) then the image loads

Why is this necessary? imageArray[0] is already a string why do i need to ad quotes to it for the MovieClipLoder class? Am i missing something obvious?

thanks in advance

Andy

View Replies !    View Related
MovieClipLoader.loadClip Not Working?
Hi,

I have this following function..



Code:

function addImageElement(p_mc:MovieClip, imgName:String, elName:String){

c_mc=p_mc.createEmptyMovieClip(elName, p_mc.getNextHighestDepth());
var mapl:MovieClipLoader = new MovieClipLoader();
mapl.loadClip(imgName, c_mc);

}

...that works like a charm in FP8.

But in FP7 it refuses to load the images.

What's wrong? I can't find any info under help.

Best,
NoBuzz

View Replies !    View Related
MovieClipLoader LoadClip And UnloadClip
When I call unloadClip on a MovieClipLoader instance after loading has started, but before loading finishes, the clip continues loading. Is there any kind of "stop()" functionality for the MovieClipLoader?

I have a main image viewer tied to button events that tell it to load the next or previous image. So if the user clicks the next button 10 times, the MovieClipLoader instance will load all 10 clips, rather than dumping the UrLs sent by the previous 9 clicks. I know I can just disable the buttons until the data has loaded, but that shouldn't be necessary.

I've tried these workarounds with no success:
- Re-initializing the moviecliploader instance I am using when either button is clicked
- Deleting the target movie of the previous load, and putting the new target on another level with a different name

I thought about setting the _alpha property of the targets of previous load requests to 0, but that still means that the user has to wait for each image to download before they get to the one they wanted. So they don't see the clips loading but they have to wait alot longer.

I haven't found much help on the forums for this, or the documentation. So, I assume it's still possible to halt the loading of data with moviecliploader as I have not come across any site that says "You must wait for the load to finish before calling unloadClip()". The documentation says that unloadClip during loading should trigger onLoadError, but it doesn't -- someone made mention of this in the user comments section but I haven't seen a response to it.
http://livedocs.adobe.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001584.html
http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002538.html

Thanks in advance for any help. Even if it's to tell me that you can't stop loading a file mid-stream.

View Replies !    View Related
MovieClipLoader LoadClip Not Working
Code:
this.createEmptyMovieClip('test', this.getNextHighestDepth());
var pics:Array = new Array();
pics[0] = '1.jpg';
pics[1] = '2.jpg';
pics[2] = '3.jpg';
pics[3] = '4.jpg';
pics[4] = '5.jpg';
for ( i = 0; i < pics.length; i++ ){
pic_cont = _root.test.createEmptyMovieClip('pic'+i, this.getNextHighestDepth());
pic_cont._x = 10*i;
pic_cont._y = 10*i;
var img:MovieClipLoader = new MovieClipLoader();
var list:Object = new Object();
img.addListener(list);
list.onLoadStart = function(){
trace("Load started.");
}
list.onLoadError = function(){
trace("Error");
}
img.loadClip( pics[i], 'test.pic'+i);
delete img, list;
}
Won't work and I can't figure out whats wrong with it. If I trace img.loadClip( pics[i], 'test.pic'+i); it returns false. But the error function never get's called. Any idea what i'm doing wrong?

EDIT: I've got it working, the code is the code i'm using that works, but all of the images stack on top of each other. I can't figure out how to fix this.

View Replies !    View Related
[AS2] MovieClipLoader LoadClip Failure
I'm having a fun little bug with the loadClip function of the MovieClipLoader class. I've passed it a valid MovieClip and a valid filename (verified by traces) and it still returns false. It never calls the listener object I created with a onLoadStart or onLoadError event. I'm still trying to figure out why it would return false, but I'm at a loss. It had worked before and I changed something, but I can't remember what. I've looked it over a few times and I figure I might need a second eye to see what might be wrong here...


Code:
import mx.events.EventDispatcher;
import mx.utils.Delegate;

class MultiSWFManager_MiniLoader {
public var dispatchEvent:Function;
public var addEventListener:Function;
public var removeEventListener:Function;
private var _loader:MovieClipLoader;
private var _listener:Object;
private var _progressBar:MovieClip;
private var _mc_target:MovieClip;
private var _file:String;
private var _scale:Number;
private var _percent:Number;

function MultiSWFManager_MiniLoader(file:String, target:MovieClip) {
_loader = new MovieClipLoader();
_listener = new Object();
_file = new String(file);
_scale = new Number(1);
_percent = new Number(0);
_mc_target = target;
EventDispatcher.initialize(this);
}

public function beginLoad() {
if (_percent == 0) {
trace('Loading ' + this._file + ' into ' + this._mc_target);
_percent = 0.0001;
_listener.onLoadStart = function(mc:MovieClip) { trace(mc + " started..."); }// Delegate.create(this, onLoadStart);
_listener.onLoadError = Delegate.create(this, onLoadError);
_listener.onLoadProgress = Delegate.create(this, onLoadProgress);
_listener.onLoadComplete = Delegate.create(this, onLoadComplete);
_listener.onLoadInit = Delegate.create(this, onLoadInit);
_loader.addListener(this._listener);
trace(_loader.loadClip(_file, _mc_target));
_mc_target._visible = false;
}
}

private function onLoadStart(mc:MovieClip) {
trace(mc + " started...");
}

private function onLoadError(mc:MovieClip, errorCode:String, httpStatus:Number) {
trace(mc + " error: " + errorCode + " (" + httpStatus + ")");
}

private function onLoadProgress(mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
_percent = (bytesLoaded / bytesTotal) * 100;
_progressBar._xscale = (_scale * _percent) * .98;
}

private function onLoadComplete(target_mc:MovieClip, httpStatus:Number) {
trace("Status: " + httpStatus);
}

private function onLoadInit(mc:MovieClip) {
trace(' Inited ' + this._file);
dispatchEvent ({type:"complete"});
mc._visible = false;
}
}
Traces:

Code:
Loading test1.swf into _level0.mc_container2
false
It never calls onLoadStart (I figured it might be a scope issue, so I placed the function inline. Otherwise, I created private functions for each event.)

View Replies !    View Related
LoadClip Problems (MovieClipLoader)
Hi guys...
I'm having some trouble with loadClip.
Im loading some external JPGS with loadClip.


ActionScript Code:
var my_mcl = new MovieClipLoader();
myListener = new Object();
 
myListener.onLoadInit = function(target_mc) {
 // some code here when image load is complete like resizing.. etc...
 
}
my_mcl.addListener(myListener);
my_mcl.loadClip(imgPath, _root.contentMC);


well.. everything seems ok, the image loads ok...
I noticed after puting the flash on my webpage that in all browsers that i've tried, (IE6+, firefox, opera) the statusbar is allways loading.. this is... all my page is fully loaded and on the status bar appear this message: "Transfering data from www.sample.com" when it should appear Done.


I thought that was a problem with my code, so i was checking other websites that have samples with loadClip, and all those had the same problem.. "Transfering data from www.sample.com"


Does anyone know why this is happen!? is this a flash bug with movieClipLoader, security issues?

Best regards,
Bruno

View Replies !    View Related
MovieClipLoader.loadClip And Query Strings
Hi,

I'm using Actionscript 2.0, and I'm trying to pass a query parameter in the url portion of MovieClipLoader.loadClip, e.g.

mcLoader.loadClip("movie1.swf?param=1234", blahblah);

but got the error "URLNotfound". If I omit "?param=1234", then it works.

I need to put clip loading inside a class definition, so when I tried to use MovieClip.loadMovie, I find difficult to correctly setup the event handlers "onClipEvent(load)" or even worse with "onLoad". Any ideas?

Thanks!

Ben

View Replies !    View Related
MovieClipLoader.loadClip And Query Strings
Hi,

I'm using Actionscript 2.0, and I'm trying to pass a query parameter in the url portion of MovieClipLoader.loadClip, e.g.

mcLoader.loadClip("movie1.swf?param=1234", blahblah);

but got the error "URLNotfound". If I omit "?param=1234", then it works.

I need to put clip loading inside a class definition, so when I tried to use MovieClip.loadMovie, I find difficult to correctly setup the event handlers "onClipEvent(load)" or even worse with "onLoad". Any ideas?

Thanks!

Ben

View Replies !    View Related
MovieClipLoader's LoadClip Method Is Loading Swf Before Its Downloaded 100%?
Hello everyone,

I created a MovieClipLoader a few days ago that is reuseable. I will be using the same preloader graphics when I am loading in external swf on my stage. My MovieClipLoader functions fine with jpegs and smaller sized swf files. But whenever I load a larger sizes swf it loads the movie before it has fully downloaded in simulation mode. The odd part is that everything works fine with smaller swf files but not larger ones . I have tested a few movies and that seems to be the common theme.

In the example below main.swf is the clip I am loading into "mcBackground".

var mclTV : MovieClipLoader = new MovieClipLoader ();
var loadListener : Object = new Object ();
// events it will handle
loadListener.onLoadStart = function ()
{
trace ("onLoadStart");
trace (this._target);
progress_mc._y == 268;
txtLoaded._visible = true;
progress_mc._visible = true;
};
loadListener.onLoadProgress = function (target : MovieClip, bytesLoaded : Number, bytesTotal : Number)
{
txtLoaded.text = String (Math.floor (bytesLoaded / bytesTotal * 100)) + "% loaded";
progress_mc._xscale = bytesLoaded / bytesTotal * 100;
};
loadListener.onLoadComplete = function ()
{
trace ("onLoadComplete");
txtLoaded._visible = false;
progress_mc._visible = false;
};
mclTV.addListener (loadListener);
mclTV.loadClip ("main.swf", mcBackground); //mcBackground is an empty movieClip on the stage
txtLoaded._visible = false;
progress_mc._visible = false;

View Replies !    View Related
MovieClipLoader.loadClip Doesn't Work, But MovieClip.loadMovie Does?
ActionScript Code:
private function init()
{
    var mclLoader:MovieClipLoader = new MovieClipLoader();
    var objLoadListen:Object = new Object();
    var mcTarget:MovieClip = _mcParent.createEmptyMovieClip("_mcGraphic" + _nCounter.toString(), _mcParent.getNextHighestDepth());
   
    /*objLoadListen.onLoadStart = Delegate.create(this, onLoadStart);
    objLoadListen.onLoadProgress = Delegate.create(this, onLoadProgress);
    objLoadListen.onLoadComplete = Delegate.create(this, onLoadComplete);*/
    objLoadListen.onLoadInit = Delegate.create(this, onLoadInit);
   
    //mcTarget.loadMovie(_strFile);    //This Works...
   
    mclLoader.addListener(objLoadListen);
    mclLoader.loadClip(_strFile, mcTarget);    //This Doesn't...
}

Code is pretty simple...for some reason the loadMovie statement processes fine, but the loadClip statement does not. No error, no nothing...it just doesn't load the image.

View Replies !    View Related
MovieClipLoader's LoadClip Method Is Loading Swf Before Its Downloaded 100%? (Smack)
Hello everyone,

I created a MovieClipLoader a few days ago that is reuseable. I will be using the same preloader graphics when I am loading in external swf on my stage. My MovieClipLoader functions fine with jpegs and smaller sized swf files. But whenever I load a larger sizes swf it loads the movie before it has fully downloaded in simulation mode. The odd part is that everything works fine with smaller swf files but not larger ones . I have tested a few movies and that seems to be the common theme.

In the example below main.swf is the clip I am loading into "mcBackground".


Code:
var mclTV : MovieClipLoader = new MovieClipLoader ();
var loadListener : Object = new Object ();
// events it will handle
loadListener.onLoadStart = function ()
{
trace ("onLoadStart");
trace (this._target);
progress_mc._y == 268;
txtLoaded._visible = true;
progress_mc._visible = true;
};
loadListener.onLoadProgress = function (target : MovieClip, bytesLoaded : Number, bytesTotal : Number)
{
txtLoaded.text = String (Math.floor (bytesLoaded / bytesTotal * 100)) + "% loaded";
progress_mc._xscale = bytesLoaded / bytesTotal * 100;
};
loadListener.onLoadComplete = function ()
{
trace ("onLoadComplete");
txtLoaded._visible = false;
progress_mc._visible = false;
};
mclTV.addListener (loadListener);
mclTV.loadClip ("main.swf", mcBackground); //mcBackground is an empty movieClip on the stage
txtLoaded._visible = false;
progress_mc._visible = false;

View Replies !    View Related
Poor Image Quality When Loading JPEG File Using MovieClipLoader.loadClip()
I have a JPEG file that looks fine in Photoshop. When I load it into a movie clip using MovieClipLoader.loadClip() API it renders in much poorer quality than the original. I tried setting _highquality = 2 on the target movie clip object to no avail. Please help.

View Replies !    View Related
LoadClip Inside The Function()
hello, i´m trying to make a loadClip (by MovieClipLoader) inside a function, but it doesn´t work...and I don´t know why....

please can someone help me?

this is the code that i´m try to use

//to create the class:

var carregador:MovieClipLoader = new MovieClipLoader();
var ouvidor:Object = new Object();
carregador.addListener(ouvidor);
_root.createEmptyMovieClip("alvo",100);
alvo._x = 11
alvo._y = 78
link = "contato.swf"
/*if I put the loadClip action here, the movie clip loads correctly, but I need to use this action inside the function....*/



//to use the loadClip inside the function:

function clipLoader () {
count ++

this.onEnterFrame = function () {
fundoMask._yscale = fundoMask._xscale
fundo._yscale = fundo._xscale

if (fundo._xscale <= 0) {
aciona = true
}
if (aciona) {
fundo._xscale = 20 + (fundo._xscale - 20)/1.2
fundo._alpha = 50 + (fundo._alpha - 50)/1.2
if (fundo._xscale > 19.8) {
carregador.loadClip(link, alvo)
}
ouvidor.onLoadStart = function() {
avisos = "carregando..."
};
trace(_root.alvo.nome2.length)
ouvidor.onLoadInit = function() {
alvo.setMask(fundoMask)
};
ouvidor.onLoadComplete = function() {
//avisos = ""
fundo._alpha +=4
fundo._xscale = tamanho + (fundo._xscale - tamanho)/1.058
if (fundo._xscale > 89) {
fundoMask._xscale = 89 +(fundoMask._xscale - 89)/1.3
}
}
ouvidor.onLoadError = function() {
avisos = "ocorreu algum erro"
};
}
}
}

View Replies !    View Related
LoadClip Function Not Working
hi, i have some code that i am using to try and create a scrolling row of images..
Code:
photoArray = ["Pic01.jpg", "Pic02.jpg", "Pic03.jpg", "Pic05.jpg", "Pic06.jpg", "Pic07.jpg", "Pic08.jpg", "Pic09.jpg", "Pic10.jpg", "Pic11.jpg"];
imageHolder=content_mc.photogallery_mc.photoline_mc.createEmptyMovieClip("imageHolder_mc", 0);
imageHolder._width=522;
imageHolder._height=115;
content_mc.photogallery_mc.mask._alpha=50;

var nextX:Number;
for(i=0;i<photoArray.length;i++){
imagePath=imageHolder.createEmptyMovieClip("image_"+i+"_mc", i);
var imageMcLoader:MovieClipLoader = new MovieClipLoader();
var imageListener:Object = new Object();
imageMcLoader.addListener(imageListener);

imageListener.onLoadComplete = function(target_mc:MovieClip) {
//actions would go here
};
imageListener.onLoadInit = function(target_mc:MovieClip) {
//actions would go here
};
imageListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
//actions would go here
};

trace(imageListener.loadClip(_l1 + photoArray[i], imagePath));
}
now the idea is that for each image in the array, an empty MC is created and the image is loaded into it and becomes part of my of scrolling line of images..

the problem is that the loadClip() function does not get called. when i trace like in the above code it returns undefined.. can anyone pls give me some assistance.. ??? thanks in advance..

i should mention that this is the first time i am attempting to use this function and i edited the code from the macromedia help example..

View Replies !    View Related
Help With LoadClip Function(im Stumped)
SOLVED(but this might help for future referance)
Solutions:had to use myListener.onLoadInit to read when the entire movie was loaded
had to use duplicateClip instead of attachMovie because for some reason attachMovie could not find the movie clip i wanted to attach
Had to change my array to a Number() because when i added +1 instead of rewriting the new value as 2 it wrote it as 11
Working Script:

PHP Code:



function buildMap (myMap) { var mapWidth          = myMap["base"][0].length; var mapHeight         = myMap["base"].length; var myListener        = new Object(); var myMovieClipLoader = new MovieClipLoader();  _root.attachMovie("empty","gameContainer",++curDepth); _root.gameContainer.attachMovie("empty","map",++curDepth); _root.gameContainer.map.attachMovie("empty","baseLayer",++curDepth);  myListener.onLoadInit = function(target) {  for (var i = 0; i<mapHeight; ++i) {   for (var j = 0; j<mapWidth; ++j) {    var newName = "t_"+i+"_"+j;    _root.gameContainer.map.baseLayer.tiles.duplicateMovieClip("t_"+i+"_"+j, ++curDepth);    _root.gameContainer.map.baseLayer["t_"+i+"_"+j]._x = (j*tileW);    _root.gameContainer.map.baseLayer["t_"+i+"_"+j]._y = (i*tileH);    _root.gameContainer.map.baseLayer["t_"+i+"_"+j].gotoAndStop(Number(myMap["base"][i][j][0])+1);   }   } }  myMovieClipLoader.addListener(myListener); myMovieClipLoader.loadClip("Resources/rec001.swf","_root.gameContainer.map.baseLayer");} 




Problem:
hey guys currently im making a flahs mmorpg and i want the game to run really smooth. My theory behind everythign is to carry and execute as little information inside flash as possible(to hopefully increase gameplay and smoothness of how the game runs). anyways to accomplish this i'm planning to load everything from external flash and php files and also to run Ajax and other javascript codes(for example for the player inventory which will be loaded on the HTML page insteado o f in flash). my problem is when im trying to load my mapResources(which contains all of the tiles for that map) im not able to call attach any movie clip that cmoes with it. here the funciton that im running:


PHP Code:



function buildMap (myMap) {var mapWidth = myMap["base"][0].length;var mapHeight = myMap["base"].length;var myListener = new Object();var myMovieClipLoader = new MovieClipLoader(); _root.attachMovie("empty","gameContainer",++curDepth);_root.attachMovie("empty","resourceData",++curDepth);_root.gameContainer.attachMovie("empty","map",++curDepth);_root.gameContainer.map.attachMovie("empty","baseLayer",++curDepth); myListener.onLoadInit = function(target) {for (var i = 0; i<mapHeight; ++i) {for (var j = 0; j<mapWidth; ++j) {var newName = "t_"+i+"_"+j;_root.gameContainer.map.baseLayer.attachMovie("_level0.resourceData.tiles", newName, ++curDepth); //I've attempt to load "tiles" here and that didnt work either_root.gameContainer.map.baseLayer[newName]._x = (j*tileW);_root.gameContainer.map.baseLayer[newName]._y = (i*tileH);_root.gameContainer.map.baseLayer[newName].gotoAndStop(myMap["base"][i][j][0]);} }} myMovieClipLoader.addListener(myListener);myMovieClipLoader.loadClip("Resources/rec001.swf","_root.resourceData");} 




Alright so this function pretty much loads an Array(myMap) and first find the width and height fo the map. then afte doing so it loads a couple fo containers for the gamenot really relavent to the issue) after this it sets a listener object thats ays when my resource(the tiles for the game map file has loaded to run a function. in this function it reattachs a movieclip and then stops on a frame according to the Array(myMap) that we loaded. on each of the newly attach Movie clip's frame is a diffrent piece of map.. so when all is said and done the function should output a beautiful looking healthy map. but this is not so

anyways i ran this script in debug mode and everything work sfine when i use a movie clip that is in the same move as this , but once i try to call the movieclip from the loadClip funciton i have it doesn't work.

anybody have any ideas at how to fix this or any other solutions to my problem that might work better? Im thining abotu trying to use duplicateMovieClip or somehting, anyhelp would be really great!

View Replies !    View Related
LoadClip Inside The Function()
hello, i´m trying to make a loadClip (by MovieClipLoader) inside a function, but it doesn´t work...and I don´t know why....

please can someone help me?

this is the code that i´m try to use

//to create the class:

var carregador:MovieClipLoader = new MovieClipLoader();
var ouvidor:Object = new Object();
carregador.addListener(ouvidor);
_root.createEmptyMovieClip("alvo",100);
alvo._x = 11
alvo._y = 78
link = "contato.swf"
/*if I put the loadClip action here, the movie clip loads correctly, but I need to use this action inside the function....*/



//to use the loadClip inside the function:

function clipLoader () {
count ++

this.onEnterFrame = function () {
fundoMask._yscale = fundoMask._xscale
fundo._yscale = fundo._xscale

if (fundo._xscale <= 0) {
aciona = true
}
if (aciona) {
fundo._xscale = 20 + (fundo._xscale - 20)/1.2
fundo._alpha = 50 + (fundo._alpha - 50)/1.2
if (fundo._xscale > 19.8) {
carregador.loadClip(link, alvo)
}
ouvidor.onLoadStart = function() {
avisos = "carregando..."
};
trace(_root.alvo.nome2.length)
ouvidor.onLoadInit = function() {
alvo.setMask(fundoMask)
};
ouvidor.onLoadComplete = function() {
//avisos = ""
fundo._alpha +=4
fundo._xscale = tamanho + (fundo._xscale - tamanho)/1.058
if (fundo._xscale > 89) {
fundoMask._xscale = 89 +(fundoMask._xscale - 89)/1.3
}
}
ouvidor.onLoadError = function() {
avisos = "ocorreu algum erro"
};
}
}
}

View Replies !    View Related
Return Function Once LoadClip Is Complete.
Ok, I think this will prob. be simple for you AS experts out there, here's my code:
[CODE]
function loadPic(whichPic):Void {
var i:Number = 0;
var pic:String;

var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total){
trace("loading:"+total+"bytes");
}

mclL.onloadInit = function(){
trace("finished loading");
}
mcl.addListener(mclL);

switch (whichPic)
{
case "steam":
pic = "flash/flashImage-stream.jpg";
break;
case "house2":
pic = "flash/flashImage-house2.jpg";
break;
case "house3":
pic = "flash/flashImage-house3.jpg";
break;
case "balcony":
pic = "flash/flashImage-balconey.jpg";
break;
}

mcl.loadClip(pic,mainImage);
}
[/CODE]
What I want to do, is force the function to ONLY return once the file has finished loading. How can I do this??

View Replies !    View Related
Return Function Once LoadClip Is Complete.
Ok, I think this will prob. be simple for you AS experts out there, here's my code:

Code:
function loadPic(whichPic):Void {
var i:Number = 0;
var pic:String;

var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();

mclL.onLoadProgress = function(target,loaded,total){
trace("loading:"+total+"bytes");
}

mclL.onloadInit = function(){
trace("finished loading");
}
mcl.addListener(mclL);

switch (whichPic)
{
case "steam":
pic = "flash/flashImage-stream.jpg";
break;
case "house2":
pic = "flash/flashImage-house2.jpg";
break;
case "house3":
pic = "flash/flashImage-house3.jpg";
break;
case "balcony":
pic = "flash/flashImage-balconey.jpg";
break;
}

mcl.loadClip(pic,mainImage);
}
What I want to do, is force the function to ONLY return once the file has finished loading. How can I do this??

View Replies !    View Related
LoadClip Letting Me Attach OnRollOver Function
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("zelda.jpg", container);

_root.container.onRollOver = function(){
trace('ZELDA!');
}



/*Now this SHOULD trace back 'ZELDA!' when I click on the picture of Zelda... Right? It doesnt, what am I doing wrong? Please help.

View Replies !    View Related
Variables Not Yet Available With MovieClipLoader
Guys,

First of all don't flame me for asking this question. I have searched for about 45 minutes and no one has the answer.

My question is:

When I use the MovieClipLoader class to dynamically load my swfs I notice that when the onLoadComplete function runs I don't yet have access to the variables/functions defined on the first frame of the externally loaded swf. Theoretically, if the movie is loaded by then...shouldn't I have access to these fields and methods at this point?

When the onLoadComplete function runs...I do a simple trace inside of it...of course targeting my variable properly...but it's undefined because it hasn't yet been created. This is very frustrating because I need the onLoadComplete to garuntee that everything I need is loaded.

I tested the theory and noticed that after a few seconds...I then I have access to these variables. So I know I'm getting them eventually...just not right when onLoadComplete fires.

Anybody who can help thank you!

-Ralph

View Replies !    View Related
MovieClipLoader With Scroll Function
Hi i thinking off making a scroll function in a MovieClipLoader so i can have a list of flash files loading and the user can scroll and see+click after these files load into the flash file.

But how do i do this? I have the MovieClipLoader function up running i just the scroll function.

Im quite new a this so if anyone can explain it quite simple it would be a great help

View Replies !    View Related
[F8] MovieClipLoader With Scroll Function
Hi i thinking off making a scroll function in a MovieClipLoader so i can have a list of flash files loading and the user can scroll and see+click after these files load into the flash file.

But how do i do this? I have the MovieClipLoader function up running i just the scroll function.

Im quite new a this so if anyone can explain it quite simple it would be a great help

View Replies !    View Related
[F8] MovieClipLoader With Scroll Function
Hi i thinking off making a scroll function in a MovieClipLoader so i can have a list of flash files loading and the user can scroll and see+click after these files load into the flash file.

But how do i do this? I have the MovieClipLoader function up running i just the scroll function.

Im quite new a this so if anyone can explain it quite simple it would be a great help

View Replies !    View Related
MovieClipLoader Function Questions
I am working with the movieClipLoader function to create a photo gallery site. I;ve been try to modify the Reusable loader tutorial and this is what i have:

/* Set Content Dimensions */
contentW = 100;
contentH = 100;

/* Image Data Array */
imageDat = new Array();
imageDat = ["2_1_1.jpg"];

/* Create emptyClip to hold pic */
var empty = this.createEmptyMovieClip("picHolder", 100);
picHolder._visible = false;

/* create loader and listener */

picLoader = new MovieClipLoader();
loadStatus = new Object();
picLoader.addListener(loadStatus);

/* Declare Listener Function */
loadStatus.onLoadInit = function(target_mc) {
_root.loadBar._visible = 1;
_root.loadBar._xscale = 0;
};
loadStatus.onLoadProgress = function(target_mc, tBytes, lBytes) {
_root.loadBar._xscale = (lBytes/tBytes)*100;
};
loadStatus.onLoadComplete = function(target_mc) {
_root.loadBar._visible = 0;
_root.contentW = _root.picHolder._width;
_root.contentH = _root.picHolder._height;
_root.scaleTween (_root.contentW, _root.contentH);
}

/* Tween */
scaleTween = function (contentW, contentH) {
_global.tweening = 1;
easeType = mx.transitions.easing.Strong.easeOut;
var beginX = _root.box._width;
var beginY = _root.box._height;
var time = 1;
var mc = _root.box;
boxTween = new mx.transitions.Tween(mc, "_width", easeType, beginX, contentW, time, true);
boxTween = new mx.transitions.Tween(mc, "_height", easeType, beginY, contentH, time, true);
};
scaleTween(contentW, contentH);
i = 0;
blueButton.onPress = function () {
_root.picLoader.loadClip(_root.imageDat[0], "_root.picHolder");
}



//////
For some reason the onLoadProgress doesn't function and the onLoadComplete function executes even though the data isn't loaded, does anyone know why????

View Replies !    View Related
Moviecliploader Inside A Function
I have this code but the only way it works is when I call the loadclip method from outside the function...

I've tried with _root but I don't know how acces the moviecliploader declared outside the function.

thanks



ActionScript Code:
var cargador_loading:MovieClipLoader = new MovieClipLoader;listener_cargador_loading = {};listener_cargador.onLoadInit = function(){       //actions}    cargador_loading.addListener(listener_cargador);function cargar_loading(){       cargador_loading.loadClip(_root.ruta_loading,_root.cargando);}

View Replies !    View Related
MovieClipLoader And Passing Variables
Hello all.
I'm looking at the MovieClipLoader class, which seems to include a lot more functionality than loadMovie(). However, the one thing it seems to be missing (and the only thing I absolutely need) is the ability to send variables (using either GET or POST) to the new clip. loadMovie()'s third parameter is an optional string that specifies which HTTP method to use to pass variables, but I don't see any equivalent in MovieClipLoader.

I'm wondering if there's a way that I can pass variables to my new movie using MovieClipLoader. OR.... Use loadMovie(), but still have access to methods like onLoadError() and onLoadComplete().

View Replies !    View Related
MovieClipLoader And Defining Variables
Basic concept... using the MovieClipLoader function to load in several images into various actionscript defined movieclips. These movie clips, with images loaded into them, are going to have onRelease functions associated with them which will load in a larger version of the image already loaded. As you can picture, there are a series of thumbnails, and each thumbnail needs to be clickable and load a larger version of itself into an empty clip. However, I can't seem to define variables inside of the MovieClipLoader object as it's not technically a movie clip?

How might I know which larger file to load when one of the thumbnails is clicked? All the files are named all sorts of things, aren't in any particular order (user defined from a drag-n-drog UI)... I thought I was on the right track, until I realized I couldn't define variables within the empty clip holding the thumbnails... bummer.

Thanks.

View Replies !    View Related
MovieClipLoader Function And Assigning The Height
I am stucked in the middle... I had completed all most 80% of my project... but now I noticed a thing and since morning I am trying to fix it.. but no luck...
Can you please help me to fix this..

Here is my problem and code.

I am loading images from my XML file using a loop.
Then creating movieclips dynamically according to the number of nodes in XML
Then assigning the height, width and positions for my movie clips......

The problem is that the height, width, x position and y positions assigning to the movieclips are all same.
means the values from the last node is assigning.

See my code..
[quote]
ActionScript Code:
for(i=0; i<importSubtemplate.firstChild.childNodes[0].childNodes.length; i++){
attr = importSubtemplate.firstChild.childNodes[0].childNodes[i].attributes;
title = attr.title;

resources = attr.resources;
filename = attr.filename;
posx = attr.xcoord;
posy = attr.ycoord;
height1 = attr.height;
width1 = attr.width;

for(h=0; h<1; h++){  
var mc11:MovieClip = template_mc.createEmptyMovieClip("mc" + i+1, i+20);
var listener:Object = new Object();
listener.onLoadInit = function(target_mc:MovieClip){
target_mc._height = height1
target_mc._width = width1;
target_mc._x = posx;
target_mc._y = posy;
}
var mcl1:MovieClipLoader = new MovieClipLoader();
mcl1.addListener(listener);
mcl1.loadClip("images/" + filename, mc11);
}
}

View Replies !    View Related
MovieClipLoader Class Doesn't Allow Function Calls
I have functions within a movieClip that loads into a main movie. The functions operate with no problem when using loadMovie method, but I need to execute some script after loading so I switched to the movieClipLoader class instead.

Problem is, after the movieClip is loaded, any function calls from a keyframe (or even a button) are totally ignored.
What am I missing. Should I be doing something different?

here is my movieClipLoader code:








Attach Code

function navigate(myName){
var content_mc:MovieClip = _root.display_mc;//this is the display movieClip
var loadListener:Object = new Object();
loadListener.onLoadComplete = function(target_mc:MovieClip):Void {
_root.display_mc.gotoAndPlay(myName);//must go to a specific frame after loading. This works.
}
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
mcLoader.loadClip("data/" + clipToLoad + ".swf",_root.display_mc);
}
}

View Replies !    View Related
Moviecliploader Function How To Get Her Arguments? W Proxy.create()
I dont want it like the classic way
listenerThumbs.onLoadInit = function(target_mc:MovieClip) {

};
But with the Proxy.create class, how do I get the arguments of the moviecliploader? (ex: target_mc, loadedbytes, totalbytes)
Now I did it like this, but it has to be different.


Code:
var mclThumbs:MovieClipLoader = new MovieClipLoader();
var listenerThumbs:Object = new Object();
var mcThumb:MovieClip
listenerThumbs.onLoadStart = function(target_mc:MovieClip) {
mcThumb = target_mc
}
listenerThumbs.onLoadInit = Proxy.create(this, thumbLoaded, mcThumb);
mclThumbs.addListener(listenerThumbs);
mclThumbs.loadClip(url,mvcSrc);

View Replies !    View Related
MovieCliploader Doesn't Works With Array/variables
i m using moviecliploader for first time. i have made simple animation of images fading in and fading out.

After on image fade out another fades in.

i m loading every image in the same movie Clip


////////Here is the Code
image_no=image_no+1;
if(image_no>=_root.maximages)
{
image_no=0;
}

hell=_root.im[image_no]


myMCL2 = new MovieClipLoader();
myListener2 = new Object();
myListener2.onLoadComplete = function(targetMC){
_root.img_ld.play();
}


myMCL2.addListener(myListener2);

///////Code Ends Here


If i put this line before the last line it works well
myMCL2.loadClip("4.jpg", _root.img_ld.container);//load images into clip

If i put this line before the last line it works well
myMCL2.loadClip(hell, _root.img_ld.container);//load images into clip


Plz Help if any one can

View Replies !    View Related
Using Variables Created Inside A Function Outside The Function?
I am trying to use a variable I am creating inside of a function, outside of that function, but I seem to have a scope issue when I do this.

My code is:

Code:
function drawlines(centerx, centery, radius, radians){
var radiansSoFar:Number = 0

var piechart:MovieClip = new MovieClip();
piechart.name = "piechart"
piechart.x = stage.stageWidth/2;
piechart.y = stage.stageWidth/2;


stage.addChild(piechart);
}
but I want to make a function outside of this which removes the variable piechart, but because im so unfamiliar with how flash names instances now I have no idea how to do this.

It works if I define var piechart:MovieClip = new MovieClip() outside of the function, but this isnt very useful as I eventually need to create multiple movieclips dynamically and name them dynamically.

So basically how would make it so I would be able to use the code


Code:
function removeChart(chartname){
stage.removeChild(chartname)
}
to dynamically remove a movieclip I created in a function?

View Replies !    View Related
Help: Passing Variables (180 Variables) To Function
hi

if i have call function like this

Math.findMax(app1, app2, app3, app4, app5, app6, app7, app8, app9, app10, app11);

but the values i have to app180

i don't want to write all this

Math.findMax(app1, ... , app180); //!!??

how i can to called the function from app1 to app180

Math.findMax(FROMapp1, ... , TOapp180);

thanx

View Replies !    View Related
Preloading A MovieClipLoader() With A MovieClipLoader() Inside
Is it posible to make a preloader of a SWF that loads an external JPG?

Thanks

View Replies !    View Related
Preloading A MovieClipLoader() With A MovieClipLoader() Inside
Is it posible to make a preloader of a SWF that loads an external JPG?

Thanks

View Replies !    View Related
Function Variables Help
Could some one please help me out with this. I want to call on a function for navigation. Here is what I though would work.

function onClick(btn) {
if (btn == btn1) {
trace ("btn1");
}else if (btn == btn2) {
trace ("btn2");
}
}
The buttons have script attached like this.
Button 1:

on (release) {
_root.onClick(btn1);
}

Button 2:
on (release) {
_root.onClick(btn2);
}

Which ever button I press it always runs trace("btn1");
It doesn't seem to check the btn var.

View Replies !    View Related
Using Variables Sent To A Function
Hi,

I'm trying to use one function to perform a mouse event for 4 different buttons. Each button is located in a movie clip which calls the function on the appropriate event. My question is, how can I use the parameter passed from the buttons movie clip within the if statement inside the function? I'll illustrate an example below:

function mouseover (buttonname) {
_root.m_[buttonname].gotoAndPlay(2);
}

How do I carry the variable "buttonname" down to the if statement?

Thanks

View Replies !    View Related
Variables In Function ... Help
Ive been trying for a long time to give a variable for eks "_level10" and "_level11" and so on and then use it in a function but it doesnt work...

why does this not work:


Quote:




levelVar2 = "_level10";






Quote:




framesLoaded = (Math.ceil (( levelVar2.getBytesLoaded() / levelVar2.getBytesTotal()) * 100));






Of course this is not the whole script. But it works perfectly if i write _level10 instead of the variable levelVar2. Why cant I use the variable???


Help

View Replies !    View Related
Variables From A Function
it's possible to get a variable from a function, to work outside the funtion.

I mean, get the variable inside the funtion and turn in to another variable but outside the function?


thanks

View Replies !    View Related
[F8] Function & Variables
I am doing a flash-thing where someone should be able to bake different things.
There are a lot of things in the kitchen but there are only some of then that should be used for each cake.
So I started to work this function out that would define which things was selected. My idea was to give all the things a variabel.Choosen = 1. Not choosen = 0.
All of this would be inside a function. But somehow I cant get the varibel to change or is is someother mistake.
I have posted a small fla where the main thing is.

Anyone know how I can get the variabel to be 1 when the thing is slected and 0 when its not?

/Mattias

View Replies !    View Related
Get Variables Used In Function
How do I use variables created in functions in other places in my ActionScript?

View Replies !    View Related
Variables In Function Name
I am creating a series of function(one for each letter of the alphabet). I now ant to call these functions randomly, or based on user input. I have an array("A", "B",...) that stores the letter. I want to concat the function like something like this.

"letter" + array[i] + ()

I may be way off on how to do this, but the idea of calling a function with a variable in the name, is this possible? If so how can this be done?

thanks,
Bryn-

View Replies !    View Related
Function Variables?
Hello,

I have read numerous posts and still don't understand... I have an XML file loading a client list. The variable "client" displays the client name inside my loadXML function. How do I access that variable outside of that function?

Thanks for any help!

View Replies !    View Related
Variables In Function?
This is really driving me nuts. And I think it is just the variables are local or something. I have this variable that declares the speed for a certain bomb but when I use it inside the onEnterFrame it traces undefined. Then if I trace it outside the onEnterFrame it traces correctly. Is this because its not global?

game.bombs["s"+bombNum] = PbombS[random(PbombS.length)];
_root["bomb"+bombNum].onEnterFrame = function() {
this._y += 10;
trace(_root.game.bombs["s"+bombNum]);
}

View Replies !    View Related
Variables With Function
Ok, I have some code that makes a variable based on an MC's name:

menuToOpen=this+"menu"

which translates into _level0.but1menu

then I try to call a function with this:

menuToOpen.easeY(100)

but it doesn't work, yet it traces "_level0.but1menu", and trying the function as this:

_level0.but1menu.easeY(100) does work. Any idea why?

I've also attached a mock up if you want to see what I mean.

Thanks for any and al input, this one seems weird to me - but I'm sure there is a completely logical explanation. I've used the same sort of idea to open external swfs with no issue.

Thanks everyone,
Adam


///edit, nm, I got it

View Replies !    View Related
Variables In A Function
Hello, i think this might be a really dumb question , but anywausss. how do i get one function to recognize some of the variables that are created or modified inside another function

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