Results 1 to 2 of 2

Thread: Help Please - Images Are Going Crazy

  1. #1
    Join Date
    Apr 2006
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Help Please - Images Are Going Crazy

    I have been working on this file for ages, I use this code

    Code:
    // Includes the tweening extensions.
    #include "mc_tween2.as"
    
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    fscommand("fullscreen", true);
    Stage.scaleMode = "noScale";
    Stage.align = "TL";
    
    var stageL:Object = new Object();
    stageL.onResize = function() {
        new Tween(btns, "_x", Back.easeOut, btns._x, Stage.width/2-btns._width/2, 1, true);
        new Tween(btns, "_y", Back.easeOut, btns._y, Stage.height-btns._height-30, 1, true);
    };
    
    Stage.addListener(stageL);
    stageL.onResize()
    
    var myClip = this.createEmptyMovieClip("mcl", this.getNextHighestDepth());
    var myLoader = new MovieClipLoader();
    var myListener = new Object();
    var myTest = random(6) + ".jpg"; // Load 1 of 6 random images
    
    /*Stage.align = "TL"; // Position the movie at top, center
    Stage.scaleMode = "noScale"; // Prevent scaling (required!)
    
    myListener.onResize = function (e:Object):Void {
    	var sw:Number = Stage.width;
    	var sh:Number = Stage.height;
    	mcl._width = sw;
    	mcl._height = sh;
      	trace("New width: " + Stage.width);
    	trace("New height: " + Stage.height);
    };*/
    
    myListener.onLoadInit = function (mcl) { // Create fade in function
    trace("load init");
    mcl._alpha=0; // Make mc 'mcl' _alpha 0
    mcl.onEnterFrame=function(){ // Create new function
    mcl._alpha +=15; // Speed 15
     
    if(mcl._alpha >=100){
    delete mcl.onEnterFrame;
    }
    }
    };
    
    Stage.addListener(myListener);
    myLoader.addListener(myListener);
    myLoader.loadClip(myTest,myClip);
    This loads 1 of 6 random images, Inside ANOTHER movie clip called (first) on my stage I have this code

    Code:
     var myTest = "images/manly/manly" + 1 + ".jpg";
     _root.myLoader.loadClip(myTest,_root.myClip);
    It forces an image to load works perfectly up until now! I dupliacted 'first' and called it second... Dragged it onto the stage but when it loads the images they come into the file at 300% larger than they are meant to be... I'm at my wits end if anyone can offer advice I would be very appreciative!

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    In your first code you have "math" to get stage width and height with all the fullscreens and adjustments. This is done first, then sent to the MC. With the duplication of (first) you are doing it twice.

    Either rewrite your first code to include _parent. or _root. so the math functions stay the same, or rewrite one for second instead of using first's twice
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

Bookmarks

Posting Permissions

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