Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

HTMLLoader - Adobe ActionScript® 3 (AS3 ) API Reference

Explorer ,
Jan 17, 2013 Jan 17, 2013

This question was posted in response to the following article: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.html

TOPICS
ActionScript
831
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jan 17, 2013 Jan 17, 2013

i use this code but got error

package {

import flash.display.Sprite;

import flash.html.HTMLLoader;

import flash.net.URLRequest;

import flash.display.SimpleButton;

public class bhtml extends SimpleButton

{

public function bhtml()

{

var html:HTMLLoader = new HTMLLoader();

var urlReq:URLRequest = new URLRequest("http://www.adobe.com/");

html.width = stage.stageWidth;

html.height = stage.stageHeight;

html.load(urlReq);

addChild(html);

}

}

}

but got the error (Call to possibly undefined method addChild)

im using Flash CS5.5 (Publishing in Air in Android)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 17, 2013 Jan 17, 2013

SimpleButton can have no children.

it should say:

public class bhtml extends MovieClip

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 01, 2013 Jul 01, 2013
LATEST

i try this and its workig. thx boss

package {

     import flash.display.SimpleButton;

     import flash.display.Sprite;

     import flash.net.navigateToURL;

     import flash.net.URLRequest;

     import flash.net.URLRequestMethod;

     import flash.net.URLVariables;

     import flash.events.MouseEvent;

    public class bAEForm extends SimpleButton {

          public function bAEForm() {

               this.addEventListener(MouseEvent.CLICK,clickF);

          }

               private function clickF(e:MouseEvent):void {

                         var url:String = "http://www.google.com";

                         var request:URLRequest = new URLRequest(url);

                         var variables:URLVariables = new URLVariables();

                         variables.exampleSessionId = new Date().getTime();

                         variables.exampleUserLabel = "guest";

                         request.data = variables;

                         request.method = URLRequestMethod.POST;

                         navigateToURL(request,"_self");

                     }

          }

}

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