SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to link to a .swf file

    I am trying to put a link on a webpage so when the user clicks on it the .swf file opens up in another page.

    Code:
    <a href="images/web-design-tutorials/flash-banner.swf" target="_blank">test</a>
    the problem is the file is 800 x 150 but when it opens up in the new page it opens up full width of the screen. I would like it so the little .swf file opens up is this possible???

    Cheers

  2. #2
    SitePoint Member DYM-Mike's Avatar
    Join Date
    Jul 2006
    Location
    Melbourne
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are several ways, the easiest I'd say would have to be a simple javascript link using the popWin.focus() method, observed here.

    Code:
    <a href="images/web-design-tutorials/flash-banner.swf" onclick="popWin=open('images/web-design-tutorials/flash-banner.swf','myWin','width=800,height=150,toolbar=0,menubar=0,location=0,status=0,scrollbars=0,resizable=0');popWin.focus();return false">test</a>

  3. #3
    SitePoint Addict
    Join Date
    Jan 2007
    Posts
    296
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cheers that is perfect

  4. #4
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Perhaps a better way is to link to a webpage which contains the SWF file, rather than directly to the SWF file itself? This way your sizing an proportions will be retained.


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
  •