Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46

Thread: Flash Popup.

  1. #1
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Flash Popup.

    Hi.
    It's me again with another problem.
    Since John helped me to resolve my problem with the centered image popup window, I have another popup that shows without a window frame at all, but not centered.
    The popup is made in Flash.
    Please have a look at the attachment and let me know if it is possible to make this popup appear centered.
    Thanks in advance.
    Kind regards,
    Cheng
    Last edited by Cheng; 01-06-2006 at 06:39 AM.

  2. #2
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Ok if nobody has a solution the the centered flash popup mentioned above, maybe this is possible.
    If you click this link here:
    http://www.tommys-service-enterprise...ang%20Paya.htm
    There is an image in the middle and when you click it it opens centered popup window.
    Is it possible to have this popup without any window frame?
    Just the image, nothing else.
    Thank you all.
    Cheng

  3. #3
    Join Date
    Oct 2005
    Posts
    121
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I think I found an example of it here, http://www.kirupa.com/developer/mx/transparency.htm, if I remember right, it puts a "transparent" or something like that in one of the embed parameters of the html code...

  4. #4
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply.
    But this forum there is Flash MX related and I'm using Swishmax if I have to do some Flash.
    Also I don't want that popup to be transparent as you can see in attachment I've posted the popup is not transparent.
    I only want someone to help me by telling how to make this appear centered.
    Thanks again.
    Cheng

  5. #5
    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

    Well, I was unable to get your demo to play onclick using your code but, that might be because I was trying this as a local demo. I was able to get the demo to play using .play() for IE (instead of .GotoFrame(1)) and in FF by using a right click and selecting play from the Macromedia menu. Once I had that happening, I gave the containing division an id:

    HTML Code:
    <div id="flashDiv" style="position:absolute;top:50px;left:100px;">
    Next I wrote a little script that can go in the head:

    Code:
    <script type="text/javascript">
    onload=function(){
    var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
    document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
    }
    </script>
    This did the trick on centering. You are on your own getting the darn thing to play.

    Notes: 'document.documentElement' is for use with a DOCTYPE as your demo had one. With no DOCTYPE, it should be 'document.body'. Better still is to use a test function, as some earlier IE versions may not support document.documentElement but, as these browsers probably will not do flash either, I didn't worry about it.
    - John
    ________________________

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

  6. #6
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Hi John.
    Thanks again for your expertise.
    I will try out the code you posted, but what I don't understand is that you cant play the file.
    You should just double click the popup.html file and then it should open in Explorer and then just click on the link "Open Popup" and that opens the popup.swf
    It works for me from inside WinRar without even saving the file when I click on it from where I posted the attachment.
    Strange really.
    I try your code and let you know.
    Thank you.
    Cheng

  7. #7
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Here It's me back again.
    It's nearly working.
    When I open the browser window in 1024/768 the popup ist centered.
    Only when I maximize the window to my full browser window size 1440/900 the popup is not centered anymore.
    But then if I open the window in the begining in 1440/900 the popup is centerd, but then again if resized to whatever size without closing then the window first, the popup is not centered anymore.
    Could you please be so kind and have a look into that as well.
    I really want this to work for a long time, but you are the 1st person I know that has a clue about this coding stuff
    By the way, how would all this work if the "Open Popup" link is inside a table?
    I thought I got it now, but still something is missing as it appears.
    Thanks again for your help.
    Cheng
    PS.
    In the attachment you find the popup example after I modified it with your code.
    Last edited by Cheng; 01-08-2006 at 11:07 AM.

  8. #8
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Here an example inside a table.
    Like the way it appears now, but only centered and no matter what window size.
    Then that would be exactly what I'm trying to do for ages without any result.
    But you brought me very close to it.
    Please have a look at this attachment and see if the popup could be centered.
    Some people in other forums told me that this is impossible, but I think it is.
    And if someone can do it then it's probably you.
    I really appreciated.
    Hope one day I can help you out somehow.
    cheng
    Last edited by Cheng; 01-08-2006 at 11:37 AM.

  9. #9
    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

    The code I wrote assumes that the window will remain the same size that it was when opened. It can be changed to accommodate resizing:

    Code:
    <script type="text/javascript">
    
    function centerPopUp(){
    var w=window.innerWidth? window.innerWidth : document.documentElement.clientWidth
    document.getElementById('flashDiv').style.left=(w-document.getElementById('popup').width)/2+'px'
    }
    
    onload=centerPopUp;
    onresize=centerPopUp;
    
    </script>
    As long as the pop up container is absolutely positioned, it makes no difference where the link that activates it is.
    - John
    ________________________

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

  10. #10
    Join Date
    Jan 2006
    Posts
    234
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    Hi Mad Professor.
    Everything is fine now except one thing.
    You said:
    ""As long as the pop up container is absolutely positioned, it makes no difference where the link that activates it is.""
    What you mean by "absolutely positioned"?
    If I put the Link that opens the popup inside a table and then save it.
    It is working, but when I move the folder that contains the popup.html and the popup.swf to another location then it's not working anymore.
    Also the one without a table, if the folder that contains the files is renamed then it's not working anymore.
    In the attachment there are 2 zip files one with the link inside a table and one without a table.
    Try to rename the folder popup.
    When I do this it's not working anymore
    For the one inside a table maybe it's because of the container must be absolue positioned, but I don't know what you mean with that.
    I hope I'm not hurting your nerves to much with this, but please help me to solve this.
    Thanks a lot.
    Cheng

    P.S.
    I just found out that if you rename the folder from LinkInsideTable to popup the also the one with a table is working.
    Last edited by Cheng; 01-09-2006 at 04:43 AM.

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
  •