vendredi 25 novembre 2016

Read the ouput text from swf with javascript/jquery

Im a beginner in actionscript 3 so I need help from you! Im doing a small application where I look if the user has a microphone or a camera installed:

import flash.media.Microphone;
import flash.media.Camera;
import flash.display.Sprite; 
import flash.text.*; 
import flash.external.ExternalInterface;
var myText:TextField = new TextField();

function getDataX():void {
    setInterval(function (){
        if (Microphone.names.length == 0 && Camera.names.length == 0){
            myText.htmlText="<p>none</p>";
        }else if (Microphone.names.length !== 0 && Camera.names.length !== 0){
            myText.htmlText="<p>both</p>";
        }else if (Microphone.names.length !== 0 && Camera.names.length == 0){
            myText.htmlText="<p>mic</p>";
        }else if (Microphone.names.length == 0 && Camera.names.length !== 0){
            myText.htmlText="<p>cam</p>";
        }
    addChild(myText);
    },2);
}
return getDataX();

And this is how I embeded it with jquery:

 var flashvars = {};

    var params                  =   {};
    params.menu                 =   "false";
    params.salign               =   "t";
    params.scale                =   "noscale";
    params.wmode                =   "fff";
    params.allowScriptAccess    =   "always";

    var attributes              =   {};
    attributes.id = "webcam_check";
    swfobject.embedSWF("swf/scriptcam.swf", "webcam", "1000px", "2000px", "11.2", "", flashvars, params, attributes);

My question is how do I read the text with javascript/jquery that addChild(myText); has outputed? Is it even possible? If not: Is it possible to do in other ways?

Thanks in regards

Aucun commentaire:

Enregistrer un commentaire