Re: [flexcoders] Is there a javascript flashObj.callFunction(), l ike setVariable?

2005-04-28 Thread John Dowdell
I think this is "How can the various browsers talk to the Macromedia Flash 
Player?"

Here's a weird URL with many screencaptures, but should list or link to the 
Player's inbound API:
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?event=view&id=KC.tn_15683&extid=tn_15683&dialogID=7481736&iterationID=1&sessionID=96301dc81d7227e49115&stateID=0%200%207485611&mode=simple#jtfc

(I don't recall whether these offer external access to root-level or targeted 
in-swf functions, and scanning these documents does not seem to quickly reveal 
the answer as previous versions of these documents did.)

Browsers vary in their support. Netscape and Mozilla browsers were the ones who 
*initiated* this kind of intercommunication. The material on the website 
doesn't 
seem as easy to navigate as in previous years, but current browser support 
should be listed at least in the Release Notes for each Player:
http://www.macromedia.com/support/documentation/en/flash/releasenotes.html

Summary: Browser/plugin intercommunication has been noble in theory since 1996, 
but still isn't really all that practical, unless you *know* your audience will 
be in standard configurations of IE/Win, or Java-enabled Firefox, or both. This 
may change in the future as new intercommunication APIs come on line:
http://www.mozillazine.org/talkback.html?article=4923

jd



-- 
John Dowdell . Macromedia Developer Support . San Francisco CA USA
Weblog: http://www.macromedia.com/go/blog_jd
Aggregator: http://www.macromedia.com/go/weblogs
Technotes: http://www.macromedia.com/support/
Spam killed my private email -- public record is best, thanks.


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 





RE: [flexcoders] Is there a javascript flashObj.callFunction(), l ike setVariable?

2005-04-28 Thread Abdul Qabiz
Title: Message





What kind of examples are you looking for? Any specific 
demand :)
 
 
 
-abdul


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] Sent: Friday, April 29, 2005 
12:12 AMTo: flexcoders@yahoogroups.comSubject: RE: 
[flexcoders] Is there a _javascript_ flashObj.callFunction(), like 
setVariable?

So, 
the browser has a problem with the casing?  Are there any more examples of 
this that anyone has found?

  
  -Original Message-From: 
  flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
  Matt HornSent: Thursday, April 28, 2005 8:55 AMTo: 
  flexcoders@yahoogroups.comSubject: RE: [flexcoders] Is there a 
  _javascript_ flashObj.callFunction(), like setVariable?
  Just one gotcha to watch out for... Mozilla doesn't 
  recognize getVariable/setVariable. It must be GetVariable/SetVariable (note 
  capital initial letter). IE will allow either one.
   
  matt
   







Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ 
To unsubscribe from this group, send an email to:[EMAIL PROTECTED] 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.










RE: [flexcoders] Is there a javascript flashObj.callFunction(), l ike setVariable?

2005-04-27 Thread Abdul Qabiz
Hi Tracy,
 
There is no callFunction(..) like method for flash activeX or plugin. But
there is setVariable(..) method. 
 
Yes, you can set a variable or setter from Javascript using setVariable
function. I have create a example, it allows you to execute flex function
from javascript...

It's very basic example but you can adopt similar approach and do it more OO
way by creating classes in JS and AS...

 
1) FlexJSExample.jsp
 
<%@ taglib uri="FlexTagLib" prefix="mm" %>



Flex-JS Communication Demo
 


   
 
//this function return to Flash ActiveX Object or Plugin depending upon
browser
//it takes care for browser type and returns the proper reference.
//Accepts the id or name of  or  tag respectively
function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  
  if (navigator.appName.indexOf ("Microsoft") !=-1) {
return window[movieName];
 
  } else {
   return window.document[movieName];
  }
}
 

/**###**/
//success flag, set by flash/flex app
var bFunctionCallFinished = true;
//param delimiter, kind of unique string
var paramDelimiter =  "-->$$###$$##$$<--";
 
//this function would call a flash/flex function.
function callFlashFunction(functionName, paramsArray)
{
if(bFunctionCallFinished) 
{
//Get the reference so activeX or Plugin.
 var flashObject  = thisMovie("flexApp");
 
bFunctionCallFinished = false;
flashObject.SetVariable("functionName", functionName);
flashObject.SetVariable("functionParams",
paramsArray.join(paramDelimiter));
flashObject.SetVariable("commitFunctionCall", true);
}
else
{
//if previous function call is still being run, you can use
setTimeOut etc to call it little later...
}

}
 
/**###**/
 



 

 

 
http://www.macromedia.com/2003/mxml"; width="600"
height="600" backgroundColor="#FF" >
 
 
 
 
 
 
  


 



 

 
 
 
 
BTW! Based on above principle, I made a JS-Flash libarary long back. Take a
look at it for an idea...

http://www.abdulqabiz.com/files/JSFC/JSFCommunicator%20Library.htm


Hope that helps

-abdul
 



From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 28, 2005 9:56 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there a javascript flashObj.callFunction(), like
setVariable?



Using javasript in a custom HTML wrapper, Is there flashObj.callFunction(),
like there is a setVariable() method?

Or will setVariable() work with a setter method? (Hmm, surely I can create a
setter in mxml, right?)

Tracy




Yahoo! Groups Links


*   To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
  
*   To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
 
  
*   Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
 . 






 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 


Flex_JSCommunication2.jsp
Description: Binary data



RE: [flexcoders] Is there a javascript flashObj.callFunction(), l ike setVariable?

Title: Is there a javascript flashObj.callFunction(), like setVariable?










I believe you’re only allowed to
call setVariable.  And yes you can create a setter and do it that way.

 

Matt

 









From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] 
Sent: Wednesday, April 27, 2005
9:26 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Is there a
_javascript_ flashObj.callFunction(), like setVariable?



 

Using
javasript in a custom HTML wrapper, Is there flashObj.callFunction(),
like there is a setVariable() method?

Or
will
setVariable() work with a setter method? (Hmm, surely I
can
create
a setter in mxml, right?)

Tracy

 










Yahoo! Groups Links

To visit your group on the web, go to:http://groups.yahoo.com/group/flexcoders/ 
To unsubscribe from this group, send an email to:[EMAIL PROTECTED] 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.