Is it possible to start playing a file inside a flash player by making use of javascript code? If so, how would I do it?
Try using swfObject, you can make any actionscript function visible for javascript using ExternalInterface
and declaring them into javascript. So you can trigger actionscript function with play()
(or any other code you want) from your javascript code.
Here is an example:
Actionscript:
import flash.external.ExternalInterface;
ExternalInterface.addCallback( "methodName", this, method );
function method() {
trace("called from javascript");
}
Javascript:
function callAS() {
swf.methodName();
}
Where methodName is the identifier js uses to call the method from actionscript.
Yes it is. You can reference the flash movie objects from js and control the flash component in a page. Unfortunately the way you do it is not portable across browsers. See this:
You can call any custom function in Flash from JavaScript, which requires you coding both Javascript and Flash.
See here for some examples: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15683.
Also, using SwfObject helps a long way when dealing with Flash from JavaScript.
if any oneneed for nesseray for learning flash i will gave him more informaion about it..
Hosam abuzarqa [email protected]