StageWebView viewport y offset
I'm relatively new to creating applications with FlashBuilder.
I am loading a simple HTML page in StageWebView. I compile for the simulator of the Air and the device (iPhone 4 in this case). The results show the window with an offset y to 187 pixels.
Windows 7
Flash Builder 4.7 beta
I have not had this problem with the same code in FlashBuilder 4.5 using 4.6SDK and Air3.4.
My HTML code:
<! DOCTYPE HTML >
< html >
< head >
< meta charset = "utf-8" >
< title > Test < /title >
< style type = "text/css" media = "screen" >
HTML, body {height: 100%; width: 100%; background-color: #FF0000 ;}}
Body {margin: 0; padding: 0; overflow: hidden ;}}
< / style >
< / head >
< body >
Test
< / body >
< / html >
My AS3:
public void Test()
{
Super();
testLoading();
}
private function testLoading (): void {}
webView = new StageWebView();
webView.stage = stage;
webView.viewPort = new Rectangle (0, 0, stage.stageWidth, stage.stageHeight);
var fileName:String = new queue (new File("app:/videos/video.html").nativePath) .url;
webView.loadURL (fileName);
}
In my xml application:
< autoOrients > false < / autoOrients >
true < fullscreen > < / full screen >
< visible > true < / visible >
Any suggestions? Thank you.
Can't believe that I did not notice the difference, that we had in the constructor.
I needed to include:
internship. Align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
This problem had nothing to do with the StageWebView. (Not sure if we can rename this thread or delete).
Tags: Adobe Animate
Similar Questions
-
StageWebView.drawViewPortToBitmapdata resizes. :(
Hello
I built a component view web scene that attracts and keeps the webview scene. For animations etc. I converted into a bitmap image.
It works very well in theory, but on my Nexus7, I find all this shows about 50% too big!
For EXAMPLE: Using the code below, I get the trace like this:
BUILT WITH (x = 0, y = 60, w = 1280, h = 643)
Stuff in the middle like a product animation
SCALES: (x = 0, y = 0, w = 1280, h = 703)
(x = 0, y = 60, w = 1920, h = 964.5)
As you can see, the bitmap data is created in the right size, but as soon as I post it, it seems to resize to 1280 x 643 to 1920x964.5...
This, I hasten to add, looks naff.
Someone else has encountered this and someone else has a work around?
Thank you
G
/**
* When it is true, replace StageWebView with a bitmap overlay instead
order to ensure that animations work smoothly.
*/
[Bindable]
public function get showBitmapNotBrowser (): Boolean {}
Return _showBitmapNotBrowser;
}
private var _showBitmapNotBrowser:Boolean = false;
private var _showBitmapNotBrowserInvalid:Boolean = false;
public function set {showBitmapNotBrowser(b:Boolean):void}
_showBitmapNotBrowser = b;
_showBitmapNotBrowserInvalid = true;
invalidateProperties();
}
protected var browserBitmap:Bitmap;
override protected function commitProperties (): void {}
{if (_showBitmapNotBrowserInvalid)}
If (showBitmapNotBrowser) checkBuildBitmap();
of other checkUnbuildBitmap();
}
super.commitProperties ();
}
/**
* Replaces browser with bitmap displays.
*/
protected function checkBuildBitmap (): void {}
If (browserBitmap) return;
var r: Rectangle = stageWebView.viewPort;
trace ("BUILT WITH" + r);
var bdd:BitmapData = new BitmapData (r.width, r.height);
stageWebView.drawViewPortToBitmapData (bdd);
browserBitmap = new Bitmap (bdd);
addChild (browserBitmap);
hideStageWebView();
}
/**
* Removes a displayed bitmap to browser, as appropriate.
*/
protected function checkUnbuildBitmap (): void {}
{if (browserBitmap)}
var r: Rectangle = browserBitmap.getBounds (internship);
trace ("SCALES: '+ (new Rectangle(0,0,stage.stageWidth,stage.stageHeight))+"\n\t"+r);")
removeChild (browserBitmap);
browserBitmap.bitmapData.dispose ();
browserBitmap = null;
}
this.checkBrowserVisibility ();
}
OK, I have a workaround:
/** * Replaces browser with bitmap displays. */ protected function checkBuildBitmap (): void {} If (browserBitmap) return; var r: Rectangle = stageWebView.viewPort; var bdd:BitmapData = new BitmapData (r.width, r.height); stageWebView.drawViewPortToBitmapData (bdd); browserBitmap = new Bitmap (bdd); browserBitmap.width = unscaledWidth; browserBitmap.height = unscaledHeight; addChild (browserBitmap); hideStageWebView(); } No, I know what it _shoudn't_ be necessary, but it is relatively painless and it works.
G
-
Ok
By using this code to call on iOS youtube videos:
var htmlString:String = "<! "DOCTYPE HTML >" +.
"< html >" +.
"< body >" +.
"< iframe class =------'youtube-Flash' style =------" border: 0; ". Width: 100%; height: 100%; padding: 0px; "" margin: 0px\ "id =-"ytplayer\"type =------' text/html\' src =------'http://www.youtube.com/embed/' + '.
"YOUTUBE-ID '+'?" "fs = 0" frameborder =------"0" > \n ' + ' < / iframe > \n ";
"< / body >" +.
"< / html >"
webView.loadString (htmlString, ' text/html');
I began to modify it to call a video vimeo, and got this:
var stageWebView:StageWebView = new StageWebView();
stageWebView.stage = stage;
stageWebView.viewPort = new Rectangle (0, 0, 700, 500);
var htmlString:String = "<! "DOCTYPE HTML >" +.
"< html >" +.
"< body >" +.
"<iframe src=\" http://Vimeo.com/VideoID "" -"width =------"640\"height =-"480\"frameborder =------'0' webkitAllowFullScreen mozallowfullscreen allowFullScreen > < / iframe > \n";
"< / body >" +.
"< / html >"
stageWebView.loadString (htmlString, ' text/html');
And the video call perfectly, except for one small thing. IT IS THERE NO CONTROLS! xD.
has updated the code to the source calling it the video like this: http://Player.Vimeo.com/video/VideoID , which is suppose to be the default embed player for iframe html, and nothing is happening.
Now I try to get it with moogaloops (player swf for actionscript) but still can not get to run.
Any IDEAS!?
katyana_89!
Solved!
import flash.media.StageWebView;
import flash.geom.Rectangle;
var stageWebView:StageWebView = new StageWebView();
stageWebView.stage = stage;
stageWebView.viewPort = new Rectangle (0, 0, 700, 500);
var htmlString:String = " " +.
"" +
"
" +""http://player.vimeo.com/video/52263761------"width =------"640\"height =-"480\"frameborder =------'0' webkitAllowFullScreen mozallowfullscreen allowFullScreen ><\ frame="">\n";
"\>" +
"";
stageWebView.loadString (htmlString, ' text/html');
try {Security.allowDomain("*") ;} catch (e) {};}
On Ipad works!
-
StageWebView and paths related CBC
Hello
How can I get it works please on an iOS device:
stageWebView=new StageWebView(); stageWebView.stage=this.stage; stageWebView.viewPort=new Rectangle(0,0,800,600); stageWebView.loadString('<img src="images/some_image.gif"/>');
If I use an absolute as path: http://mysite.com/images/some_image.gif , it loads the image.
I want to have them stored locally.
Thank you.
Hello
I can't test on the device, but here:
in the section "Content", which is explicitly stated that if the html string is loaded via the loadString method it cannot load local content (this could lead to exploit otherwise: user provides a few links Tags which realized the extraction contents of sandbox application - fixed (static) page so it had to be used to load local content) ", I think),
Kind regards
Peter
-
I searched the site and blog to try to find a method that actually works without success.
I want to load a pdf file from the directory of the application on the android, the method works very well on a desktop debugging
but crashes on a real device.
I have a Motorola Xoom with honeycomb 3.
In my project, I use a local sql database and can access this fine on the Xoom.
public void listGroups(brand:String):Array
{
var sqlConnection:SQLConnection;
sqlConnection = new SqlConnection ();
sqlConnection.open (File.applicationDirectory.resolvePath ("manuals.db"));
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConnection;
stmt. Text =
"SELECT * FROM keywords"+ ".
"WHERE the mark = '" + brand + "'"; "
stmt. Execute();
Table of results: var = stmt.getResult () .data;
return the result;
}
But I can't have a path for the pdf file to open it in a StagewebView using one of the variable path that I have.
< fx:Script >
<! [CDATA]
Import mx.events.FlexEvent;
private var stageWebView:StageWebView;
loads a file pdf or swf from local storage
Channel: public path var = new queue (new File("app:/Alpha.pdf").nativePath) .url;
public var manualFile:String = new queue (File.applicationDirectory.resolvePath("Alpha.pdf").nativePath) .url;
protected function applicationCompleteHandler(event:FlexEvent): void
{
{if(StageWebView.IsSupported== true)}
stageWebView = new StageWebView();
stageWebView.viewPort = new Rectangle (5,100,stage.width-10,stage.height-90);
stageWebView.stage = this.stage;
stageWebView.addEventListener (LocationChangeEvent.LOCATION_CHANGE,
locationChangedHandler);
stageWebView.loadURL (manualFile);
} else {}
urlAddress.text = "StageWebView"; not supported
}
}
I'm starting to think that it is impossible, everyone knows to do this, maybe another android device.
Any thoughts would be great, an even better solution.
Have you tried to open file.
applicationStorageDirectory?
This issue is much more open with the permissions.
On Android that maps on:
/ Data/Data/air. ApplicationId/filename/local store
Post edited by: DonMitchinson
Actual path added on Android -
A StageWebView of loading will appear empty on my iDevice
I'm developing an application iOS on CC animate. I tried to use the StageWebView class in the application to display a Web page, but despite all my efforts on the documents of the following letter, I was unable to view the Web page on my iPad, nor on my iPhone. It works perfectly well on the Launcher of debugging AIR (test movie), but when I run it on one of the devices, all I see is a white rectangular void. I wonder if this class has no support IOS or there is another reason. I'd be happy if someone could help me on this issue.
Code:
import flash.net.URLRequest;
import flash.media.StageWebView;
import flash.geom.Rectangle;
var webView:StageWebView;
click_openWeb.addEventListener (MouseEvent.CLICK, click_openWeb);
function click_openWeb(event:MouseEvent):void
{
{if(webView!=null)}
return;
}
webView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle (0, 200, 400, stage.stageWidth);
webView.loadURL ("http://google.com" "");
}
closeWeb.addEventListener (MouseEvent.CLICK, click_closeWeb);
function click_closeWeb(event: MouseEvent): void {}
{if(webView==null)}
return;
}
webView.viewPort = null;
webView.dispose ();
webView = null;
}
I added a few touches of InfoAdditions in my application descriptor file:
NSAppTransportSecurity NSAllowsArbitraryLoads Now it works perfectly
-
Android StageWebView debugging does not work
Does anyone use this feature? He works?
SDK: AIR 21 SDK & compile for Macintosh: 21.0.0.176 SDK & compiler download
Descriptor of the App:
<?xml version="1.0" encoding="utf-8" standalone="no"?> <application xmlns="http://ns.adobe.com/air/application/21.0"> ... <android> <webContentsDebuggingEnabled>true</webContentsDebuggingEnabled> ...
USB debugging:
StageWebView AS3:
... if (StageWebView.isSupported) { webView = new StageWebView(true); // false - also StageWebView debugging isn't working webView.stage = this.stage; webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight); webView.loadURL(url); } ...
App with StageWebView open, but is not inspected WebView.
Hello
We have examined this issue at our end, and Android StageWebView debugging works very well. Please see photos below for your reference:
We have examined this question to the 48 version 5.0 Android and chrome with AIR SDK 21.0.0176.
Could you please let us know what version of Android and chrome work currently on. It should be 4.4 + for Android and chrome version should be 45 years and more, please update that your versions if they are lower than specified and then try.
Please let us know if you still have problems with the updated versions.
Thank you
Adobe AIR Team
-
How to view the StageWebView page in Flash Professional app .ipa
I need to display a .mp4 file in a small application I build for iPad with Flash Professional CC. The best way seems to be StageWebView, but I can't get this to work. I found a code that is supposed to do the trick, but I keep getting errors: 1180: call to a method may not set file.
Can someone give me please help with this?
var webView = new StageWebView(); webView.stage = this.stage; webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight); var path:String = new File(new File("app:/path/file.html").nativePath).url; webView.loadURL("app:/path/file.html");
at the beginning of your lines of code, add:
import flash.filesystem.File;
-
Flash IOS StageWebView no sound
Hi guys,.
I would just ask if you have encountered a html5 with the video tag on your rendering air application and end up with no sound.
I wonder because when a deployment on my ipad, video works perfectly but theres no sound playback.
I hope you could help me guys. I'm already in pain for the last 2 days.
Here is my code:
protected function onAddedToStage(evt:Event):void
{
webView var = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle (0, 0, 500, 400);
var path: String = new file (new File("app:/html/test.html").nativePath) .url;
webView.loadURL (path);
}
HTML file:
< html >
< head >
< title > Test < /title >
< / head >
< body >
< video width = "500" height = "500" controls >
< src = "source Eh_1.mp4" type = "video/mp4" > "
Your browser does not support the video tag.
< / video >
< / body >
< / html >
Thank you guys so much.
It seems that my video has no sound on ipad 2 but when I plugged my headset it works well. I tested it on air ipad and everything works fine.
-
Hello world.
I am in a project mobile flash builder.
I just want to ask if there is anyway to do stageWebView of "slide in" stage?
This component is like a different world, it can be added as item (or child), and the only way to set its position is the viewport.If "Slide in" is not possible, then fade is also nice. Just need something more sophisticated than just pop up like that.
PLEASE HELP ME!
It turns out I was right. You can do it like that. You can see the proof of concept and my source code here.
-
stagewebview persists through mobile flex tabs
I have an application mobile flex with 4 tabs. On one of them, I use the stagewebview. When I go first tab that's showing the webview, but then if I go to one of the other tabs it is always there obscurring my other components.
Why it persists through the tabs?
Thank you
I thought about it.
this.addEventListener (ViewNavigatorEvent.VIEW_DEACTIVATE, removeWebView);
private void removeWebView(e:Event) {}
webView.viewPort = null;
webView.dispose ();
webView = null;
}
-
StageWebView does not appear on the iPad
Hey all,.
I use a simple document. There is nothing in the library and the SWF is pointed to the class 'Hand' (Main.as is in the same folder). All the Main.as has this code super complex:
package
{
import flash.display.MovieClip;
import flash.geom.Rectangle;
import flash.media.StageWebView;
SerializableAttribute public class Main extends MovieClip
{
private var swv:StageWebView = new StageWebView();
public void Main()
{
SWV.stage = stage;
swv.viewPort = new Rectangle (0, 0, 1024, 768);
swv.loadURL ("http://www.google.com' ');
}
}
}Nothing is displayed. I run it in flash (ctrl + enter to test the movie) and I see google load. I see absolutely nothing on the ipad2. Ideas, I do not see why the StageWebView?
StageWebView not work when you use test movie, compile and convert to ipa and check it into the ipad, it will work.
-
Video not playing is not in iOS with StageWebView
I'm working on an iPhone application as part of a master project and need help to make my videos to work. I'm a designer, not a coder, so I was struggling with this a little. I get to the end of my year so any help is greatly appreciated. In another thread on this forum, I got a code on a StageWebView, however when I get to the frame where the video needs to play... I get a white box, with no video game. Here is the code that I have on this image...
import flash.geom.Rectangle;
import flash.media.StageWebView;
import flash.filesystem.File;
var webView:StageWebView = new StageWebView();
webView.stage = this.stage;
webView.viewPort = new Rectangle (0,0,stage.stageWidth,stage.stageHeight);
var fPath:String = new queue (new File("objects.flv").nativePath) .url;
webView.loadURL (f);
I made sure to include video files provided with the application.
Help please!
stagewebview can play H.264 Movies, so likely a .mp4. You play an flv, which is not H.264. You can play FLV files with normal methods of video in Flash, which can be as simple as having a component FLVPlayback instance on the stage and by setting its source on the flv file.
-
AppName: firefox.exe AppVer: 7.0.1.4288 ModName: msvcr90.dll
ModVer: 9.0.30729.4148 Offset: 00059231Had both until after the upgrade to firefox.
Occurs especially during scrolling or by opening the page modules.
Please update your browser Firefox 8 and try
-
Question
I pressed (Control) (offset) when to bet and my characters of Gmail (the full screenshot) reduced to about 25 to 35%. How to restore? I already signed my Gmail account, restarted my computer (Windows XP has) nothing works.'Ctrl + 0' (zero) to restore normal size
Maybe you are looking for
-
Pavilion DM1: Failure of HD
I have run the test BIOS HD and get Smart Check: PAST DST short: FAILURE FAILURE ID: RGDXHG-5S27LC-FEHV4K-60TE03 PRODUCT ID: LY997LA #AC4 1 hard disk What is the problem, does anyone know? Need a new HD? THX
-
Photosmart C7250 all-in-one: compatibility Windows 10 for HP Photosmart C7250 all-in-one
Hello. I have a HP Photosmart C7250 all-in-one, which I am currently using with Windows 8.1 I think upgrade to Windows 10. This printer is not compatible with Windows 10? If so, do we need to download a new driver? Which one? Thanks for your help
-
Files appear in 'Read only' and unable to change that.
I have Windows 7 Ultimate. A couple of weeks, I had a big problem with some of my permissions of the user being edited (don't know how I did it but it happened) so I was unable to access programs and files, after awhile with a MS tech on cat and a sy
-
How can I run Microsoft Money on Windows 7?
Microsoft Money does not work on my PC after installation of Windows 7 Home Premium. Should I upgrade to a different version of Windows?
-
Download windows 7 Home premium 64-bit Portuguese
Hello I have buyed a laptop 5 years ago and have windows 7 Home premium 64-bit Portuguese (portugal). now I m having some problems on my laptop (bluescreens), when I try to recovery ask me original cd. I have the original OEM key and need to download