A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Calling inline javascript from swf file

  1. #1
    Junior Member
    Join Date
    Feb 2013
    Posts
    2

    Calling inline javascript from swf file

    Hi,
    I need to send a .swf file to a client that contains an external link to a different domain.

    This link need to open in a new window without any browser buttons/menus etc.

    I can do this using inline javascript on the URL eg (javascript:window.open('http://www.domain1.com/newsite', 'Funky Butter', 'toolbar=no, location=0,))

    The problem I have is the swf being sent to the client is being uploaded via their CMS system, which means I cannot make any changes to the HTML containing the swf, or provide any external .js files.

    Is there any way I can achieve this in just the .swf file only?

    Many Thanks,

    Mark

  2. #2
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    in fact, yes,
    Code:
    if ( ExternalInterface.available ) {
            ExternalInterface.call("eval", "window.open(...) or any javascript here");
          }
    this will still only work if allowed in html embedding code.
    who is this? a word of friendly advice: FFS stop using AS2

  3. #3
    Junior Member
    Join Date
    Feb 2013
    Posts
    2
    Thanks or your response.

    Unfortunately the 'AllowScriptAccess' param is excluded from the HTML, and I cannot make changes to this code.

  4. #4
    Senior Member realMakc's Avatar
    Join Date
    Oct 2002
    Posts
    927
    well you answered your question then, no? otherwise, you're asking how to break into someone's house, when the owner does not let you in even if you find the way, the owner will kick you out as soon as he finds out. by removing your swf.
    who is this? a word of friendly advice: FFS stop using AS2

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