A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Calling External Javascript inside Flash

  1. #1
    Junior Member
    Join Date
    Aug 2009
    Posts
    17

    Calling External Javascript inside Flash

    I'm not that good with flash and even worst with javascript. I'm trying to create a flash site for a radio station that will show information from the facebook fan page. I search over the whole Internet and found little or no info on how to do this... This is the code that I want to add to my flash site.
    Code:
    <div class="side-module">
     <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script><script type="text/javascript">FB.init("61970d92c1f9739562db868642f024c4");</script><fb:fan profile_id="148805038467578" stream="1" connections="10" width="300"></fb:fan><div style="font-size:8px; padding-left:10px"><a href="http://www.facebook.com/elciberneticopr">El Cibernetico</a> on Facebook</div> 
    </div>
    In another site I found out that I can do this from an iframe (don't know what is this) and the code is this one
    Code:
    <iframe src="http://www.facebook.com/plugins/likebox.php?id=148805038467578&amp;width=292&amp;connections=10&amp;stream=true&amp;header=true&amp;height=587" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:292px; height:587px;" allowTransparency="true"></iframe>
    But still don't know how to do it. Can someone explain how can I add this to my flash site?? thanks..

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Put the JS inside a function in the html. From flash use ExternalInterface to call the JS function. More info on ExternalInterface in the liveDocs (link in my footer)

    gparis

  3. #3
    Junior Member
    Join Date
    Aug 2009
    Posts
    17

    Unhappy

    Sorry to sound really stupid but, can you show me an example of this kind of code??? I really can't find exactly the data in the site that you point me.

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    Actionscript Code:
    import flash.external.*;
    ExternalInterface.call("function", "parameter");

    gparis

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