Mac WebDialog & Flash
-
It have worked fine under Windows so I though it would have on Mac.
Thanks Scott! -
My goal is to create a webdialog based on Adobe Flex. It allows easy GUI creation with built-in standard components and as a result creates a single SWF file.
I have found an example how to communicate between Flash & JS. It is easy then to connect the Flash to Ruby.
Unfortunately a ExternalInterface extension which communicates Flash & JS doesn't work on Mac. It does under Windows.
I have taken the code from :
http://adriansule.com/blog/2009/08/flash-and-javascript-communication/
-
I have tested the AS-JS connection with another example script and I am getting on Mac:
@unknownuser said:
SecurityError: Error #2060: Security sandbox violation:
I have added a parameter to the flash object:
<param name="allowscriptaccess" value="always" />
but it didn't help.
-
Tomasz,
I know that this is possible. I'm doing it inside the Get Photo Textures dialog in SU 7.2. A flash movie sends data to JS and thereby to ruby. But it's a lot of code and I just haven't had time to figure out a minimal example.
It could be that I was using the old FSCommand bridge instead of ExternalInterface...
I'll take a look as soon as I can. In the meantime, if you're charging to get it working you might do some searching on FSCommand and see if that's a method that would suit your needs.
Are you doing all of this locally, or is there some web-hosted content involved?
-
@unknownuser said:
I'll take a look as soon as I can. In the meantime, if you're charging to get it working you might do some searching on FSCommand and see if that's a method that would suit your needs.
Thanks a lot Scott. I really appreciate it.
I have read that playing with FSCommand is much more complicated than ExternalInterface. I am glad anyway that it works on MAC.
Under Win External Interface works excellent.@unknownuser said:
Are you doing all of this locally, or is there some web-hosted content involved?
Yes, I am doing all locally as in the last attached sample.
-
@unknownuser said:
I know that this is possible. I'm doing it inside the Get Photo Textures dialog in SU 7.2.
... point two?
-
@thomthom said:
@unknownuser said:
I know that this is possible. I'm doing it inside the Get Photo Textures dialog in SU 7.2.
... point two?
Doh. Silly typo... I meant 7.1
-
Awh.
-
I would appreciate if someone on MAC could run this simple test.
It is minimal example of JS<>Flash communication with all errors on flash side being reported.Maybe I have different security settings in Safari or something similar.
I have also tried an old solution (prior to Flash called JavaScriptFlashGateway, but on Mac have received same message as in Win in a browser. In Win, inside SU sandbox, the FlashGateway worked fine.
-
@unknownuser said:
In the meantime, if you're charging to get it working you might do some searching on FSCommand and see if that's a method that would suit your needs.
No luck with FSCommand.
I have tried several things: changing letters' case in 'allowScriptAccess', played with 'name' and 'id' parameters.
It gives same security window or reports AS Error #2060. -
Thomasz,
So I spent some time trying to get it to work, and I'm having similar problems on the Mac.
I can get AS2 to work fine using FSCommand and SetVariable, but not AS3.
I'll file a bug internally and try to learn some more. Keep me posted if you make any progress.
-
I have added
flash.system.Security.allowDomain("*")
before
ExternalInterface.addCallback
in AS3 but it didn't help.
Will look for another solution. -
Someday, no flash support for apple?
-
@unknownuser said:
I'll file a bug internally and try to learn some more.
Have you or the Team found a remedy for the AS3 issue? I want to develop an UI in Flash and want to know if it will be worth investing time in it. If it won't run on MAC I have to look for a different solution.
-
Tomasz,
Unfortunately, we do not have a solution at this time, and I can't predict how long it might be before we do.
Thank you so much for all your help in identifying and tracking down this problem! I wish I had a simple solution.
One idea, if you're in the mood for exploring some more, might be to see if AS3 could communicate with javascript via URL fragment identifier, like myFlashpage.html#some_custom_data. You may be able to set/get data via that string after the #.
A related idea might be to see if you can set the URL of a hidden iframe via flash and have JS read that URL to pull out some encoded data.
Cheers,
-
@unknownuser said:
One idea, if you're in the mood for exploring some more, might be to see if AS3 could communicate with javascript via URL fragment identifier, like myFlashpage.html#some_custom_data. You may be able to set/get data via that string after the #.
Like AJAX solutions often do?
-
@thomthom said:
Like AJAX solutions often do?
This approach is most often used for "inter-frame" communication. If there are 2 frames in a page that are hosted on different domains, the JS in one is not allowed to access the other, but many browsers allow you to change the fragment identifier regardless of security, so it might work in this case. (There are a handful of other mechanisms people have used to get around frame-2-frame security, and any of them might work. Searching on the topic might give us a clever workaround.)
Ajax apps will often modify the fragment to maintain state in the URL, so you can still email URLs around and have your friends land on the same "page" inside an Ajax app.
Advertisement