Adobe Dreamweaver Forums



Last 10 THreads :         Code that can effect two movie clips (Last Post : NedWebs - Replies : 1 - Views : 2 )           »          pop up blocker jacking my login (Last Post : reelhero - Replies : 6 - Views : 7 )           »          RoboHelp 7 Skins (Last Post : HelpDev - Replies : 7 - Views : 35 )           »          Clock .getUTC not working (Last Post : kglad - Replies : 3 - Views : 4 )           »          problems linking PDFs (Last Post : Alan - Replies : 1 - Views : 2 )           »          Changing RadioButton Label (Last Post : justintoflex - Replies : 2 - Views : 5 )           »          Table Borders MIssing in JavaHelp (Last Post : soxmann - Replies : 3 - Views : 8 )           »          cfimage error (Last Post : masoud_amen - Replies : 2 - Views : 3 )           »          Dragging components (Last Post : hsfrey - Replies : 2 - Views : 5 )           »          Is file too large? (Last Post : tweaked_eye - Replies : 0 - Views : 1 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 12-03-2008, 12:24 AM
Russell.Brown
 
Posts: n/a
Diggs:
Default SfCommand Results: A black Whole?

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!



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-03-2008, 01:03 AM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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!
>



Reply With Quote
  #3 (permalink)  
Old 12-03-2008, 01:23 PM
Russell.Brown
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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");

Reply With Quote


  #4 (permalink)  
Old 12-03-2008, 02:23 PM
myIP
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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.



Reply With Quote
  #5 (permalink)  
Old 12-03-2008, 02:33 PM
Russell.Brown
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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?

Reply With Quote
  #6 (permalink)  
Old 12-03-2008, 03:53 PM
myIP
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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.

Reply With Quote


  #7 (permalink)  
Old 12-03-2008, 04:03 PM
*gsb*
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

In a custom preloader (i.e. Flex frame 1), put a timer loop that tries the fsCommand to set a value to "success" and terminates the preloader when the value is correct.


Reply With Quote
  #8 (permalink)  
Old 12-03-2008, 04:13 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?


"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


Reply With Quote
  #9 (permalink)  
Old 12-03-2008, 04:13 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?


"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


Reply With Quote


  #10 (permalink)  
Old 12-03-2008, 08:13 PM
Russell.Brown
 
Posts: n/a
Diggs:
Default Re: SfCommand Results: A black Whole?

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");
}
// -------------------------------------------------------------------------

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 12:08 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk