Highlighted

Enable logs for Embedded SWF file in AIR Application

Community Beginner ,
Apr 22, 2020

Copy link to clipboard

Copied

AIR Application has simple HTML file which embeds a SWF file in it using <object>.

When debugging AIR application using ADL command, only logs related to HTML are getting printed not from SWF.

 

SWFLogs.as

package { 
    import flash.display.Sprite;
    import flash.text.TextField;
    public class SWFLogs extends Sprite 
    { 
        public function SWFLogs() 
        {
            super();
            trace("Log from SWF app");
            var textField:TextField = new TextField();
            textField.text = "Hello, World!";
            addChild(textField);
        } 
    } 
}

Compiling the above SWFLogs.as into SWFLogs.swf

flex_sdk_4.6/bin/amxmlc SWFLogs.as

 

Now embedding SWFLogs.swf into HTML

 

HelloWorld.html

<html lang="en">

<head>
    <title>Hello World</title>
</head>

<body scroll="no">
  <object type="application/x-shockwave-flash" width="100%" height="100%" AllowScriptAccess='always'>
    <param name="movie" value="app:/SWFLogs.swf" />
    <param name="wmode" value="opaque" />
    <param name='AllowScriptAccess' value='always' />
  </object>
</body>

</html>

 

Referring this above HTML in Application descriptor

HelloWorld-app.xml

<application xmlns="http://ns.adobe.com/air/application/2.7">
    <id>examples.html.HelloWorld</id>
    <versionNumber>0.1</versionNumber>
    <filename>SWFLogs.swf</filename>
    <initialWindow> 
        <content>HelloWorld.html</content>
        <visible>true</visible>
        <width>800</width>
        <height>800</height>
    </initialWindow> 
</application>

 

Running in debugging mode using ADL command from AIR

air_sdk/bin/adl HelloWorld-app.xml

 

 

Now how to enable logs from SWFLogs.as to be printed?

Like this log 

trace("Log from SWF app");

Views

72

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Enable logs for Embedded SWF file in AIR Application

Community Beginner ,
Apr 22, 2020

Copy link to clipboard

Copied

AIR Application has simple HTML file which embeds a SWF file in it using <object>.

When debugging AIR application using ADL command, only logs related to HTML are getting printed not from SWF.

 

SWFLogs.as

package { 
    import flash.display.Sprite;
    import flash.text.TextField;
    public class SWFLogs extends Sprite 
    { 
        public function SWFLogs() 
        {
            super();
            trace("Log from SWF app");
            var textField:TextField = new TextField();
            textField.text = "Hello, World!";
            addChild(textField);
        } 
    } 
}

Compiling the above SWFLogs.as into SWFLogs.swf

flex_sdk_4.6/bin/amxmlc SWFLogs.as

 

Now embedding SWFLogs.swf into HTML

 

HelloWorld.html

<html lang="en">

<head>
    <title>Hello World</title>
</head>

<body scroll="no">
  <object type="application/x-shockwave-flash" width="100%" height="100%" AllowScriptAccess='always'>
    <param name="movie" value="app:/SWFLogs.swf" />
    <param name="wmode" value="opaque" />
    <param name='AllowScriptAccess' value='always' />
  </object>
</body>

</html>

 

Referring this above HTML in Application descriptor

HelloWorld-app.xml

<application xmlns="http://ns.adobe.com/air/application/2.7">
    <id>examples.html.HelloWorld</id>
    <versionNumber>0.1</versionNumber>
    <filename>SWFLogs.swf</filename>
    <initialWindow> 
        <content>HelloWorld.html</content>
        <visible>true</visible>
        <width>800</width>
        <height>800</height>
    </initialWindow> 
</application>

 

Running in debugging mode using ADL command from AIR

air_sdk/bin/adl HelloWorld-app.xml

 

 

Now how to enable logs from SWFLogs.as to be printed?

Like this log 

trace("Log from SWF app");

Views

73

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 22, 2020 1

Have something to add?

Join the conversation