Also, just took a quick peep at your code, I'm pretty certain your call
should look like:

      ExternalInterface.call("LightboxDelegate","images/cocoabutter.png" ,
"Cocoa Butter by COFINA SA'");

first param is the function name, second 2 would be the params you are
passing. I would probably clean this up a little on the JS side and have a
function that accepts the call from flash and handle the call to the
lightbox script from there. But that's just my opinion. :)

hth

On Fri, Jan 15, 2010 at 1:47 PM, Bob Wohl <[email protected]> wrote:

> Are you able to get a simple alert to show from a button call? Also, what
> browser are you using?
>
>
>
> On Fri, Jan 15, 2010 at 11:13 AM, Gustavo Duenas <
> [email protected]> wrote:
>
>> Thanks for your reply, I have the allow script access like this:
>>
>> <script type="text/javascript">
>>                        var flashvars = {};
>>                        var params = {};
>>                        params.allowscriptaccess = "always";
>>
>> var attributes={id:"menuCofina"};
>> swfobject.embedSWF("menucofina2.swf", "content", "100%", "100%",
>> "10.0.0",false,flashvars,params, attributes);
>>
>> </script>
>>
>> I'm testing it over the internet, on my test site.
>> but it is still not working, I don't get it...there is something wrong
>> with my as3? I don't know I didn't realize this matter should be so
>> difficult
>>
>> Gustavo
>>
>> On Jan 15, 2010, at 12:57 PM, Bob Wohl wrote:
>>
>>  If you are testing localy you may need to go here and change your privacy
>>> settings to allow the directory you are testing from to communicate with
>>> JS:
>>> <
>>>
>>> http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
>>>
>>>>
>>>>
>>> Also, you need to make sure your embed script is properly set up. Look at
>>> allowScriptAccess.
>>>
>>> B.
>>>
>>> On Fri, Jan 15, 2010 at 10:43 AM, Gustavo Duenas <
>>> [email protected]> wrote:
>>>
>>>  Hi, Coders, I've been trying to use External interface to activate a
>>>> lightbox code I have on my web page, here is the html
>>>>
>>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
>>>> http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
>>>> <html xmlns="http://www.w3.org/1999/xhtml";>
>>>> <head>
>>>> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
>>>> <title>Untitled Document</title>
>>>> <script src="swfobject.js" type="text/javascript"></script>
>>>> <script src="swfaddress.js" type="text/javascript"></script>
>>>> <script type="text/javascript">
>>>> var attributes={id:"menuCofina"};
>>>> swfobject.embedSWF("menucofina2.swf", "content", "100%", "100%",
>>>> "10.0.0",null,null,null, attributes);
>>>>
>>>> </script>
>>>> <link rel="stylesheet" href="js/lightbox.css" media="screen"
>>>> type="text/css"/>
>>>> <script type="text/javascript" src="js/effects.js"></script>
>>>> <script type="text/javascript" src="js/lightbox++.js"></script>
>>>> <script type="text/javascript" src="js/prototype.js"></script>
>>>> <script type="text/javascript" src="js/scriptaculous.js"></script>
>>>> <script type="text/javascript">
>>>>  function LightboxDelegate(url,caption) {
>>>>  var objLink = document.createElement('a');
>>>>  objLink.setAttribute('href',url);
>>>>  objLink.setAttribute('rel','lightbox');
>>>>  objLink.setAttribute('title',caption);
>>>>  Lightbox.prototype.start(objLink);
>>>> }
>>>> </script>
>>>> <style type="text/css">
>>>> <!--
>>>> body {
>>>>      background-color: #E9E8B3;
>>>>      background-image:url(backMain.jpg);
>>>>      background-attachment:fixed;
>>>>      background-repeat:repeat-y;
>>>>      background-position: center center;
>>>>
>>>> }
>>>>
>>>>
>>>> -->
>>>> </style></head>
>>>>
>>>> <body>
>>>> <div align="center" style="margin-top:55px; margin-right:35px;">
>>>> <div id="content"  style="margin-left:auto; margin-right:30px;
>>>> margin-top:auto; margin-bottom:auto;">
>>>> </div>
>>>> </div>
>>>> </body>
>>>> </html>
>>>>
>>>> and here is my as3 code.
>>>>
>>>> for the buttons.
>>>>
>>>> buttinButter.addEventListener(MouseEvent.CLICK, butterImage);
>>>>
>>>>
>>>>
>>>> function butterImage(evt:MouseEvent):void{
>>>> if(ExternalInterface.available){
>>>>      ExternalInterface.call("LightboxDelegate('images/cocoabutter.png' ,
>>>> 'Cocoa Butter by COFINA SA')");
>>>>      trace("vamos bien");
>>>> }else{trace("problemas");}
>>>> }
>>>>
>>>> buttonLiquor.addEventListener(MouseEvent.CLICK, liquorImage);
>>>>
>>>> function liquorImage(evt:MouseEvent):void{
>>>>      if(ExternalInterface.available){
>>>>
>>>> ExternalInterface.call("LightboxDelegate('images/cocoaliquor.png' ,
>>>> 'Cocoa
>>>> liquor by COFINA SA')");
>>>>      trace("vamos-rebien");}
>>>> }
>>>>
>>>> buttonPowder.addEventListener(MouseEvent.CLICK, powderImage);
>>>>
>>>> function powderImage(evt:MouseEvent):void{
>>>>      if(ExternalInterface.available){
>>>>
>>>> ExternalInterface.call("LightboxDelegate('images/cocoapowder.png' ,
>>>> 'Cocoa
>>>> Powder by COFINA SA')");
>>>>      trace("rebien Vamos!!");}
>>>>      }
>>>>
>>>>
>>>> Am I doing anything wrong, probably this is some estupid mistake, but I
>>>> don't see it, I'm doing anything by the book, let me know, please I need
>>>> this fixed asap.
>>>>
>>>> Regards,
>>>>
>>>> Gustavo
>>>> _______________________________________________
>>>> Flashcoders mailing list
>>>> [email protected]
>>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>>
>>>>  _______________________________________________
>>> Flashcoders mailing list
>>> [email protected]
>>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>>
>>>
>> _______________________________________________
>> Flashcoders mailing list
>> [email protected]
>> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>>
>
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to