MovieClipLoader JPG Issue
Using MX 2004.
I am trying to load 4 external JPG's in the first frame, which are displayed about 15 frames later in the timeline.
It works locally, and it works online, but only when viewing from the machine that I develop on. So when I compile and upload from my office and view online, it works...when I get home, it doesn't work from there. My client also says that it is not working.
It can be viewed at this URL: http://motosavvy.com/fusebox/dsp_1col.cfm?page_id=58
Here is my AS in first frame:
code: var myMCL = new MovieClipLoader();//create an instance of MovieClipLoader myMCL.onLoadComplete = function (targetMC) { gotoAndPlay(2); testtext.text="loaded"; }
myMCL.loadClip("http://www.motosavvy.com/_FlashAds/" + this.image1_1,"mc1.image1"); myMCL.loadClip("http://www.motosavvy.com/_FlashAds/" + this.image2_1,"mc2.image1"); myMCL.loadClip("http://www.motosavvy.com/_FlashAds/" + this.image3_1,"mc3.image1"); myMCL.loadClip("http://www.motosavvy.com/_FlashAds/" + this.image4_1,"mc4.image1");
Any help is greatly appreciated.
FlashKit > Flash Help > Flash MX
Posted on: 10-03-2004, 03:14 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
MovieClipLoader Issue
Hi Forums!
I have a really stupid problem, I am trying to develop a snippet of code that takes data from an array (pulled from an XML), creates a movieclip for each of the items in the array, preloads the data, creates a loader whilst the item is loading, destroy the loader when it has finished loading and then display the loaded item (in order of the original data array) on the screen with xy coords taken from another array.
I am sure this is very simple, but so far my working script is extremely long and annoying, I am sure there is a class out there somewhere that handles all this simply, does anyone know?
Any input would be a great help!
MovieClipLoader Issue.
Hi forums,
I have a really stupid problem, I am trying to develop a snippet of code that takes data from an array (pulled from an XML), creates a movieclip for each of the items in the array, preloads the data, creates a loader whilst the item is loading, destroy the loader when it has finished loading and then display the loaded item (in order of the original data array) on the screen with xy coords taken from another array.
I am sure this is very simple, but so far my working script is extremely long and annoying, I am sure there is a class out there somewhere that handles all this simply, does anyone know?
Any input would be a great help!
MovieClipLoader + FLV In SWF Issue
Hey all,
I tried to use the MovieClipLoader with a FLV embedded in a swf and noticed that it starts to play before the onInit function.
Haven't tried it live but only with the simulation download from within flash.
Any ideas?
Thanks
MovieClipLoader - Path Issue?
ok..
my main timeline is only 1 frame long as everything is contained in movie clips.
i created a listener with this code on frame 1.
Code:
var myLoadListener:Object = new Object();
myLoadListener.onLoadStart = function(target_mc:MovieClip) {
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = myLoadListener.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
_root.varTotal = _root.varTotal + Number(loadProgress.bytesTotal);
_root.b_t.text = _root.varTotal;
trace(loadProgress.bytesTotal+" = bytes total at start");
};
myLoadListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
trace("onLoadProgress() called back on movie clip "+target_mc);
trace(loadedBytes+" = bytes loaded at progress callback");
trace(totalBytes+" = bytes total at progress callback");
};
// variable to hold total number of bytes to load.
var varTotal:Number = 0;
pretty much straight from the doco...
now for the complicated part. i'll attempt some ascii art
Code:
_root┐
└pic_container┐
└whole┐
├left
└right
ok lets break it down.
whole is a mc in my library which has two panels (left and right) mc's on it. they have the dimensions that i want. (i know i can use create clip functions, i just like being visual sometimes)
ok this is the code in the first frame of pic_container. it creates 5 instances of whole (will be 50 when i get this to work properly)
Code:
function initial_pics()
{
whole_count = 0;
for (i=1;i<=10;i++)
{
whole_count++;
new_whole = attachMovie("pic_whole","whole"+whole_count,i);
//trace(new_whole);
new_whole._alpha = 0;
var my_str:String = String(i);
while (my_str.length < 3) {
my_str = "0" + my_str;
}
//trace(my_str);
var leftLoader:MovieClipLoader = new MovieClipLoader();
leftLoader.addListener(_root.myLoadListener);
leftLoader.loadClip("images_folio/hamish"+my_str+".jpg",new_whole.left);
i++;
var my_str:String = String(i);
while (my_str.length < 3) {
my_str = "0" + my_str;
}
//trace(my_str);
var loadRight:MovieClipLoader = new MovieClipLoader();
loadRight.addListener(_root.myLoadListener);
loadRight.loadClip("images_folio/hamish"+my_str+".jpg",new_whole.right);
} // end of for loop
} // end of intial pics function
initial_pics();
now this works when i was just using loadMovie into the left and right mc's, but i want to make the thumbnail buttons that are placed elsewhere to be disabled until i have everything loaded.
now the onLoadStart function does get called.
the first trace returns this x 10 (with the pic name incremented)
"Your load has begun on movie clip = _level0.pic_con.whole1.left"
but the values of bytesLoaded and bytesTotal are undefined. I know that the load progress doesn't work in the test movie environment, so i tried it on a local webserver and also uploading it to a actual webhost. i still get the same result. The text field shows "NaN", i know that's because it tries to convert 'undefined' to a number.
ok this is a massive post and i tried to be as clear as possible.. hopefully there is a simple solution.
(like last night when i was debugging a php script for 5 hours just to find a ; between the closing bracket of if statement condition and the opening curly bracket and it's removal instantly rectified everything ).
MovieClipLoader Scope Issue?
I'm getting some strange behaviour from MovieClipLoader - it seems like a scope issue but i'm not sure how to get around it.
I have a class called Loader which receives requests for files to load - those requests create a MovieClipLoader (if they're requests to load a .swf file) and register themselves as listeners to the MCL - now all the functions fire ok - onLoadStart, onLoadProgress etc. no problems there, but when onLoadInit fires the request class suddenly loses its reference to the Loader class.
here's the relevant code.
Code:
class Loader
{
public function addItemToLoad(request:FileRequest)
{
request.setListener(this);
}
public function onLoadProgress(request:FileRequest):Void
{
// gets called.
}
public function onLoadComplete(request:FileRequest):Void
{
// doesn't get called.
}
}
class SWFFileRequest
{
private var loader:MovieClipLoader;
private var listener:Loader;
public function setListener(listener:Loader):Void
{
this.listener = listener;
createLoader();
}
private function createLoader():Void
{
loader = new MovieClipLoader();
loader.addListener(this);
}
private function onLoadProgress(target:MovieClip, loadedBytes:Number, bytesTotal:Number):Void
{
listener.onLoadProgress(this);
}
private function onLoadInit(target:MovieClip):Void
{
listener.onLoadComplete(this, target);
}
}
so when FileRequest.onLoadProgress is called it then calls Loader.onLoadProgress and everything is cool.
but when FileRequest.onLoadInit is called it loses it's reference to the listener object - it knows it's an object of type Loader cause i can trace the function and everything but it doesn't know anything about the object that was set in setListener().
it suggests to me that the scope of FileRequest.onLoadInit is different to the scope of FileRequest.onLoadProgress - but why? and what can i do about it?
has anyone else every encountered this?
NB. this is a reverse-engineering of a setup i have in my AS3 framework - which works like a dream with AS3's Loader and URLLoader classes - in AS2 there are allsorts of problems like this cropping up..
MovieClipLoader Security Issue?
I've built this flickr app that gets photolists, displays thumbnails, and loads the appropraite picture when you click on a thumbnail. It works totally fine when I test it just as a .swf.
When I put it on the web, my thumbnails still load, and all my data is still arriving from flickr, but the larger image won't show up when the user clicks on a thumbnail! I know that the Flash is loading the data of the image because I have a progress bar that is tracking the file being loaded, but when it is 100% I just get the background colour of the bitmap object I am drawing the image into.
I am baffled. The image data is being downloaded, but it won't display when I access the .swf through IE.
Anybody else have this problem, or can offer suggestions?
Thanks for any help!
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
MovieClipLoader Scope Issue
Hi all. I'm having a scope issue with the MovieClipLoader listeners in a Class: i can't call Class methods inside the MovieClipLoader listeners... i can turn all Class methods to Static, but that's not what i'm aiming for.
Can someone help ?
Congrats :)
Attach Code
private function loadFile ($file : String) : Void
{
var alpInit : Number
var alpEnd : Number
var $holder : MovieClip = getNextHolder () // this one get's called
$holder._alpha = $holder == __holder1 ? 0 : 100
__interval != undefined ? stopTimer () : null // this one gets called
var $clipLoaderListener : Object = new Object ()
$clipLoaderListener.onLoadInit = function (mc : MovieClip)
{
alpInit = $holder == __holder1 ? 0 : 100
alpEnd = $holder == __holder1 ? 100 : 0
var $tween : Tween = new Tween (__holder1, "_alpha", Regular.easeOut, alpInit, alpEnd, __transition, true)
__currentHolder = $holder
__currentPosition = __nextPosition
__nextPosition = SlideShow.getNextPosition () // this one gets called because its a static method
startTimer() // this one doesn't gets called
}
var $clipLoader : MovieClipLoader = new MovieClipLoader ()
$clipLoader.addListener ($clipLoaderListener)
$clipLoader.loadClip ($file, $holder)
}
Edited: 01/11/2008 at 06:25:36 PM by kidloco
MovieClipLoader + Sound Issue
I'm loading a bunch of swf-files via the MovieClipLoader. How can i mute the sound of the loaded swf's?
Those swf's contain embedded videos.
Issue With MovieClipLoader - OnLoadInit
hello.
i've come a accross an odd issue with the onLoadInit method of MovieClipLoader in the player version7 versus version8. i have a simple custom class that let's me load in an image and change the url, etc. not too much more that a wrapper for loading an image.
what is odd is that it works fine on the version8 player but doesn't work on version7 and however, all of the actionscript used is version7 compatable. i'll post the code below and then explain what is happening.
import nl.artichoke.mxExtensions.*
import mx.transitions.Tween;
import nl.artichoke.uiElements2.*
class nl.artichoke.uiElements2.AImage extends nl.artichoke.uiElements2.ElementActive {
private var _image:MovieClip;
private var _overlay:ABox;
private var _imageURL:String;
public function AImage(parentClip:MovieClip, level:Number, name:String, imageURL:String, styleObj:Object)
{
super(parentClip, level, name, "AImage", styleObj);
_imageURL = imageURL;
draw();
}
private function draw():Void
{
drawOverlay(2)
drawImage(1);
}
private function drawImage(level:Number):Void
{
_image = _boundingBox.createEmptyMovieClip("_image", level);
_image._alpha = 0;
if (_imageURL != null) { this.imageURL =_imageURL; }
}
public function set imageURL(urlString:String):Void
{
var ref:AImage = this;
var background_listener:Object = new Object();
background_listener.onLoadInit = function()
{
ref.__imageWidth = ref._image._width;
ref.__imageHeight = ref._image._height;
var alphaTween = new Tween(ref._image, "_alpha", mx.transitions.easing.Regular.easeInOut, ref._image._alpha, 100, ref.__imageFadeTime, true);
ref._overlay = ref.drawOverlay(2);
ref.dispatchEvent({type: "onImageLoaded", target: ref});
}
var background_mcl = new MovieClipLoader();
background_mcl.addListener(background_listener);
background_mcl.loadClip(urlString, _image);
}
private function drawOverlay(level:Number):ABox
{
var tempInit:Object = {boxBorderSize: 0, boxBorderColor: __imageBorderColor, boxFillColor: __imageOverlayColor, boxWidth: __imageWidth, boxHeight: __imageHeight };
var box = new ABox(_boundingBox, level, "_overlay", tempInit)
return box;
}
}
when the image loads, within the onLoadInit callback, the image width and height are unkown in version 7 for some reason, so i end up setting the image size to 0. It seems very odd.
if anyone has some insight into this, it would be greatly appreciated.
thank you,
aaron
MovieClipLoader Issue With Images
Has anyone else found a problem with loading images using the MovieClipLoader class? I have found that it has a problem reading the BytesTotal and it doesn't seem to be a flash based problem but rather a Browser problem. When I ran into the problem Fireworks was showing the Bytes Loaded and Bytes Total the same. WHere Internet Explorer 6 was showing the bytes Total as 0 all the way through. Camino for OSX was working fine. The images all loaded fine in the end but the data was wrong. I thought maybe this was security settings or something but I turned off my firewall and still had a problem. Then I tested it by bringing my images into flash and creating SWF files for each image. This fixed the problem, but of course it will not work for every situation. I am guessing a fix would be to have a preloader that detects the issue and if there is a problem it would just indicate that that the item is loading and not show detailed status, but if there is a fix that would be great. Also, I am wondering if anyone else has had this problem?
Please let me know and if I find a fix I will let you know
Also, it worked fine in the Flash Publish Preview Environment.
MovieClipLoader Event Issue
Hi, I'm new to the forum.. so Hello all.
I'm newish to OOP AS... trying to build a image loader that wipes between loads.
having trouble getting my onloadComplete event to call a method in the main body of the class. what am I missing?
class ScreenWipe
{
var screen:MovieClip;
var wipe:MovieClip;
var but:MovieClip;
var imageHolder:MovieClip;
var mcLoader:MovieClipLoader;
var oListener:Object;
function ScreenWipe (){
myLoader("img1.jpg", screen);
}
function doSomething(){
trace("called from onLoad Complete event");
}
function myLoader(url:String, target:MovieClip){
//Listener Objects
oListener = new Object();
oListener.onLoadStart = function (target_mc:MovieClip){
trace("Load Started");
}
oListener.onLoadComplete = function (target_mc:MovieClip){
trace("Load Complete");
doSomething();
}
//Loader
mcLoader = new MovieClipLoader();
mcLoader.addListener(oListener);
mcLoader.loadClip(url, target);
}
}
Thanks in advance...
MovieClipLoader/navigation Issue
Hi there,
Apologies if this has been covered before or seems like a stupid question!
I'm an Actionscript novice in Dublin, trying put together a friend's photographic website.
I used (and abused) sbeener's code that I found here
http://www.kirupa.com/developer/mx/photogallery.htm
to create 4 image galleries. This works amazingly on its own and I can see that once I figure this problem out, it will be easy to update his site as he gives me new material.
Thanks sbeener in advance!
I am trying to load each gallery into a main swf using this movieclip loader thingy
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip("commissioned.swf", "container");
but the external swf navigation buttons do not appear when I publish my main swf.
Any ideas on what I have wrong? I'm primarily a print designer/photographer and Actionscript scares the pants off me!!!!
sbeener's code:
/*
i wrote this code, but you can use and abuse it however you like.
the methods are defined in the order which they occur to make it
easier to understand.
*/
// variables ------------------------------------------
// put the path to your pics here, include the slashes (ie. "pics/")
// leave it blank if they're in the same directory
this.pathToPics = "";
// fill this array with your pics
this.pArray = ["C001.jpg", "C002.jpg", "C003.jpg", "C004.jpg", "C005.jpg", "C006.jpg", "C007.jpg", "C008.jpg", "C009.jpg", "C010.jpg", "C011.jpg", "C012.jpg", "C013.jpg", "C014.jpg", "C015.jpg", "C016.jpg", "C017.jpg", "C019.jpg", "C020.jpg", "C021.jpg", "C022.jpg"];
this.fadeSpeed = 3;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads an image automatically when you run animation
loadMovie(this.pathToPics+this.pArray[0], _root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within pArray.length
this.pIndex = (this.pIndex+d)%this.pArray.length;
if (this.pIndex<0) {
this.pIndex += this.pArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(this.pathToPics+this.pArray[this.pIndex]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
// Actions -----------------------------------------
// these aren't necessary, just an example implementation
this.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
this.changePhoto(-1);
} else if (Key.getCode() == Key.RIGHT) {
this.changePhoto(1);
}
};
Key.addListener(this);
MovieClipLoader.onLoadProgress Issue
just in case you've never used the MovieClipLoader class but happen to come across it in the future, please read the livedocs comments below before using it:
http://livedocs.macromedia.com/flash...=00001574.html
follow the link : MovieClipLoader.onLoadProgress
visit the link before you get frustrated and start wondering what the hell is going on!
Weird MovieClipLoader Scope Issue
I have a straight forward script that loads 4 jpg's using the moviecliploader.
I'm loading each image into its own container. This works fine when the containers are created within the root level..
Code:
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace(target_mc);
};
var myMC:MovieClipLoader = new MovieClipLoader();
myMC.addListener(mclListener);
images =new Array("h1", "h2", "h3", "h4");
for (n=0; n<images.length; n++) {
var im = _root.createEmptyMovieClip("pic"+n, this.getNextHighestDepth());
myMC.loadClip("images/"+images[n]+".jpg",im);
}
The "onLoadInit" handler traces all 4 containers and all images appear.
But when I try to great an intermediate container to hold the image containers like so:
Code:
test = _root.createEmptyMovieClip("t", this.getNextHighestDepth());
var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
trace(target_mc);
};
var myMC:MovieClipLoader = new MovieClipLoader();
myMC.addListener(mclListener);
images =new Array("h1", "h2", "h3", "h4");
for (n=0; n<images.length; n++) {
var im = test.createEmptyMovieClip("pic"+n, this.getNextHighestDepth());
myMC.loadClip("images/"+images[n]+".jpg",im);
}
The "onLoadInit" handler only traces the last image..and only the last image appears to be loaded.
Has anyone experienced this problem or have a solution?
Thanks a bunch!
MovieClipLoader And Image Resizing Issue
I have a whole bunch of dynamically loaded buttons that I load in and out of memory as they are scrolled, sort of like a bank switching method. The problem is the images on each button loaded using MovieClipLoader. I use it to resize the image once they are loaded to the size of the button. The problem is even if I turn off the visibility of the image MovieClip before it's loaded sometimes the fullsize image will quickly display before it's resized. I can't figure out why it's doing this, any ideas?
ActionScript Code:
function loadImage(filename:String) {
_mc["controlBack"+_index].createEmptyMovieClip("controlImage", _mc["controlBack"+_index].getNextHighestDepth());
_mc["controlBack"+_index].controlImage._visible = false;
mclListener.onLoadInit = Delegate.create(this, this.imageLoaded);
var my_mcl:MovieClipLoader = new MovieClipLoader();
my_mcl.addListener(mclListener);
my_mcl.loadClip(filename, _mc["controlBack"+_index].controlImage);
}
function imageLoaded(target_mc:MovieClip, status:Number):Void {
target_mc._x = 14;
target_mc._y = 14;
target_mc._width = 120;
target_mc._height = 120;
target_mc._visible = true;
}
Custom Classes And MovieClipLoader Issue...
Hi everybody...
i am creating an animated thumbnail menu.
To build the animation i wrote a very simple custom class (using class ClassName extends movieclip).
to load the actual thumbs i use this code :
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener); image_mcl.loadClip(thumbnails[j],this["thumb"+(j)]);
Where this["thumb"+(j)] are my class customized animated movie clips.
The problem that i am having is that the loadclip method seems to be interfering with the custom properties i wrote in my class.
Everything is fine for properties like _x, but i can see the poperties i wrote going form a defined value to "undefined" once that method is called.
Has anyone had a similar problem before?
Am i doing something wrong or there is a clash in the datatypes?
If anybody could help please ....
D
External SWF, MovieClipLoader, Strange Issue
Code:
var swfLoader:MovieClipLoader = new MovieClipLoader();
When loading external swf using above method, I am getting a strange issue. Couple of my external swf's have auto slideshow, 3rd party components etc.
When you load a swf very first time, it loads properly and play. How ever when I load the same swf again, I get weird things. slideshow jumps, flicks, hang in swf.
Do I have to create a new movie clip every time in which I am loading my contents and resize in AS to the size of swf? and before loading another swf I have to use
'unloadMovie' command?
Regards
Moviecliploader: Preloader Issue W/absolute Path
I have several html pages located in several folders while master swf located in different folder with essential swfs: preloader, nav, trigger (that are to load into master via moviecliploader function). The master swf ueses the absolute paths instead of relatative paths to load swfs due to pages being located in different folders. It was able to load all essential swfs, bummer the preloader won't show the progress of preloading mc if path's absolute.
Frame 1:
Code:
stop();
// create new mc
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
// preloader function to load mcs
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}
// hide preloader after load level5 mc
myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}
// trigger level5 to load into stage
myMCL.loadClip("http://www.test/swfs/trigger.swf", 5);
// trigger preloader to load into stage
myMCL.loadClip("http://www.test/swfs/preloader.swf", 50);
Frame 5:
Code:
stop();
myMCL.loadClip("http://www.test/swfs/nav.swf", 5);
any suggestion or alternative to address ths issue?
Jace
Moviecliploader: Preloader Issue W/absolute Path
I have several html pages located in several folders while master swf located in different folder with essential swfs: preloader, nav, trigger (to be load into master via moviecliploader function). So I use the absolute paths instead of relatative paths to load swfs, but the preloader seem doesn't work by show the preloading progress with mc if path's absolute.
Frame 1:
Code:
stop();
// create new mc
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
// preloader function to load mcs
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
_level50._visible = true;
var preloadPercent:Number = Math.round((loadedBytes / totalBytes) * 100);
_level50.preloader.gotoAndStop(preloadPercent);
}
// hide preloader after load level5 mc
myListener.onLoadComplete = function(target_mc:MovieClip) {
_level50._visible = false;
}
// trigger level5 to load into stage
myMCL.loadClip("http://www.test/swfs/trigger.swf", 5);
// trigger preloader to load into stage
myMCL.loadClip("http://www.test/swfs/preloader.swf", 50);
Frame 5:
Code:
stop();
myMCL.loadClip("http://www.test/swfs/nav.swf", 5);
any suggestion?
Friggin' Mick
Loaded Navigation Menu Via MovieClipLoader And MouseOve Events Issue...
Hello,
I have been at it for the past two days and cannot seem to get this going, I would highly appreciate your help with this. I have movie called "menus.swf" within it, I have four nav buttons: LINK 1, LINK 2, LINK 3, LINK4.
I load this movie via MovieClipLoader on to the stage and initialize it via onLoadInit. Once it is loaded, I am able to click the links and all works well. I want to be able to use dynamic mask and show only the top part of the loaded movie so when user rolls the mouse over it, it pops up with ease and use can then click the desired link, and as soon as the mouse is not over it, movie eases back into its original position. I have tried tons of strategies such:
hitTest(), time driven event.....and so on.
I am able to load the movie without any issue but once I place an ease tween on it, Tween works but an not able to click on any nav links. I have spent hours and hours but cannot seem to get this functionality going. I would highly appreciate all your help. I am also including my files as well.
Thanks a lot
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
_global.gRoot = this; // GLOBAL gROOT DECLARED
//MENU SHELL IS CREATED
var MenuShell:MovieClip = gRoot.createEmptyMovieClip("mShell", 1);
//MENU BACKGROUD CREATED
var MenuBg:MovieClip = MenuShell.createEmptyMovieClip("mBg", 2);
//MENU LOADER CREATED
var MenuLoader:MovieClip = MenuShell.createEmptyMovieClip("mLoader", 3);
//MENU SHELL POSITION INITIALIZED
MenuShell._x = 150;
MenuShell._y = 150;
//MOVIECLIPLOADER OBJECT CREATED
var myLoader:MovieClipLoader = new MovieClipLoader();
//MYOBJ IS DECLARED WITH FOR IN LOOP TO READ ME LOADED MENU LINKS
var myObj:Object = new Object();
//ONLOADINIT FUNCTION
myObj.onLoadInit = function(target:MovieClip)
{
for(var a in target)
{
for(var b in target[a])
{
target[a][b].onRelease = function()
{
if(target[a][b])
{
switch(this)
{
case mShell.mLoader.menus.link1:
trace("link 1");
break;
case mShell.mLoader.menus.link2:
trace("link 2");
break;
case mShell.mLoader.menus.link3:
trace("link 3");
break;
case mShell.mLoader.menus.link4:
trace("link 4");
break;
}
}
}
}
}
}
//LOADING THE MENUS.SWF IN MENULOADER MOVIE ON RUNTIME
myLoader.loadClip("movies/menus.swf", MenuLoader);
myLoader.addListener(myObj);
[/cod
[CS3] Still Having Clock Time Zone Issue---and Dynamic Text Box Issue
I'm trying to do a clock that displays another time zone. The problem I'm having is that instead of running on a 12 hour clock, its on a 24hr one.
any insight as to how I can change the time?
Currently the clock is displaying
23:00p-Jul.22
I want it to display 11:00p-Jul.22
var dayText:String;
var dateText:String;
var monthText:String;
var AmPm:String;
_root.onEnterFrame = function() {
var myDateate = new Date();
//var sec:Number = myDate.getSeconds();
var min:Number = myDate.getMinutes();
var hour:Number = myDate.getHours();
var day:Number = myDate.getDay();
var date:Number = myDate.getDate();
var month:Number = myDate.getMonth();
//var year:Number = myDate.getFullYear();
//sec = sec<10 ? "0"+sec : sec;
min = min<10 ? "0"+min : min;
//AM/PM
if (hour>12) {
hour = hour-12;
AmPm = "p";
} else {
AmPm = "a";
}
//day
if(date == 1 || date == 21 || date == 31) {
dateText = date+"";
} else if(date == 2 || date == 22) {
dateText = date+"";
} else if(date == 3 || date == 23) {
dateText = date+"";
} else {
dateText = date+"";
}
//month
if (month == 0) {
monthText = "jan";
} else if (month == 1) {
monthText = "feb";
} else if (month == 2) {
monthText = "mar";
} else if (month == 3) {
monthText = "apr";
} else if (month == 4) {
monthText = "may";
} else if (month == 5) {
monthText = "jun";
} else if (month == 6) {
monthText = "jul";
} else if (month == 7) {
monthText = "aug";
} else if (month == 8) {
monthText = "sep";
} else if (month == 9) {
monthText = "oct";
} else if (month == 10) {
monthText = "nov";
} else if (month == 11) {
monthText = "dec";
}
//display
dateDisplay.text = hour+":"+min+ AmPm + "-" + monthText+"."+ dateText;
};
MovieClipLoader
Hi,
I try to load an image into a nested clip so I can make it react to a onRollOver. With the MovieClipLoader object that doest't seem to work.
Why why why??
thanks,
Axel
MovieClipLoader
hi,
In 2004 the MovieClipLoader object doesn't load an image into a nested movieClip. Why is that? I need that because I want the loaded image to have onRollOver event attached. Don't tell me I have to use the loadMovie command again.
anyone
p-p-p-please
MovieClipLoader()
HI,
I'm trying this function for the first time, and I can't make the "onLoadComplete" function work properly.
I can see my movie loaded right, but "loaded" doesn't appear in my output window. Anyone have a clue about what I'm doing wrong?
Code:
var mc = new MovieClipLoader();
myListener.onLoadComplete = function() {
trace("loaded");
};
mc.addListener(myListener);
mc.loadClip("fr/100accueil.swf", "contenu");
Thanks! Julie
Help With MovieClipLoader
i'm trying to make a MovieClipLoader. this is the code i'm using:
var fadeInterval:Object = new Object();
fadeCoverInt = setInterval(functionName, interval, targetMC);
function fadeCoverIn(targetMC) {
targetMC._alpha = targetMC._alpha+5;
if (targetMC._alpha>95) {
targetMC._alpha = 100;
removeMovieClip("holder"+(n-1));
clearInterval(fadeCoverInt);
}
}
//
var loadCoverListener:Object = new Object();
loadCoverListener.onLoadStart = function(targetMC:MovieClip) {
loadStatus._xscale = 0;
loadStatus._visible = true;
};
loadCoverListener.onLoadProgress = function(targetMC:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
loadStatus.bar._xscale = Math.round(bytesLoaded/bytesTotal*100);
};
loadCoverListener.onLoadComplete = function(targetMC:MovieClip) {
loadStatus._visible = false;
setInterval(fadeCoverIn, 10, targetMC);
};
loadCoverListener.onLoadInit = function(targetMC:MovieClip) {
targetMC._alpha = 0;
targetMC._x = 5;
targetMC._y = 60;
targetMC.setMask(mask);
};
//
var loadCover:MovieClipLoader = new MovieClipLoader();
loadCover.addListener(loadCoverListener);
//
n = 1;
this.createEmptyMovieClip("holder"+n, n);
loadCover.loadClip("images/covers/cover"+(random(6)+1)+".jpg", "holder"+n);
//
stop();
i also made a button so that it loads different images randomly.
the problem that i'm having is that the loadStatus.bar scale doesnt seem to change along with the progression with the image loading.
also when i press the button to load the other pics. the loadStatus movie clip doesn't appear again.
what am i doing wrong here??
MovieClipLoader
hi,
I'm loading jpgs from an array into a mc on the stage, but I'd like to use the movieClipLoader class instead of what I'm using now (loadMovie). loadMovie is working fine, but I'd like to do things that movieClipLoader lets you to do (like do functions when "onLoadStart" happens and so on).
//It's just a normal array setup right in the code
arrayrow=[
["../pics/Nicholas.jpg","Here's Nicholas","King","N","_","jpg","0"],
["../pics/BM.jpg","BM","King","N","_","jpg","0"],
["../pics/Jen","_","King","N","_","jpg","0"],
["../pics/Stores.jpg","Shopping","King","N","_","jpg","0"],
// .........
["../pics/church.jpg","Voice","King","N","_","swf","0"]
];
//and this is my loader:
if (TargetIN._alpha<10) {
loadMovie((arrayrow[counternumber-1][0]), TargetIN);
CurrentName = (arrayrow [counternumber-1][1]);
Street1 = (arrayrow[counternumber-1] [2]);
StreetDirection = (arrayrow [counternumber-1][3]);
//..and so on...
This works fine with loadMovie, but when I try movieClipLoader, it loads nothing:
var my_mcl:MovieClipLoader = new MovieClipLoader ();
//then to replace the "loadMovie" with "loadClip":
if (TargetIN._alpha<10) {
my_mcl.loadClip((arrayrow[counternumber-1][0]), TargetIN);
CurrentName = (arrayrow [counternumber-1][1]);
Street1 = (arrayrow[counternumber-1] [2]);
StreetDirection = (arrayrow [counternumber-1][3]);
//..and so on...
It works the first way but not the second way. Don't know whats not right here.
thanks for your help
Help With Moviecliploader
I was wondering if someone could tell me what I'm doing wrong in the following chunk of code. I'm trying to set an onRelease to each dynamically attached movie clip.
Also, this code loads the same image over and over again within the for loop. cardNum is always different if I do a trace on it within the loop, so I'm not sure what's up there either...
Code:
myXMLData = new LoadVars();
myXMLData.flashIdentity = "___";
myXMLData.question = "getCategories";
myCategoryReplyXML = new XML();
myCategoryReplyXML.ignoreWhite = true;
myCategoryReplyXML.onLoad = myOnLoad;
myXMLData.sendAndLoad("http://www.___.com/service.php", myCategoryReplyXML);
myScrollPane.contentPath = "holder";
var sContent:MovieClip = myScrollPane.content;
myMCL = new MovieClipLoader();
myListener = new Object();
myMCL.addListener(myListener);
myListener.onLoadComplete = function(targetMC)
{
targetMC.onRelease = function()
{
trace ("HIT");
}
}
function myOnLoad(success:Boolean) {
if(success){
xmlNode = this.firstChild;
total = xmlNode.childNodes[0].childNodes.length;
depth = 10;
y = 40;
for (i=0; i<total; i++) {
cardNum = xmlNode.childNodes[0].childNodes[i].attributes.value;
var aClip:MovieClip = sContent.attachMovie("cardButton", "attachedClip_" + i, depth);
myMCL.loadClip("images/category_source/"+ cardNum +".jpg" , "attachedClip_" + i);
aClip._x = 60;
aClip._y = y;
depth+=1;
y+= 80;
}
}
}
Need Some MovieClipLoader() Help...
i am trying to use MovieCLipLoader (which i have not used before) to load external files into my main. onLoadComplete i want to trigger a fade in, but if already file viewing is at _alpha = 100, fade out, then load the next swf file and fade it in.
I'm having trouble because of how i set up the menu.. i don't know where to place the MovieClipLoader script. I can make it work in a generic stripped down test, but when i have to mesh it in with the menu script, i get confused.
ok.. menu is set up with different flags to trigger different menu actions, the btn mc's set those flags. this is contained with those mc's (instance name bg_mc) this all worked fine when i was using a "loader" mc with transitions in and out.. but all i need is a fade, and i want to be able to use the MovieClipLoader listeners.
Code:
this.onRollOver = function() {
_parent.selectItem(id);
};
//
this.onRollOut = bg_mc.onReleaseOutside=function () {
_parent.deselectItem(id);
};
//
this.onPress = function() {
_parent.clickItem(id);
clickedItem = itemId;
//trace(this)
};
then this is in the main menu mc to control the visuals:
Code:
function selectItem(itemId) {
growTime = 0;
selectMe = itemId;
totalWidth = maxWidth+(items_arr.length)*(minWidth+space)-space;
}
//--------------------------------------------------
function deselectItem(itemId) {
growTime = 0;
selectMe = clickedItem;
}
//--------------------------------------------------
function clickItem(itemId) {
if (itemId != clickedItem) {
clickedItem = itemId;
_root.LoadMe = itemId;
//this relates to a variable set in the first frame of main timeline
//to call the proper movie. i.e. if itemId = 0, it loads "section0.swf"
trace("Load Me ---> : section "+_root.LoadMe);
}
}
I tried doing the following (with a million variations) and no success:
Code:
function clickItem(itemId) {
if (itemId != clickedItem) {
clickedItem = itemId;
_root.LoadMe = itemId;
//this relates to a variable set in the first frame of main timeline
//to call the proper movie. i.e. if itemId = 0, it loads "section0.swf"
if (_root.container._alpha == 0) {
var loadListener:Object = new Object();
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
mcLoader.loadClip("section"+_root.LoadMe+".swf", _root.container);
loadListener.onLoadComplete = function() {
trace("Begin Fade In...");
_root.container.onEnterFrame = function() {
this._alpha += 10;
if (this._alpha>=100) {
this._alpha = 100;
delete (this.onEnterFrame);
}
};
};
} else if (_root.container._alpha == 100) {
_root.container.onEnterFrame = function() {
this._alpha -= 10;
if (this._alpha<=0) {
this._alpha = 0;
delete (this.onEnterFrame);
trace("Fade Out...");
var loadListener:Object = new Object();
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(loadListener);
mcLoader.loadClip("section"+_root.LoadMe+".swf", _root.container);
loadListener.onLoadComplete = function() {
_root.container.onEnterFrame = function() {
this._alpha += 10;
if (this._alpha == 0) {
this._alpha = 100;
delete (this.onEnterFrame);
trace("Fade In...");
}
};
};
}
};
}
trace("Load Me ---> : section "+_root.LoadMe);
}
}
also tried create the movieClipLoader in the _root timeline, instead of within the menu but that didn't work either... I'm stuck..
can anyone help me out? would it be better if i used a mask and just told that to play() to fade in and out?
edit:
it actually starts to work properly it will fade on swf in to about 29% (according to the trace i did) but then it won't load another movie, or fade out.. i just can't make fade all the way in...
Moviecliploader Help
Hello I am newby ActionScript peer,
I am building a preloader for my flash intro.
Inside my preloader I want to load my intro.swf. But the problem is that the movie starts playing before the download is complete. I tried it on a JPG and it works perfect. Somehow I have the feeling that I missed something.
Here is the AS;
var myMCL:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myMCL.addListener(myListener);
myListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
var loaded:Number = Math.round((bytesLoaded/bytesTotal) * 100);
progressBar.gotoAndStop(loaded);//progressBar contains 100 frames
}
myListener.onLoadInit = function (target_mc:MovieClip) {
progressBar._visible = false;
}
myListener.onLoadStart = function (target_mc:MovieClip) {
progressBar._visible = true;
}
myMCL.loadClip("intro.swf", "container");
Can please give me some tips on how getting it to work properly.
Thanx
Peer
How To Use .MovieClipLoader?
hey guys
ive been trying to find tutorials on how to use moviecliploader to make sure things are done loading in before it continues running the script and im just not understanding any of the tutorials
here is the code I have right now:
onClipEvent(load) {
this._visible = false;
myXML = new XML();
myXML.onLoad = addphoto;
myXML.ignoreWhite=true;
myXML.load(_parent.xmlDoc);
function addphoto(success) {
thelevel=_root.getNextHighestDepth();
for(i=0;i<myXML.firstChild.childNodes.length; i++){
inXML=myXML.firstChild.childNodes[i].attributes;
_root.createEmptyMovieClip("photo"+i, thelevel);
_root["photo"+i].loadMovie(inXML["location"], thelevel);
trace("photo"+i);
}
}
}
and I want to use MovieClipLoader in place of that last loadMovie and then I want something that checks to make sure it is completely loaded before it continues running the script. PLEASE HELP.. im completely stuck untill I figure this out.
[F8] Php - MovieClipLoader
Hi,
something very strange is occuring with a MovieClipLoader Class I wrote, a php script that only generates thumbs with GD Library and the browsers Safari, Explorer and Firefox (all mac). All I want to do is to load several (26 in this case) thumbnails into movieclips with my MCL class.
1. the php script is not the problem. Works perfectly in other projects and does not return any error if I call it directly.
2. the class I wrote worked fine up until now, but since I wrote it I am afraid that is where the problem lies.
3. In Firefox everything goes just fine. That's the surprising part. Whereas in Explorer and Safari I get the error that some script is causing the flash player to run slowly. Sounds like some indefinite loop, but i can't find it.
Here is my simplified MCL class:
Quote:
class MCL {
... vars...
public function MCL() {
mcl = new MovieClipLoader();
mcl.addListener(this);
}
public function loadPath(path:String, mc:MovieClip){
mcl.loadClip(path, mc);
}
public function onLoadStart(target){
...
}
public function onLoadProgress (target, bytesLoaded, bytesTotal){
...
}
public function onLoadInit(target){
...
}
public function onLoadError(target, errorCode, httpStatus){
...
}
}
The instances are created in a for (i=1; i<=26; i++) loop, which doesn't cause any problem if I take out the thumb loading part.
Why does it work in Firefox??? What does Firefox do differently?
I hope someone can help me out here. I've written a very ugly alternative, but that is not the idea of a class, is it.
thanks!
[F8] MovieClipLoader
I hope someone here can shed some light...
I can't get my head round the MovieClipLoader class...
I have a movieclip that I want to dynamically load 25 jpgs at different depths, for which i use this code inside a container clip:
Code:
for (i=1;i<25;i++){
newPattern(i);
}
function newPattern(n:Number):Void {
this.createEmptyMovieClip("pattern"+n, this.getNextHighestDepth());
var mc:MovieClip = eval("pattern"+n);
mc.loadMovie ("images/"+i+".jpg");
}
how do I add a MovieClipLoader to this? do I add the mcl to the container clip? or to each image inside the container?
Any help is much appreciated.
Thanks
MovieClipLoader
Hi there
I've been using a tutorial which deals with the MovieClipLoader which is working fine but I need to add some extra functionality which I need some help with.
I have a stop action on the first frame of my external swf (movie.swf) and once it's loaded and reached 100% I want to go to and play frame 2.
So I presume I need add an if else loop to check the total but am having trouble with this. Any help would be great.
thanks - jb
Here's my current code;
Code:
stop();
var mcl:MovieClipLoader = new MovieClipLoader();
var mclL:Object = new Object();
mclL.onLoadProgress = function (target,loaded,total) {
loader.percent.text = Math.round ((loaded/total) * 100) + "%";
}
mclL.onLoadInit = function () {
loader._visible=false;
loader.percent.text = "";
}
// register events
mcl.addListener(mclL);
mcl.loadClip("movie.swf", holder);
MovieClipLoader Bug?
Has anyone else had this issue?
My site uses 1 movie clip loader to load in several images on demand. But if you click the button to load another image while the loader is trying to connect to a different image, it loads the new image, and then once the new image loads, the old image now takes its place. This only happens when it is connecting, not actually loading. Before you even see a progess bar.
I need to find a way to cancel the previous load completely before loading a new image.
Your thoughts?
[F8] MovieClipLoader
Please guys,
I need some help figuring out a situation, Is it posible to create an empty movieclip, then load a picture into that clip and at the same time apply a motion tween to the clip?
Example:
Code:
var PFplacer = this.createEmptyMovieClip("PFContainer", "5");
var PF_mc:MovieClipLoader = new MovieClipLoader();
PF_mc.loadClip("tween.swf","PFContainer");
}
how do i apply a motion tween to PF_mc
Im trying to use mx.transition.tween.easeInOut.
ple some one help me I still learning flash.
jane
Plz Help .flv V.S. MovieClipLoader
Is there any known issues with loading a .flv video and images loaded via movieClipLoader? .......Because when a video starts it makes all of my loaded .jpg blink.
[F8] MovieclipLoader
it is possible to have to different movieclip loader class in the main scene? if its possible van you show me how to do it please?
MovieClipLoader
Is MovieClipLoader something that is only in 8 and not in MX?
I've been reading alot about Flash, and have Flash MX. I have the lynda training for flash 8 and thusfar have been able to breeze through all the training w/o any difficulties. then i arrived at MovieClipLoader...the lynda instructor has you enter this script in -
var myMCL:MovieClipLoader = new MovieClipLoader();
myMCL.loadClip("movie2.swf", "container");
with container being an movie clip instance that it will load into. well i can't get it to work with that script, which interferes w/ lessons later on that deal w/ the preloader. I did however manage to load it with -
loadMovie("movie2.swf", "container");
this seemed much easier for me, and well it worked lol...i was surprised to see that lynda did not teach the more simple way of doing this, but i assume its because this way makes later difficulties w/ the preloader n what not. anyhooo sry to be long winded, but is MovieClipLoader something that is only in 8 and not in MX? if so is there a better way to rewrite the script lynda suggested than the way i did it?
go easy on me, i'm very new to this world, and again, sry to be long winded thanks for your time
MovieClipLoader
Hello! I'm try to load image:
Code:
f (_root.change_im==1){
this.createEmptyMovieClip("container", this.getNextHighestDepth());
var listener:Object = new Object();
listener.onLoadInit = function(target:MovieClip) {
trace("load init");
target._x = 0;
target._y = 0;
}
listener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("ERROR!");
switch (errorCode) {
case 'URLNotFound' :
trace(" Unable to connect to URL: "+target_mc._url);
break;
case 'LoadNeverCompleted' :
trace(" Unable to complete download: "+target_mc);
break;
}
};
listener.onLoadStart = function(target_mc:MovieClip) {
trace("load started");
};
listener.onLoadComplete = function(target_mc:MovieClip){
trace("Load complite");
}
var mcLoader = new MovieClipLoader();
mcLoader.addListener(listener);
mcLoader.loadClip(_root.base_url + "texture" +_root.cur_image+ ".jpg", container);
trace(_root.base_url + "texture" +_root.cur_image+ ".jpg");
_root.change_im = 0;
}
In result i have trace with filename. What am I doing wrong?
MovieClipLoader
for (var j = 0; j<splittemplate.length; j++){
if(splittemplate[j] == "image"){
for(k=0; k < 1; k++){
var resourses = importXMLtemplate.firstChild.childNodes[j].attributes.resources;
var images = importXMLtemplate.firstChild.childNodes[j].attributes.filename;
var posx = importXMLtemplate.firstChild.childNodes[j].attributes.xcoord;
var posy = importXMLtemplate.firstChild.childNodes[j].attributes.ycoord;
var heigh = importXMLtemplate.firstChild.childNodes[j].attributes.height;
var containermain:MovieClip = _root.createEmptyMovieClip("container_maintemp" + j, j+100);
var listener:Object = new Object();
containermain._y = posy;
containermain._x = posx;
listener.onLoadInit = function(target_mc:MovieClip){
trace(posx);
target_mc._height = heigh;
}
var mcl:MovieClipLoader = new MovieClipLoader();
mcl.addListener(listener);
mcl.loadClip("images/" + images + ".jpg", containermain);
}
}}
Dear friend,
I had loaded the images from the XML file using MovieClipLoader function. Here three images are loading when I set the height inside the onLoadInit function the height of all movie clips are becoming the same.
I want to chenge height of each images related to the XML value which is stred in variable heigh.
I tried to trace the variable heigh, it is returning the height value of the last node from the XML file.
Is there anyway to do this.... or I have to write another for loop for creating different for different images. I am totally confused....
please help
MovieClipLoader Help
I've tried google many times to try and find how to get this functioning, but no luck.
i have a loader.swf which has the movieClipLoader setup to load in the intro.swf on level1 which works fine. However, how do I get it to function from within the intro.swf when clicking on an element, load a completely different swf (world.swf) in its place on level1?
this is the movieClipLoader code i am using.
Code:
stop();
// listeners
var my_mcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
myListener.onLoadStart = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load has begun on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at start");
trace(loadProgress.bytesTotal+" = bytes total at start");
};
myListener.onLoadProgress = function(target_mc:MovieClip, loadedBytes:Number, totalBytes:Number) {
trace("*********First my_mcl instance Progress*********");
trace("onLoadProgress() called back on movie clip "+target_mc);
trace(loadedBytes+" = bytes loaded at progress callback");
trace(totalBytes+" = bytes total at progress callback");
};
myListener.onLoadComplete = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Your load is done on movie clip = "+target_mc);
var loadProgress:Object = my_mcl.getProgress(target_mc);
trace(loadProgress.bytesLoaded+" = bytes loaded at end");
trace(loadProgress.bytesTotal+" = bytes total at end");
};
myListener.onLoadInit = function(target_mc:MovieClip) {
trace("*********First my_mcl instance*********");
trace("Movie clip = "+target_mc+" is now initialized");
};
myListener.onLoadError = function(target_mc:MovieClip, errorCode:String) {
trace("*********First my_mcl instance*********");
trace("ERROR CODE = "+errorCode);
trace("Your load failed on movie clip = "+target_mc+"
");
};
my_mcl.addListener(myListener);
// Now load the files into their targets.
// loads into movie clips
my_mcl.loadClip("intro.swf", 1);
// my_mcl.removeListener(myListener);
MovieClipLoader
Why does this trace false and what am I doing wrong?
ActionScript Code:
var changer:MovieClipLoader= new MovieClipLoader();
var ecoute:Object=new Object();
changer.addListener(ecoute);
trace(changer.loadClip("D:FlashProjectsThe Infidel Gamemapsmap1 ilesgrass.jpg",loadimageshere_mc));
Btw I tried putting "loadimageshere_mc" as well with no effect...
and I don't think it's the backslashes either...
Help With MovieClipLoader
So I have been using the MovieClipLoader class for a site that I am developing for a client. After the site was all built they came back and said we would like these items to fade out before opening the next page. Dose any one know how to do this with the MoveClipLoader class? Thanks for any help you can provide.
MovieClipLoader Help
Hello,
I've been reading over the help files and the MovieClipLoader tutorial but I don't seem to be seeing the problem with my code. Is my problem one of syntax? It seems like the onLoadStart et al functions don't seem to even get called. Am I misunderstanding how the moviecliploader is supposed to work?
ActionScript Code:
var myMCL:MovieClipLoader = new MovieClipLoader();
var myMCListener:Object = new Object();
function makePort(){
var box:MovieClip=attachMovie("portMC","portrait_mc",this.getNextHighestDepth());
trace(pfold+nme+".jpg"); // this is correct, but it is the only trace action that prints a message
myMCL = box.loadClip(pfold+nme+".jpg",box.getNextHighestDepth()); //this seemingly does nothing.
}
myMCListener.onLoadStart=function(tMC){
var lP = myMCL.getProgress(tMC);
myTrace ("movie clip: " + targetMC);
myTrace("Bytes loaded at progress callback=" + loadedBytes);
myTrace("Bytes total at progress callback=" + totalBytes);
}
myMCListener.onLoadComplete=function(tMC){
var lP = myMCL.getProgress(tMC);
myTrace (targetMC + " has finished loading.");
myTrace("Bytes loaded at end=" + lP.bytesLoaded);
myTrace("Bytes total at end=" + lP.bytesTotal);
}
myMCL.onLoadInit = function (tMC){
myTrace ("Movie clip:" + tMC + " is now initialized");
tMC._xscale=0;
tMC._yscale=3;
tMC._x=pt_pnt_mc._x;
tMC._y=pt_pnt_mc._y;
var f:Fuse = new Fuse();
f.autoClear=true;
f.push({target:tMC, xscale:100, seconds:.25, trigger:.5});
f.push({target:tMC, yscale:100, seconds:.20});
f.push({target:tMC, func:fillBox(nme,msg,box)});
f.stop();
f.start();
}
makePort();
Using The MovieClipLoader
Hi everyone
This may seem like a very simple solution, or i dont know what im talking about!
Basically, i have a class that loads in a background onto the stage. However, i want to display a preloader while this loads etc. Im trying to import the MovieClipLoader into the class file to display the progress.
Im not getting any errors, but i have no ideas how to do this!
Any help will be appreciated!!
MovieClipLoader
Hi. Sorry about my english, if i offense someone is because i learn the wrong word.
I donīt know how much you read this kynd of posts, but i search in foruns, tutoriais, and everywere i know but still canīt make a progress bar react to MovieClipLoader.
Iīm trying to do something like this:
ActionScript Code:
myListener = new Object();
myListener.onLoadStart = function (target_mc:MovieClip) {
var loadProgress = my_mcl.getProgress(target_mc);
target_mc.attachMovie("bar","bar",1);
}
myListener.onLoadProgress = function (target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
// make bar "grow" ( target_mc.bar._xscale blablabla )
}
my_mcl = new MovieClipLoader();
my_mcl.addListener(myListener);
my_mcl.loadClip("teste1.jpg",_root.alvo1);
my_mcl.loadClip("teste2.swf", _root.alvo2);
my_mcl.loadClip("teste3.swf", _root.alvo3);
Itīs just a test, and works fine, but i canīt set a progress bar for wich movie loaded.
the "real" question is, how to reference and attach a progressBar for wich movie i want to load. The attachMovie i used donīt work.
|