-
[F8] XML loaded thumbnail, click to open a SWF in new window?
Currently, my thumbnails, when clicked, load SWFs in an emptyMC on the stage, however I would instead like to do one of two things:
1. launch the SWF in a new window, or
2. be able to center align my SWFs (all different sizes)
Can anyone offer any help? As you can see below, the function currently creates the emptyMC then loads the SWF there. Any advice is appreciated!
PHP Code:
function callFullImage(myNumber) {
myURL = myImages[myNumber].attributes.full_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) {
_root.my_txt.selectable = false;
}
fullPreloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
_root.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
}
fullPreloader.onLoadComplete = function(target) {
new Tween(target, "_alpha", Strong.easeOut, 0, 100, 3, true);
_root.my_txt.text = myTitle;
}
fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);
}
-
Maybe try something like this...
Code:
fullPreloader.onLoadInit = function(target) {
target._x = (Stage.width - target._width) / 2;
target._y = (Stage.height - target._height) / 2;
};
-
that worked a charm, thanks! i was wondering if it might be possible to open the swf in a new window using getURL? Here's my AS. You'll see that the line at the bottom calls the swf to my main stage.
PHP Code:
function callThumbs() {
_root.createEmptyMovieClip("container_mc",_root.getNextHighestDepth());
container_mc._x = _root.gallery_x;
container_mc._y = _root.gallery_y;
var clipLoader = new MovieClipLoader();
var preloader = new Object();
clipLoader.addListener(preloader);
for (i=0; i<_root.myImagesTotal; i++) {
thumbURL = myImages[i].attributes.thumb_url;
myThumb_mc = container_mc.createEmptyMovieClip(i, container_mc.getNextHighestDepth());
myThumb_mc._x = _root.thumb_width*i;
clipLoader.loadClip("thumbs/"+thumbURL,myThumb_mc);
preloader.onLoadStart = function(target) {
target.createTextField("my_txt",target.getNextHighestDepth,0,0,100,20);
target.my_txt.selectable = false;
}
preloader.onLoadProgress = function(target, loadedBytes, totalBytes) {
target.my_txt.text = Math.floor((loadedBytes/totalBytes)*100);
}
preloader.onLoadComplete = function(target) {
new Tween(target, "_alpha", Strong.easeOut, 0, 25, .5, true);
target.my_txt.removeTextField();
target.onRelease = function() {
callFullImage(this._name);
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|