Greetings!
I am making a Flash XML gallery that you can see here: goaretouch. com / gallery (all images are the same as it is only a proof-you have to remove the spaces, the forum will not let me bring-sites).
Using Actionscript 3 in Flash CS3.
The thumbnails load fine, and images ( "full_image") are also loaded fine. So far, so good.
The issue is that, when you hover the mouse over "full_image" I want to load third image, called "Before" (and return to the previous image when the mouse out of there).
The functions to load both "full_image" as "before" are the same:
callBefore function (myNumber) (
myURL = myImages [myNumber]. attributes.before_url;
myTitle = myImages [myNumber]. attributes. title;
_root.createEmptyMovieClip (fullImage_mc "_root.getNextHighestDepth ());
fullImage_mc._x = _root.full_x;
fullImage_mc._y = _root.full_y;
var fullClipLoader = new MovieClipLoader ();
var fullPreloader = new Object ();
fullClipLoader.addListener (fullPreloader);
fullPreloader.onLoadStart = function (target) (
target.createTextField ( "my_txt" fullImage_mc.getNextHighestDepth (), 0,0,200,20);
target.my_txt. selectable = false;
);
fullPreloader.onLoadProgress = function (target, loadedBytes, totalBytes) (
target.my_txt.text = Math.floor ((loadedBytes / totalBytes) * 100);
);
fullPreloader.onLoadComplete = function (target) (
new Tween (target, "_alpha" Strong.easeOut, 0, 100, .5, true);
target.my_txt.text = myTitle;
);
fullClipLoader. loadClip ( "before /" + myURL, fullImage_mc);
)
To call "CallBefore" from "CallFullImage" had thought of:
for (target.onMouseOver) (
preloader.onLoadComplete = function (target) (
new Tween (target, "_alpha" Strong.easeOut, 0, 100, .5, true);
target.my_txt.removeTextField ();
target.onMouseOver = function () (
callBefore (this. _name);
);
)
- callBefore function (myNumber) (
-
- myURL = myImages [myNumber]. attributes.before_url;
- myTitle = myImages [myNumber]. attributes. title;
- _root.createEmptyMovieClip (fullImage_mc "_root.getNextHighestDepth ());
- fullImage_mc._x = _root.full_x;
- fullImage_mc._y = _root.full_y;
-
- var fullClipLoader = new MovieClipLoader ();
- var fullPreloader = new Object ();
- fullClipLoader.addListener (fullPreloader);
-
- fullPreloader.onLoadStart = function (target) (
- target.createTextField ( "my_txt" fullImage_mc.getNextHighestDepth (), 0,0,200,20);
- target.my_txt. selectable = false;
- );
-
- fullPreloader.onLoadProgress = function (target, loadedBytes, totalBytes) (
- target.my_txt.text = Math.floor ((loadedBytes / totalBytes) * 100);
- );
-
- fullPreloader.onLoadComplete = function (target) (
- new Tween (target, "_alpha" Strong.easeOut, 0, 100, .5, true);
- target.my_txt.text = myTitle;
- );
-
- fullClipLoader. loadClip ( "before /" + myURL, fullImage_mc);
-
- )
-
- To call "CallBefore" from "CallFullImage" had thought of:
-
-
- for (target.onMouseOver) (
- preloader.onLoadComplete = function (target) (
- new Tween (target, "_alpha" Strong.easeOut, 0, 100, .5, true);
- target.my_txt.removeTextField ();
- target.onMouseOver = function () (
- callBefore (this. _name);
- );
-
- )
It does not work, what am I doing wrong?
Thank you very much for your help
