![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I'm writing an app that needs to be wrapped with Swish Studio. I need to
interact with the wrapper to do system level operations. How on bloody earth do I get the results from an SfCommand call. I understand that it's not available right away which is why in Flash at a later frame you can use the _root.fscmd_ret variable to get the result.... So was this just plain left out of Flex? Please Help! |
| Sponsored Links |
|
|||
|
Try ExternalInterface.
"Russell.Brown" <webforumsuser@macromedia.com> wrote in message news:gh4jgu$5jd$1@forums.macromedia.com... > I'm writing an app that needs to be wrapped with Swish Studio. I need to > interact with the wrapper to do system level operations. How on bloody > earth do > I get the results from an SfCommand call. I understand that it's not > available > right away which is why in Flash at a later frame you can use the > _root.fscmd_ret variable to get the result.... > > So was this just plain left out of Flex? Please Help! > |
|
|||
|
Here are my two test lines. The first one works and generates a successful
call, the second one does nothing. This a call to an ActiveX wrapper essentialy. fscommand("FileAccess", "%Org%\\images"); ExternalInterface.call("FileAccess", "%Org%\\images"); |
|
|||
|
These quotes are directly from the help docs:
"Note: For local content running in a browser, calls to the ExternalInterface.call() method are permitted only if the SWF file and the containing web page (if there is one) are in the local-trusted security sandbox. Also, you can prevent a SWF file from using this method by setting the allowNetworking parameter of the object and embed tags in the HTML page that contains the SWF content. For more information, see the following:" "Scripting in either direction between local HTML files and local SWF files--for example, using the ExternalInterface class--requires that both the HTML file and SWF file involved be in the local-trusted sandbox. This is because the local security models for browsers differ from the Flash Player local security model." So it looks like you need to set 'allowScriptAccess' in your wrapper. Take a look here: http://livedocs.adobe.com/flex/201/h.../wwhelp.htm?co ntext=LiveDocs_Book_Parts&file=passingarguments_08 6_19.html And let us know how it works out. |
|
|||
|
The problem is, my "wrapper" is
http://www.swishzone.com/index.php?a...o&tab=overview not a web page. I'm creating a flex screen saver that will be installed on around 1200 corporate computers and pushing AIR to all of these computers is currently not on the table of options. Therefor this seems to be the best way to do this. The interaction with the executable is ActiveX, not JavaScript. I have found out that the _root.fscmd_ret variable that sfcommand() sets with a result is the equivalent to Application.application.fscmd_ret. However I can't seem to put a watch on this scope and getting it's value reliably has been difficult. Is there a best practices way via a different method that I can access this? |
|
|||
|
You can still use ExternalInterface for your situation. From the help docs:
"Note: If you are publishing for Flash Player 8 or later, the ExternalInterface class provides better functionality for communication between JavaScript and ActionScript (Usage 2) and between ActionScript and VisualBasic, Visual C++, or other programs that can host ActiveX controls (Usage 4). You should continue to use fscommand() for sending messages to Flash Player (Usage 1) and Director (Usage 3)." - http://livedocs.adobe.com/flex/3/lan...m/package.html I found the following thread on forums.swishzone.com: http://forums.swishzone.com/index.ph...s&sid=8b5143bb 288ba697e9df58a53d44a3e2&highlite=ExternalInterfac e Have you looked at this? sO2 suggests to use an alias reference name. I hope that helps more. |
|
|||
|
"Russell.Brown" <webforumsuser@macromedia.com> wrote in message news:gh60vu$suq$1@forums.macromedia.com... > Here are my two test lines. The first one works and generates a successful > call, the second one does nothing. This a call to an ActiveX wrapper > essentialy. > > fscommand("FileAccess", "%Org%\\images"); > > ExternalInterface.call("FileAccess", "%Org%\\images"); I'm not sure what you're saying here. Are you saying that you're calling to an application other than a web browser that contains the Flash player ActiveX control? I can assure you that ExternalInterface DOES work for this, but you may need to listen on a different event. HTH; Amy |
|
|||
|
"Russell.Brown" <webforumsuser@macromedia.com> wrote in message news:gh6553$4cf$1@forums.macromedia.com... > The problem is, my "wrapper" is > http://www.swishzone.com/index.php?a...o&tab=overview > not a web page. > > I'm creating a flex screen saver that will be installed on around 1200 > corporate computers and pushing AIR to all of these computers is currently > not > on the table of options. Therefor this seems to be the best way to do > this. The > interaction with the executable is ActiveX, not JavaScript. > > I have found out that the _root.fscmd_ret variable that sfcommand() sets > with > a result is the equivalent to Application.application.fscmd_ret. However I > can't seem to put a watch on this scope and getting it's value reliably > has > been difficult. Is there a best practices way via a different method that > I can > access this? I have no experience with swish, but you may or may not find this helpful: http://learn.adobe.com/wiki/display/...rom+Authorware Down at the bottom, using Flex files inside Authorware |
|
|||
|
I still haven't made and forward movement but I appreciate the help so far. TO
clarify some stuff... SWiSH Studio2 has a log that prints out every interaction with it's DLL. As stated above, although not well.... the FsCommand example below connects to the dll and makes it's request. However I still can't seem to find it's result anywhere and anytime. The second example below [external interface call] fires with no errors, but does not actually touch the DLL for reasons unknown to me. Despite all of my reading and the great links provided by Amy, not a single call has resulted in the DLL being reached out to by my Flash app. 1) fscommand("FileAccess", "%Org%\\images"); 2) ExternalInterface.call("FileAccess", "%Org%\\images"); I created the following code to try get a value back from fscommand with no success.... // ------------------------------------------------------------------------- import flash.events.TimerEvent; import flash.external.ExternalInterface; import flash.utils.Timer; import mx.controls.Alert; import mx.core.Application; private var t:Timer; private var tCounter:int=0; private function preLoader():void { trace("pre-init"); fscommand("FileAccess", "%Org%"); t = new Timer(500, 10); t.addEventListener(TimerEvent.TIMER, preLoader_timer); t.start(); } private function preLoader_timer(e:TimerEvent):void { tCounter++; try { Alert.show("this.fscmd_ret: " + this["fscmd_ret"]); } catch (e:Error) { // DO NOTHING } try { Alert.show("Application.application.fscmd_ret: " + Application.application.fscmd_ret); } catch (e:Error) { // DO NOTHING } if (tCounter == t.repeatCount) Alert.show("Done"); } // ------------------------------------------------------------------------- |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise