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

App Code to Load website

New Here ,
Apr 21, 2013 Apr 21, 2013

Building an app to launch my website as soon as someone activates (touches the icon to launch) the app from their phone (Android phone or tablet).

Any help would be appreciated. I have the latest version of Flash Professional.

Thanks for your response.

TOPICS
ActionScript
1.3K
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
Community Expert ,
Apr 21, 2013 Apr 21, 2013

use:

var htmlLoader:HTMLLoader=new HTMLLoader();

addChild(htmlLoader);

htmlLoader.width = stage.stageWidth;

htmlLoader.height = stage.stageHeight;

htmlLoader.load(new URLRequest("http://www.youwebsite.com"));

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
New Here ,
Apr 21, 2013 Apr 21, 2013

Thank you for your response.

I got this responce when I tried to run the code.

Scene 1, Layer 'Layer 1', Frame 1, Line 11046: Type was not found or was not a compile-time constant: HTMLLoader.
Scene 1, Layer 'Layer 1', Frame 1, Line 11180: Call to a possibly undefined method HTMLLoader.
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
New Here ,
Apr 21, 2013 Apr 21, 2013

I'm loading the code into the Actions file. I have Adobe Cloud with all the apps.

I hit control enter and tested with ActionScript 3.0 and Air for Android. Both gave me the same error message.

Also the simulator did not fully load.

I hope this helps. I most appreciate your help.

I'm using Lynda.com and Adobe TV to try to figure this out.

Thanks again for your help.

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
Community Expert ,
Apr 21, 2013 Apr 21, 2013

import all needed classes:

import flash.html.HTMLLoader;

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
New Here ,
Apr 21, 2013 Apr 21, 2013

I'll try this later. I appreciate your help with this.

I had placed this (import flash.html.HTMLLoader;) at the top of my file.

Thanks again.

You have an Impressive resume.

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
Community Expert ,
Apr 21, 2013 Apr 21, 2013

if you used that import statement and still saw that 1046 error, you're not publishing for air.  check your publish settings.

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
New Here ,
Apr 22, 2013 Apr 22, 2013

Hey Kglad,

Your amazing... I've looked around to forum at some of your posts.

Here are the screen shots of what I'm doing. I test both on my cell and the simulator and get a pure white screen.

General.jpgDeployment.jpgPublishSettings.jpgPermissions.jpg

Icons are loaded and English for Languages.

Stage-and-Actions.jpg

I thought I was going to be able to do this...  Here is all the information I loaded and still just have a white screen.

I really appreciate all you do.

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
Community Expert ,
Apr 22, 2013 Apr 22, 2013

i thought you said you were seeing a 1046 error message?

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
New Here ,
Apr 22, 2013 Apr 22, 2013

I was when I first started this post... Now I'm getting the simulator to load but it doesn't pull the website into the phone.

I know I'm probably missing some small thing. At least I hope its a small thing.

I have several pregnancy sites that I'm trying to optomize for mobil.

All your help is most appreciated.

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
Community Expert ,
Apr 22, 2013 Apr 22, 2013

This (HTMLLoader) feature is supported on all desktop operating systems, but is not supported on mobile devices or on AIR for TV devices. You can test for support at run time using the HTMLLoader.isSupported property.

so, use stagewebview.

var webView:StageWebView = new StageWebView();

webView.stage = this.stage;

webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight );

webView.loadURL( "http://www.yourwebsite.com" );

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
New Here ,
Apr 23, 2013 Apr 23, 2013

You've been great and I'm feeling a little closer to the goal....

I used the stageview and loaded the app to my android and it works sort of...

Trying to have a browser open up and fill the screen with my website scaled to fit the screen both horizontally and vertically.

This is what I'm getting now... much improved over what I was getting before but still have to make it all adjust.

You've been awesome....  and thank you.

vertical.JPGHorizontal.JPG

Thanks again for all your understanding and patience with us newbies.

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
Community Expert ,
Apr 24, 2013 Apr 24, 2013
LATEST

you have almost no way to control the stagewebview using actionscript.  i think the best you can do (with actionscript) is to use the code i showed to open a full stage view.

however, you can use javascript on the opened web page (assuming you control it) and you can call any javascript function in the loaded web page

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