Results 1 to 6 of 6

Thread: flash in an iframe.

  1. #1
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default flash in an iframe.

    Hello, im trying to put a flash object inside an iframe (so its used like a container) But the flash object will only be in the upper left corner if your using Firefox. Both in IE and opera the flash file will go a little to the left and down..

    This is how the iframe look like:
    <iframe src="<URL here" width="<width here>" height="<height here>" allowtransparency="" scrolling="no" align="middle" frameborder="0"></iframe>';

    I also tried to give it an align="left" but it didnt work.
    Everything is done dynamically and im using the flash objects width and height as the height and width of the iframe.. So the flash object and iframe have the same size.


    The only thing thats in the container is the flash object..

  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

    You will need CSS to center or otherwise align the iframe and it's contents.

    I can't remember off the top of my head the exact coding for this, but if you search this forum in the CSS section you will find the answer.

    Do you really need the iframe though?
    {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

  3. #3
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It was just an idea, im programming an affiliate section at the moment and thought it would be easier to use iframe but if its wont work I will keep it as it is now.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This can work but the flash object needs to be on a page in the iframe. Once you have that, you can kill all margin and padding for that page, set that page's width to that of the object (this goes in the head of that page):

    <style type="text/css">
    body {
    margin:0;
    padding:0;
    width:<width of flash object>px;
    }
    </style>

    I haven't tested this exact method but, it can be done and this should be a good generic way to do it. Let me know if you have any problems with it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Aug 2006
    Posts
    130
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    It works in all browsers now, I used the code you posted but it wasnt necessary to use the width though:
    <style type="text/css">
    body {
    margin:0;
    padding:0;
    }
    </style>

    Btw this isnt really related to the main question but when I use an iframe the SuckerTree Vertical Menu will pop out one pixel when its over the iframe but only when im in Firefox, look here any idea why?

  6. #6
    Join Date
    Mar 2007
    Posts
    68
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    How about (for the original question), make a new html page to put inside the iframe, with the html as:
    HTML Code:
    <html><body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0"><embed src="flash_source.swf" height="100&#37;" width="100%"></embed></body></html>
    Where 'flash_source.swf' is the flash file. They just put that page into the IFrame.

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
  •