Hi Daniel.

I've fought hard with flash to make it work and fortunately I did.

1) You should use adobe flash >= 8.0 ;
2) You must configure the swf file to use actionscript 2.0 (file->publish
settings)
3) You must setup security policies in the main module. That makes the
browser accept javascript calls and also allow browser to call actionscript
functions.

import flash.external.*;
import flash.system.Security;

Security.allowDomain('*');

4) Use this javascript function to get a flash instance (dont use
document.getElementById directly)

function getSWF(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        return window[movieName];
    }
    else {
      if(document[movieName].length != undefined){
          return document[movieName][1];
      }
        return document[movieName];
    }

}

5) Use swfobject to avoid crossbrowsers issues.
http://blog.deconcept.com/swfobject/

6) Call a jsfunction from flash, use:
var ret = ExternalInterface.call("somefunction");

If your function returns string, then ret will be string; if it returns
integer, will be int, and so on...

Call an actionscript function from jscript:

getSWF("someid").somefunction();


That's it! Hope it helps.

Cheers,

--Robson



2008/11/2 Daniel <[EMAIL PROTECTED]>

>
> Hi!
>
> I'm trying to use flash in the opensocial application that I'm working
> on, I´ve use the example from this website:
> http://hackathon.wordpress.com/2008/02/26/update-flex-and-open-social/
>
> But I´ve receive an error....
>
>
> http://www.orkut.gmodules.com/gadgets/proxy?refresh=3600&gadget=http%3A%2F%2Fwww.neoage.com.br%2Fgwt%2Fdmsos%2Fgadget.xml%3Fz%3D9&container=orkut&url=http%3A%2F%2Fwww.neoage.com.br%2Fgwt%2Fdmsos%2Fosx.swf%3Fx%3D8
> de ExternalInterface não pode acessar
>
> http://fq9nfd26d2itu8n5jkvlvc2o594d08b7.prod.sandbox.orkut.gmodules.com/gadgets/ifr?url=http%3A%2F%2Fwww.neoage.com.br%2Fgwt%2Fdmsos%2Fgadget.xml%3Fz%3D9&parent=http://prod.sandbox.orkut.com&lang=pt&country=BR&synd=orkut&view=canvas&mid=0&libs=dynamic-height%3Aflash%3Aopensocial-0.7&h=600&st=AFinprTHFpk5rft0CFKBdF8AnuKFnSwbAk9gMyVBNbxYuWf676BglLUX-9b1ejqkc13-573PUtI83yzOQT0ZbpzFEFsLIE21MkNT2iuI7cdvaFmxnmP294U#gadgetId=651942007104&gadgetOwner=13509688347317733486&gadgetViewer=13509688347317733486&view-params=&time=1
> .
>        at flash.external::ExternalInterface$/_initJS()
>        at flash.external::ExternalInterface$/addCallback()
>        at bridge::FABridge/initializeCallbacks()
>        at bridge::FABridge()
>        at osx/_osx_FABridge1_i()
>        at osx()
>        at _osx_mx_managers_SystemManager/create()
>        at mx.managers::SystemManager/initializeTopLevelWindow()
>        at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/
> internal::docFrameHandler()
>
>
> Does anyone know why this happens?
>
> Does anyone can send me an example application in a zip file ?
>
> Thanks
>
> Daniel
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenSocial Application Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/opensocial-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to