Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-04-2008, 04:59 AM   #1
Registered User
Join Date: Nov 2008
Posts: 18
Default Change contentPath of a Loader component?

is it possible to change the contentPath property of a Loader component, once it has loaded an external image file?

I have a movie clip which contains a Loader component.

At runtime the Loader component loads the external image and a filter is applied to desaturate the image.

What I want to happen, is on the movie clip's onRollOver event, the loader changes out the image for an image of static, then replaces the image with the first image only in full color.

For the onRollOut event, I want the reverse to happen: full color image->load and display static image -> load and display desaturated image.

I am starting to think it is not possible to load a different image into a single Loader component??? Can someone enlighten me? Code below:

imageLoader_1_MC.onRollOver = function() {
	this.imageLoader_1.autoLoad = true;
	this.imageLoader_1.contentPath = "images/static/static1.jpg";
imageLoader_1_MC.onRollOut = function() {
	this.imageLoader_1.autoLoad = true;
	this.imageLoader_1.contentPath = "gallery/demo reel/1a.jpg";
where imageLoader_1_MC is the container movie clip and imageLoader_1 is the Loader component.

The above code is on Frame 1 of the timeline.

Thx in advance!
r€nato is offline   Reply With Quote
Old 12-04-2008, 02:25 PM   #2
Registered User
Join Date: Nov 2008
Posts: 18

...I guess the answer is, no you can't replace the content of a Loader component (at least not with AS2).

I did a workaround, I used AS to create a new Loader inside the movie clip which contains the original Loader, I placed it at a high depth (1000) and then used the _alpha property to turn it on and off depending on the mouse action (onRollOver/onRollOut).
r€nato is offline   Reply With Quote
Old 04-10-2009, 03:03 PM   #3
Registered User
Join Date: May 2006
Posts: 1
Default Workaround

A lot of people seem to have trouble with this, and though I expect it's to do with mis-reading depths, I found the simplest solution is to pass the name of the image/swf into the new movie in a Dynamic Text box. Then you can simply call this reference from INSIDE the target movie clip. See below...

this.image_img.contentPath = this.image_txt.text;

trace (this.image_txt.text);

I hope this helps some people.
jackcarr is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Scaling images using loader component Lukerz ActionScript 2.0 0 07-17-2006 02:16 AM
I have a Loader Component problem Shaun-Optimus Components 1 06-10-2006 11:48 AM
Q: Change Component Parameter via AS slayerment ActionScript 1.0 (and below) 8 09-11-2005 05:35 AM
How to change parameter args list in Component Inspector panel automatically legolas1016 ActionScript 2.0 0 12-24-2004 12:07 AM
can component preview change its size in the Flash editor? Bax1 Components 3 12-20-2004 10:33 AM

All times are GMT. The time now is 02:18 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.