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 < gdue...@leftandrightsolutions.com> 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 > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders