A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [RESOLVED] unloading clips from the movie clip they have been loaded into?

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    resolved [RESOLVED] unloading clips from the movie clip they have been loaded into?

    Afternoon,

    I am facing a funny problem where I can load part of my desired images but tracing their variable value does so undefined.

    This happens after removing my container clips and calling a movieClipLoader to start the whole process of loading the clips from different URLs in the last frame of my swf.

    I'm not attaching the file today because I don't want it to look as if I wanted having it solved so my question is about unloading the container clips instead of removing them.

    I've tried
    Code:
    myLoader.unloadClip(_root["box" + i].targetBox);
    from the button where I'm changing the amount of new files plus the URL of the new loading folder.

    It doesn't unload the clips and I've tried prefixing the call with _parent or _root.

    Here's the code when the clips are loaded:

    Code:
    function loading_function(a:Number)
    {
    	//trace("This variable's id = " + a);
    
    	var myLoader:MovieClipLoader = new MovieClipLoader();
    	var myListener:Object = new Object();
    
    	myListener.onLoadInit = function(target:MovieClip)
    	{
    		//
    	};
    
    	myLoader.addListener(myListener);
    	myLoader.loadClip(URL + "/Untitled-" + a + ".jpg",this["box" + a].targetBox);
    }
    My call appears to be correct, doesn't it?

    P.D. Here's the file anyway, my question may probably be poorly exposed. and it will help explain. Several Untitled jpgs are needed on folders named images/Barcelona/Gaudi and images/Barcelona/awayCity I am attaching 3 files...
    Last edited by capdetrons; 11-08-2013 at 11:48 AM.

  2. #2
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Hi, I see what I'm trying to do!

    excuse my post again, I didn't know how to expose my problem. What I want to do is to increase the size of the loaded images in the thumbnail boxes. I had done it before but with embedded images in movie clips in the library that's why I was so confused.

    Now I'm trying:

    Code:
    this["box" + a].targetBox["Untitled-" + a + ".jpg"]._xscale = 120;
    this["box" + a].targetBox["Untitled-" + a + ".jpg"]._yscale = 120;
    this["box" + a].targetBox["Untitled-" + a + ".jpg"]._xscale = 120;
    this["box" + a].targetBox["Untitled-" + a + ".jpg"]._yscale = 120;
    but perhaps it can't be done...

    sorry for my poor expression.

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    You should have all your actionscript on the first frame and don't use scenes. Put everything in container clips for easy control and referencing - example below uses an empty clip called "picsHolder" to hold all the loaded jpgs. The code below is a general example of loading pics into a container clip. There's an empty clip in picsHolder. It gets duplicated, a jpg is loaded into it. mclListener.onLoadInit fires when the jpg is loaded and showing (ready to use). You can resize the container clips then.


    Code:
    //  create a new MovieClipLoader listener
    var mclListener:Object = new Object();
    var image_mcl:MovieClipLoader = new MovieClipLoader();
    image_mcl.addListener(mclListener);
    
    var imageLoading:Number = 0;
    var totalImages:Number = 5;
    	
    function loadImages(){
    	if(imageLoading < totalImages){
    		picsHolder.pic.duplicateMovieClip("pic_" + imageLoading,100 + imageLoading);
    		image_mcl.loadClip("images/set_0_pic_"+imageLoading+".jpg", picsHolder["pic_" + imageLoading]);
    	}else{
    		trace("\nloadImages():  all " + imageLoading + " images have loaded");
    	}
    	imageLoading++;
    }
    
    
    mclListener.onLoadInit = function(target_mc:MovieClip) {
    	trace("onLoadInit: target_mc = " + target_mc);
    	target_mc._parent._parent.loadingAnimation._visible = false;
    	loadImages();
    }
    
    
    loadImages();

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center