A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Use javascript in flash?

  1. #1
    Member
    Join Date
    Sep 2003
    Posts
    76

    Use javascript in flash?

    I'm trying to incorporate Lightwindow into a flash project of mine. I just want to be able to launch it from flash. It can use a javascript function to call it, is this possible in flash? Any advice would be great help, thanks.

  2. #2
    OOP is one letter from OOPS kortex's Avatar
    Join Date
    Aug 2005
    Location
    New Hope, PA
    Posts
    2,668
    look into external interafce
    Jeremy Wischusen
    Flash - Flex - LAMP - Web Developer Purple Inc
    AS OOP FAQ-Best Practices Thread | Flashkit OOP Tutorials | Purple Inc (day job) | Blog


  3. #3
    Member
    Join Date
    Sep 2003
    Posts
    76
    I think that will do the trick. I'm pretty new at this and I can't figure out the syntax.

    The function I need to call is:
    Code:
    myLightWindow.activateWindow({
    	href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', 
    	title: 'Waiting for the show to start in Las Vegas', 
    	author: 'Jazzmatt', 
    	caption: 'Mmmmmm Margaritas! And yes, this is me...', 
    	left: 300
    });"
    So would I do something like this on a button...
    Code:
    onMouseDown = function(myLightWindow){
         ExternalInterface.call("general_JS_call", "String to return to Flash:");
    Am I going in the right direction?

  4. #4
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    Did you ever figure this out? I'm having the same problem...

  5. #5
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    To call this function from Flash:
    Code:
    myLightWindow.activateWindow({
    	href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', 
    	title: 'Waiting for the show to start in Las Vegas', 
    	author: 'Jazzmatt', 
    	caption: 'Mmmmmm Margaritas! And yes, this is me...', 
    	left: 300
    });"
    You would use:
    Code:
    ExternalInterface.call("myLightWindow.activateWindow", "{href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', title: 'Waiting for the show to start in Las Vegas', author: 'Jazzmatt', caption: 'Mmmmmm Margaritas! And yes, this is me...', left: 300}");

  6. #6
    Junior Member
    Join Date
    Dec 2004
    Posts
    16
    Quote Originally Posted by MyFriendIsATaco
    To call this function from Flash:
    Code:
    myLightWindow.activateWindow({
    	href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', 
    	title: 'Waiting for the show to start in Las Vegas', 
    	author: 'Jazzmatt', 
    	caption: 'Mmmmmm Margaritas! And yes, this is me...', 
    	left: 300
    });"
    You would use:
    Code:
    ExternalInterface.call("myLightWindow.activateWindow", "{href: 'http://stickmanlabs.com/images/kevin_vegas.jpg', title: 'Waiting for the show to start in Las Vegas', author: 'Jazzmatt', caption: 'Mmmmmm Margaritas! And yes, this is me...', left: 300}");
    Thanks, I managed to get something like that working the other day. Do you have any experience with LightWindow? Only problem I'm having now is that the lightwindow is loading into an iFrame for some reason in IE, which is messing up the css styling. Works fine in other browsers.

  7. #7
    Bearded (M|G)od MyFriendIsATaco's Avatar
    Join Date
    Dec 2002
    Location
    Awesomeville.
    Posts
    3,045
    Not personally with Lightwindow, no.

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