A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: centering a nonscaling swf in a scaling swf

  1. #1

    centering a nonscaling swf in a scaling swf

    I have a background swf that has been coded so that it scales with the browser. I want to load the main swf file (main.swf) on top of this bg so that it is always centred on the page.

    Any suggestions??

    Much Thanks,

    here goes for a cool, collected dive at death and destruction, and the devil fetch the hindmost.

  2. #2
    Senior Kid
    Join Date
    Jan 2002
    I am right behind ya
    what do you mean by on top of the background.swf? do you mean load the main.swf into the background.swf and center it or center it in the page using javascript?

    if you want to load the main.swf, you can use javascript to pass the dimension of the window into swf. then you can figure out a ratio how much the main.swf is scaled, then scale it back with that ratio.
    Last edited by dancinkid6; 09-24-2004 at 05:39 PM.
    -The Dancin kidd

  3. #3
    thanks for the reply dancinkid.

    When I say that I'm loading the main.swf onto the background it is a simple loadMovieNum command.

    I'm afraid I'm not totally following you on your advice. If you have the time to get into details...
    here goes for a cool, collected dive at death and destruction, and the devil fetch the hindmost.

  4. #4
    Senior Kid
    Join Date
    Jan 2002
    I am right behind ya
    sorry about my vague explaination, here is what i think the solution might be:

    i guess you dont need javascript anymore, you can add a listener to 'Stage', so when the dimension of the stage changes, your ratio = new dimension/original background dimension, this ratio represents how much your main.swf is scaled, then you can scale it back with that ratio.

    i didnt test it, but i think it'll work. =)
    -The Dancin kidd

  5. #5
    Junior Member
    Join Date
    Apr 2004

    nonscaling into scaling

    Any possible way to show some sample code for this. Im trying to have a base .swf file that is publiahed to 100% and exact fit load another .swf file into a movie clip in the base file but have the mc remain at center center without scaling.

  6. #6
    Join Date
    Apr 2001
    Montréal, Québec.
    Dancinkid6... What are you waiting to change your signature's graphic?
    300*40 max!

    Footer Rules
    Footers are a digital signature attached to the bottom of every post you make. You can chose to not have one if you like, simply go to your then click edit profile and adjust your footer text and image there in the signature box.

    This box makes use of vB code. A very basic scripting language to allow you to show images or change text safely on flashkit. You can read more about it by clicking here.

    Footers have a fixed size, weight and text rules. Do not break these or your footer will be removed.

    footer specs
    Image type: JPG, GIF or PNG ONLY!
    Number of images: ONE image prefered, but if you must have multiple images they must all total less than 300x40 pixels!
    Weight: 15kb max!
    3 lines of text (If you don't want to use an image then you are allowed up to 5 lines of text in your footer.)
    No fonts larger than 12pt.
    Do not use these vB commands in your footer: QUOTE CODE PHP LIST (as they add extra breaks and make your footer too large)

    Do not start a new thread to test your new footer in! There is already a thread for that, click here to view it or navigate to the thread in the coffee lounge and post a reply there until you have perfected your footer. Once you have, go back to your post, click the button then check the delete post button and remove your test post.

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