A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] XML loaded thumbnail, click to open a SWF in new window?

  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    63

    [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(targetloadedBytestotalBytes) {
            
    _root.my_txt.text Math.floor((loadedBytes/totalBytes)*100);
        }
        
        
    fullPreloader.onLoadComplete = function(target) {
            new 
    Tween(target"_alpha"Strong.easeOut01003true);
            
    _root.my_txt.text myTitle;
        }
            
        
    fullClipLoader.loadClip("full_images/"+myURL,fullImage_mc);


  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518

    Maybe try something like this...

    Code:
    fullPreloader.onLoadInit = function(target) {
    	target._x = (Stage.width - target._width) / 2;
    	target._y = (Stage.height - target._height) / 2;
    };

  3. #3
    Member
    Join Date
    Apr 2008
    Posts
    63
    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=0i<_root.myImagesTotali++) {
            
    thumbURL myImages[i].attributes.thumb_url;

            
    myThumb_mc container_mc.createEmptyMovieClip(icontainer_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(targetloadedBytestotalBytes) {
                
    target.my_txt.text Math.floor((loadedBytes/totalBytes)*100);
            }
            
            
    preloader.onLoadComplete = function(target) {
                new 
    Tween(target"_alpha"Strong.easeOut025.5true);
                
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center