Copy link to clipboard
Copied
This question was posted in response to the following article: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/html/HTMLLoader.html
Copy link to clipboard
Copied
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)
Copy link to clipboard
Copied
Copy link to clipboard
Copied
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");
}
}
}
Find more inspiration, events, and resources on the new Adobe Community
Explore Now