A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Problem with loadMovie, 90 degree angle change

  1. #1
    Mattastrophe
    Join Date
    Dec 2007
    Posts
    3

    Angry Problem with loadMovie, 90 degree angle change

    So I've been staring at my screen all day, my client getting increasingly irate trying to work out what's going on.

    I'm on Flash CS3, AS 2.0

    Here's my code:


    Actionscript Code:
    //set stage for FBF
    Stage.align = "TL";
    Stage.scaleMode = "noScale";
    loadMovie("image.jpg", pic, 'GET');

    //define dynamic aspect ratios
    picHeight = new Object ();
    picHeight = pic._height / pic._width;

    picWidth = new Object ();
    picWidth = pic._width / pic._height;






    //conditional statement to account for various initial browswer sizes and proportions

    if ((Stage.height / Stage.width) < picHeight) {
        pic._width = Stage.width;
        pic._height = picHeight * pic._width;
    } else {
        pic._height = Stage.height;
        pic._width = picWidth * pic._height;
    }


    //center picture on stage
    pic._x = (Stage.width / 2) - (pic._width / 2);
    pic._y = (Stage.height / 2) - (pic._height / 2);



    // create listener
    sizeListener = new Object();

    // make listener change picture size and center picture on browser resize
    sizeListener.onResize = function() {
       
        if ((Stage.height / Stage.width) < picHeight) {

            pic._width = Stage.width;
            pic._height = picHeight * pic._width;
        } else {
            pic._height = Stage.height;
            pic._width = picWidth * pic._height;
        }
       
       
    pic._x = (Stage.width / 2) - (pic._width / 2);
    pic._y = (Stage.height / 2) - (pic._height / 2);
       
    }

    //add listener to stage
    Stage.addListener(sizeListener);

    My problem is my client wants to be able to change image.jpg occasionally, to ones of different size ratios. If the "pic" movieclip has a box of the right size ratio inside it I have no problem unless I change the image, which I need to be able to do. If there is nothing inside the movieclip when I load it, the image always appears on its side, and I can't seem to get it rotate to the correct position!

    Please help if you can - I'm desperate!

  2. #2
    Senior Member whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    do you have a link to the two different examples of what your trying to do? working and non?

    outside of your posted code..what is it you are trying to accomplish?

    have a movieClip that acts as a background? and will scale to fit the browser at all times?


    let me know...maybe I can help.

Tags for this Thread

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