StageWebView viewport y offset

I'm fairly new to building apps with FlashBuilder.
I'm loading a simple HTML page into StageWebView.   I compile for both the Air Simulator and the device ( iPhone 4 in this case ). The results show the viewport having a y offset of 187 pixels.
Windows 7
Flash Builder 4.7 beta
I did not have this problem with the same code in FlashBuilder 4.5 using 4.6SDK and Air3.4.
My HTML:
<!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 function 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 File(new File("app:/videos/video.html").nativePath).url;
            webView.loadURL(fileName);           
In my App xml:
         <autoOrients>false</autoOrients>
        <fullScreen>true</fullScreen>
        <visible>true</visible>
Any suggestions?  Thanks.

Thanks for verifying it works on your system.
We're both using Win7 64, FB4.7 64 . . but I'm using AIR3.4.  That's the only difference I see.
I essentially copied your code and this is what I get in the pic below.   Btw..I tried changing the values for autoOrients and fullscreen in the app.xml with no success in correcting the issue.

Similar Messages

  • Problem with Android 4 StageWebView cutting off/covering up buttons on same View

    So I'm trying to pull off something similar to the example here: http://cookbooks.adobe.com/post_Create_a_basic_web_browser_with_StageWebView-18850.html. Basically, a native browser view with a few Flex controls over top. Problem is, I've been running into a lot of display problems on Android 4 devices specifically. As far as I can tell, the StageWebView seems to be preventing the button overhead from being rendered in part or *at all* - as in, the button doesn't show up at all. It's just black.
    See for yourselves. Here's a screenshot (the test page has a yellow background):
    If I touch the screen or the web view, the button will (usually) abruptly show up above the page, where it's supposed to be:
    Anyone else seen anything like this before? Any ideas what it could be?
    Additional information for those who might want it:
    - Project is being developed in Flash Builder 4.6 with the 4.6 SDK. Screenshots are from a Google Nexus 7 tablet (Android version 4.1.2, Adobe AIR version 3.4.0.254).
    - the view in this case is an ActionScript class extending View with a skin. Here's the relevant code:
    [SkinState("ready")]
    [SkinState("loading")]
    public class LogInWebView extends View
              [SkinPart(required="false")]
              public var previousButton:Button;
              private var browser:StageWebView;
              private var url:String;
              private var isFirstPageLoaded:Boolean;
              public function LogInWebView()
                        super();
                        isFirstPageLoaded = false;
              override public function set data(value:Object):void {
                        url = value.url;
                        invalidateProperties();
              // protected functions
              override protected function createChildren():void {
                        super.createChildren();
                        if (url) {
                                  browser = new StageWebView();
                                  browser.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
                                  browser.addEventListener(Event.COMPLETE, onFirstPageLoaded, false, 0, true);
                                  browser.loadURL(url);
              override protected function partAdded(partName:String, instance:Object):void {
                        super.partAdded(partName, instance);
                        if (instance === previousButton) {
                                  previousButton.addEventListener(MouseEvent.CLICK, onPreviousButtonClick, false, 0, true);
                                  if (browser) {
                                            browser.viewPort = new Rectangle(0, previousButton.height, stage.stageWidth, stage.stageHeight-previousButton.height);
              override protected function commitProperties():void {
                        if (isFirstPageLoaded && currentState != "ready" && browser) {
                                  // display StageWebView now that it's loaded
                                  skin.currentState = "ready";
                                  browser.stage = this.stage;
                        } else if (currentState != "loading") {
                                  skin.currentState = "loading";
                        super.commitProperties();
              // event listeners
              private function onFirstPageLoaded(event:Event):void
                        browser.removeEventListener(Event.COMPLETE, onFirstPageLoaded);
                        isFirstPageLoaded = true;
                        invalidateProperties();
    - note: the button ONLY appears in state "ready" - it's not in state "loading."
    Your thoughts?

    Hi,
    Not sure what your specific problem is, but I have encountered no problems at all by going a stage further with my implementation - it is based on http://soenkerohde.com/?s=stagewebview but I extended it to update on dimension changes of the container.
    EG:
    [code]
    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
    super.updateDisplayList(unscaledWidth,unscaledHeight);
    updateBrowser();
    protected function updateBrowser(event:ResizeEvent=null):void {
    if(myStage && stageWebView) {
      var offsets:Point = new Point();
      offsets = this.localToGlobal(offsets);
      stageWebView.viewPort = new Rectangle(offsets.x, offsets.y, unscaledWidth, unscaledHeight);
    [/code]
    Seems to work for me, anyway. Hope it does for you too.
    G

  • Problem trying touse stageWebView on flex mobile

    Hi I've been trying to figured it out , but it seems I've been doing everything by the book, but nothing happens.
    here is my code is on a <s:view> and there is no way to call the function, when I wrote public still nothing happens, I know that the answer is maybe easier as I tough.
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark" title="Blog-FLS" activate="webView(event)">
      <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
      </fx:Declarations>
    <fx:Script>
              <![CDATA[
                        import mx.events.FlexEvent;
                        private var stageWebView:StageWebView;
                        public function webView(event:FlexEvent):void{
                                  if (StageWebView.isSupported==true){
                                            stageWebView= new StageWebView();
                                            stageWebView.viewPort = new Rectangle(5,80,stage.width-10,stage.height-90);
                                            stageWebView.stage = this.stage;
                                            stageWebView.loadURL("http://google.com");
                                  } else{trace("algo pasa") };
              ]]>
    </fx:Script>
    </s:View>
    I don't know how to activate this on the view since it looks impossible to do it from the application itself some help will be appreciated
    Gus

    Try using viewActivate instead of activate

  • "relative" positioning of buttons in a JFrame

    I want to draw an image as a background on a JFrame and then position several buttons in the frame such that when the frame is resized, the background is resized and the buttons remain "over" the same thing in the background image. I've tried to "do the right thing" and use a layout manager to position the buttons, but they just don't seem to behave like I need them to.
    Is there an easy way to get a button to appear at e.g. 70% horizontally across the frame and 40% down the frame? And then when I resize, have the button still be 70% across and 40% down (based on the new size of the frame). Or should I just give up on the layout managers, and calculate my own absolute positions for everything?
    Thanks

    Check this out:
    import javax.swing.*;
    import java.awt.*;
    public class CompassButtons extends JFrame {
      JButton nb = new JButton("North");
      JButton sb = new JButton("South");
      JButton eb = new JButton("East");
      JButton wb = new JButton("West");
      JViewport viewport = new JViewport();
      public CompassButtons() {
        super("SpringLayout Compass Demo");
        setSize(500,300);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        SpringLayout sl = new SpringLayout();
        Container c = getContentPane();
        c.setLayout(sl);
        int offset = 50;  // gap between buttons and outside edge
        int w      = 80;  // width of buttons
        int h      = 26;  // height of buttons
        int border =  3;  // border around viewport
        Spring offsetS     = Spring.constant(offset);
        Spring borderS     = Spring.constant(border);
        Spring widthS      = Spring.constant(w);
        Spring halfWidthS  = FractionSpring.half(widthS);
        Spring heightS     = Spring.constant(h);
        Spring halfHeightS = FractionSpring.half(heightS);
        Spring leftEdgeS   = sl.getConstraint(SpringLayout.WEST, c);
        Spring topEdgeS    = sl.getConstraint(SpringLayout.NORTH, c);
        Spring rightEdgeS  = sl.getConstraint(SpringLayout.EAST, c);
        Spring bottomEdgeS = sl.getConstraint(SpringLayout.SOUTH, c);
        Spring xCenterS    = FractionSpring.half(rightEdgeS);
        Spring yCenterS    = FractionSpring.half(bottomEdgeS);
        Spring leftBorder  = Spring.sum(leftEdgeS, borderS);
        Spring topBorder   = Spring.sum(topEdgeS, borderS);
        Spring northX = Spring.sum(xCenterS, Spring.minus(halfWidthS));
        Spring southY = Spring.sum(bottomEdgeS, Spring.minus(Spring.sum(heightS,
                                                                        offsetS)));
        Spring eastX = Spring.sum(rightEdgeS, Spring.minus(Spring.sum(widthS,
                                                                      offsetS)));
        Spring eastY = Spring.sum(yCenterS, Spring.minus(halfHeightS));
        c.add(nb, new SpringLayout.Constraints(northX, offsetS, widthS, heightS));
        c.add(sb, new SpringLayout.Constraints(northX, southY, widthS, heightS));
        c.add(wb);
        sl.getConstraints(wb).setX(offsetS);
        sl.getConstraints(wb).setY(eastY);
        sl.getConstraints(wb).setWidth(widthS);
        sl.getConstraints(wb).setHeight(heightS);
        c.add(eb);
        sl.getConstraints(eb).setX(eastX);
        sl.getConstraints(eb).setY(eastY);
        sl.getConstraints(eb).setWidth(widthS);
        sl.getConstraints(eb).setHeight(heightS);
        c.add(viewport); // this sets a bounds of (0,0,pref_width,pref_height)
        // The order here is important...need to have a valid width and height
        // in place before binding the (x,y) location
        sl.putConstraint(SpringLayout.SOUTH, viewport, Spring.minus(borderS),
                         SpringLayout.SOUTH, c);
        sl.putConstraint(SpringLayout.EAST, viewport, Spring.minus(borderS),
                         SpringLayout.EAST, c);
        sl.putConstraint(SpringLayout.NORTH, viewport, topBorder,
                         SpringLayout.NORTH, c);
        sl.putConstraint(SpringLayout.WEST, viewport, leftBorder,
                         SpringLayout.WEST, c);
        ImageIcon icon = new ImageIcon("images/terrain.jpg");
        viewport.setView(new JLabel(icon));
        // Hook up the buttons.  See the CompassScroller class (on-line) for details
        // on controlling the viewport.
        nb.setActionCommand(CompassScroller.NORTH);
        sb.setActionCommand(CompassScroller.SOUTH);
        wb.setActionCommand(CompassScroller.WEST);
        eb.setActionCommand(CompassScroller.EAST);
        CompassScroller scroller = new CompassScroller(viewport);
        nb.addActionListener(scroller);
        sb.addActionListener(scroller);
        eb.addActionListener(scroller);
        wb.addActionListener(scroller);
        setVisible(true);
      public static void main(String args[]) {
        new CompassButtons();
    }Copyright 2003, O'Reilly & Associates
    Provided as example.
    Cheer
    DB

  • Is it possible to flip stage video playback horizontally on iOS?

    I'm using stage video in an app to play back some video and it would be useful if I could offer users the option to flip the video along the horizontal axis. 
    i.e. the equivalent of scaleX = -1 on a normal display object. 
    The reason I want to do this is that the video is of people and flipping the video would flip their handedness (so right handers become left handers).
    Is this possible?  It is quite easy to do with 'normal' video (i.e. scaleX = -1) but on iPad I am using stageVideo (primarily to try to maximse performance which I belive stageVideo does) and as it isn't a real display object it doesn't have the necessary scaleX property.
    Does anyone know if this is possible?

    I'm using Flash CS6 and stageWebVideo (not stageVIdeo).  If you're asking if the video window can be changed when the device orientation is changed, this is how I did it:
    // Landscape orientation
    videoFile = MovieClip(root).imagesPath + "31_resources.pdf";
    stageWebView = new StageWebView(); 
    stageWebView.stage = stage;
    if (stageOrientation == "horiz") {
    stageWebView.viewPort = new Rectangle(((resolutionY-940)/2), 210, 940, 430);
    // Then... when changed to Portrait orientation...
    if (stageWebView != null) {
       stageWebView.viewPort = new Rectangle(0, 285, 640, (resolutionY - 285));
    In other words, I change the stageWebView.viewPort rectangle accordingly when device orientation changes.  Not sure if this helps you.

  • StageWebView x offset problem

    I'm using StageWebView to load SWF files or HTML pages with SWF content on my Adobe Air 3.8 app for Android and I have a problem when I set the X offset in the viewport. The SWF gets cut off on the right side.
    See this screenshot:
    The viewport covers the area enclosed in the  rectangle with a grey border but a portion of the rhino gets cut off. If I set the X offset to 0, the webview instance shows the SWF properly but the higher the X offset the wider the portion that gets cut off.
    I need to add this happens only on Android running ICS (4.0.4). On devices running Jelly Bean, such problem does not happen.
    One more thing: the black "patch" that covers the rhino part is the background color of the swf. I tested this problem with different SWFs and the strip that shows up on the right side is always of the same color as the remote SWF's background.
    I need to show SWF content centered on the stage and this offset bug is a killer.
    Does anybody know of a fix for a problem like this?
    My code:
    function loadFlashWebView():void {
        //load Flash webview for testing plugin
        webView = new StageWebView();
        webView.stage = this.stage;
        webView.loadURL(flashTestURL);
        webView.addEventListener(Event.COMPLETE, onLoadFlashViewComplete);
    function onLoadFlashViewComplete(evt:Event):void {
        //load view complete handler
        trace("Web view finished loading. Error: " + webview_error);
        webView.viewPort = new Rectangle(67, 80, stage.stageWidth, stage.stageHeight); //the swf gets cut off in ICS
    var flashTestURL:String = "http://mywebsite.com";
    var webView:StageWebView;

    Hi Laurent,
    Which DAQmx driver version are you using?
    It seems that the behavior you have was an unexpected one:
    Error -200478 occurs when using DAQmx Perform Bridge Offset Nulling Calibration with AI.Temp.TC and ...
    Neverthless, it was corrected in DAQmx 9.6 (see CAR 345144):
    DAQmx 9.6 Readme
    Regards,
    Valentin
    Certified TestStand Architect
    Certified LabVIEW Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    Travaux Pratiques d'initiation à LabVIEW et à la mesure
    Du 2 au 23 octobre, partout en France

  • Load a PDF in StageWebView - iOS

    I am trying to create an iOS app that loads my companies product catalogue into a webview stage. I cannot figure out after a lot of google how to access this local file, although external files load fine. I'm trying to use the "file:" command. I'm doing this in flash builder.
    <![CDATA[
                                  import flash.display.MovieClip;
                                  import flash.media.StageWebView;
                                  import flash.geom.Rectangle;
                                  var webView:StageWebView = new StageWebView();
                                  var yOffset = 47
                                                 public function FestoKP() {
                                                           webView.stage = this.stage;
           webView.viewPort = new Rectangle( 0, yOffset, stage.stageWidth, stage.stageHeight - yOffset);
           webView.loadURL( "file:///asset/Festo_KP_Catalogue.pdf" );
                                                           closeBtn.visible = true
           public function Close() {
           webView.stage = null;
           closeBtn.visible = false;

    In the example below, I included a close button to close the webview. This function is at the bottom. Y-offset is the height of the toolbar at the top.
    <fx:Script>
              <![CDATA[
                   import flash.display.MovieClip;
                   import flash.media.StageWebView;
                   import flash.geom.Rectangle;
                   var webView:StageWebView = new StageWebView();
                   var yOffset = 45;
                   var yTabs = 54;
                   //var yOffset = 90;
                   //var yTabs = 107;
                   private function loadDSPF():void {
                        webView.stage = this.stage;
                        webView.viewPort = new Rectangle( 0, yOffset, stage.stageWidth, stage.stageHeight - yOffset );
                        var fileName:String = "foldername/filename";
                        var sourceFile = File.applicationDirectory.resolvePath( fileName );
                        var workingFile = File.createTempFile();
                        try
                             sourceFile.copyTo( workingFile, true );
                             // You have to rename the temp file
                             var renamedTempFile:File = workingFile.resolvePath(workingFile.nativePath + fileName);
                             workingFile.moveTo(renamedTempFile, true);
                             webView.loadURL( renamedTempFile.url );
                             closeBtn.visible = true;
                        catch (err:Error) { }
                   public function Close() {
                        webView.stage = null;
                        closeBtn.visible = false;
                        allBtn.enabled = true;
              ]]>
         </fx:Script>
    hope that helps. I can explain anything else if you need.

  • Open StageWebView link in new window

    I have a StageWebView displaying a webpage containing ads that are coming in from AdMob (due to their current lack of support for AS3 and AIR for Android).
    However, when a user clicks on the ad, the linked page opens in that small window, so the content is barely even readable. Is there a way to make the browser open the intended link in a new window, seperate from my app?
    Obviously AdMob ads were not intended to work this way, as both the user and the adveriser are getting cheated here (due to AdMob's current lack of support for AS3 and AIR for Android).
    Thanks!

    I have a question as well.  I'm trying to display a stagewebview when the button is clicked but I want the stage webview to be on a new frame and take up the entire frame.  Here is code I have found but I can't get this to work like I need it to.
    I'm trying to get Stagewebview to show on a new stage when a button is clicked.  Right now it just shows on the same stage  becuase code is this.stage.
    Also, when it shows up on the new page I want to have back button, forward, and refresh and I want it on the top and not taking alot of space and only on the screen where it's showing the web view.
    Please help!!!!!!!!!!
    Here is the code:
    stop();
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    stage.align = StageAlign.TOP_LEFT;
    stage.scaleMode = StageScaleMode.NO_SCALE;
    var webView:StageWebView;
    var swvRect:Rectangle;
    var swvHeight:Number;
    var uiElemsTop:Number=140;
    var swvY:Number=140;
    var uiElemsBot:Number=40+20+75+20;
    var uiElemsHeight:Number=uiElemsTop+uiElemsBot;
    infoBox.text="";
    infoBox.visible=false;
    mainPanel.visible=false;
    webBtnsPanel.visible=false;
    mcStart.addEventListener(MouseEvent.CLICK,init);
    function init(e:MouseEvent):void {
        mcStart.removeEventListener(MouseEvent.CLICK,init);
        mcStart.visible=false;
        mainPanel.btnExit.addEventListener(MouseEvent.CLICK, exitApp);
        mainPanel.btnCloseSwv.addEventListener(MouseEvent.CLICK,closeSwv);
        mainPanel.btnOpenSwv.addEventListener(MouseEvent.CLICK, openSwv);
        infoBox.text="Click open stage web view to begin";
        webBtnsPanel.btnNext.addEventListener(MouseEvent.CLICK, nextPage);
        webBtnsPanel.btnPrev.addEventListener(MouseEvent.CLICK, prevPage);
        webBtnsPanel.btnReload.addEventListener(MouseEvent.CLICK, reloadPage);
        webBtnsPanel.btnStop.addEventListener(MouseEvent.CLICK, stopPage);
        swvHeight=stage.stageHeight-uiElemsHeight;
        infoBox.x=stage.stageWidth/2-infoBox.width/2;
        infoBox.y=stage.stageHeight-40;
        mainPanel.x=stage.stageWidth/2-mainPanel.width/2;
        webBtnsPanel.x=stage.stageWidth/2-webBtnsPanel.width/2;
        webBtnsPanel.y=140+swvHeight+20;
        mainPanel.visible=true;
        infoBox.visible=true;
    //When the user taps on Exit button, the app quits.
    function exitApp(event:MouseEvent):void {
        NativeApplication.nativeApplication.exit(0);
    function closeSwv(event:MouseEvent):void {
        if(webView==null){
            return;
         webView.removeEventListener(ErrorEvent.ERROR,onError);
         webView.removeEventListener(LocationChangeEvent.LOCATION_CHANGING,onC hanging);
         webView.removeEventListener(Event.COMPLETE,onComplete);
         webView.viewPort=null;
         webView.dispose();
         webView=null;
         webBtnsPanel.visible=false;
         infoBox.text="Click open stage web view to begin";
    function openSwv(event:MouseEvent):void {
        if(webView!=null){
            return;
         webBtnsPanel.visible=true;
         infoBox.text="";
         webView=new StageWebView();
         webView.stage= next.stage;
         webView.viewPort=new Rectangle(0,swvY,stage.stageWidth,swvHeight);
         webView.addEventListener(ErrorEvent.ERROR,onError);
         webView.addEventListener(LocationChangeEvent.LOCATION_CHANGING,onChan ging);
         webView.addEventListener(Event.COMPLETE,onComplete);
         webView.loadURL("http://www.math.uri.edu/~bkaskosz/webview/index.html");
    function onError(e:ErrorEvent):void {
        infoBox.text="Page is not available. Try reloading.";
    function onChanging(e:LocationChangeEvent):void {
        infoBox.text="Loading...";
    function onComplete(e:Event):void {
        infoBox.text="";
    function nextPage(e:MouseEvent):void {
        if(webView==null){
            return;
        if(!webView.isHistoryForwardEnabled){
            return;
        webView.historyForward();
    function prevPage(e:MouseEvent):void {
        if(webView==null){
            return;
        if(!webView.isHistoryBackEnabled){
            return;
        webView.historyBack();
    function reloadPage(e:MouseEvent):void {
        if(webView==null){
            return;
        webView.reload();
    function stopPage(e:MouseEvent):void {
        if(webView==null){
            return;
        webView.stop();

  • Sudden error I can't find and StageWebView (AIR for iOS)

    Hey all,
    In my app I allow a user to download files from a list and then typically use StageWebViews to display them (videos mostly). Recently my app started to misbehave.
    I'm using Flash Builder 4.6 with AIR 3.2 on Win7 Pro 64.
    I test on-device. I choose fast export (quick packaging) and debug right from Flash Builder so I can see traces/errors/etc from the iPad.
    After downloading a ~40MB MP4, I save it to the applicationStorageDirectory (and mark it 'do not back up'). I then wait 3 seconds just to be sure the write has a few seconds to complete. Then I black out the screen with a black sprite, stick a close button on the screen and load the video into a new StageWebView.
    The problem is the first time these larger 40MB videos are saved and attempted, TONS of code isn't firing off or affecting the display. The video plays just fine, centered on the screen. However all the code to remove tons of things from memory during video playback which has tons of trace statements sprinkled in is simply not affecting the iPads display. This ONLY happens on iPad1 (OS 5.1). iPad2 and iPad3 work just fine.
    I presumed I was being too aggressive with the iPad1 and added more and more time between downloading, saving and setting the bit on the file so the iPad1 wasn't innundated with doing to much at once. I can add 25 minutes worth of setTimeout between playing this video for the first time and it will fail every time though. So it's not being innundated.
    If the video is already downloaded and a user selects it, it works perfectly fine. All views/classes are disposing properly to free up as much ram as possible for the video playback.
    Now, I'm getting this error randomly:
    Error #2044: Unhandled ErrorEvent:. text=Plug-in handled load
    I can't find where this is coming from. Has anyone seen this before? I don't know if it has anything to do with what I'm seeing fail here. I doubt it because I get it a very short time (few seconds) after the video starts playing back. I only get this video the first time a file is downloaded and played but then never again.
    I have an UncaughtErrorEvent that isn't even catching this. Everything to do with the class that displays the video has try {} catch() {} blocks over every line of code. So doesn't the small file downloader class. Nothing is throwing an ErrorEvent.
    Is there any easy way to find where this error is being generated? Something I might not know about the Flash Builder Debugger? Other errors show up and tell me where they occured, but this brand new error does not cause the app to fail and the debugger doesn't even flinch at it.
    On the first part, has anyone recently seen their apps exhibit something like this? I have a list of files that I destroy before I show the video and it continues to exist even though I literally trace() all over the code that should destroy it and I see the traces. Everything is nulled. Objects no longer exist. The background isn't visible that I'm tracing as I build and it exists on the display list. It's very odd.
    It'd just like suddenly StageWebView has an issue loading a freshly downloaded and saved file. It nukes the display list, nothing I do to it matters. But if the file already exists it all works fine.

    Yes I use ie.jampot.nativeExtensions.MobileBackup. Worked perfectly fine before and continues to return a true Boolean value for success and Apple has never rejected the app. They initially did because I did not set the backup bit. I presume that means it's working just fine.
    This app crashes after that code happens, during trying to load the content into a SWV. But hey, why not, I'll disable that and we'll see what happens. I'll report back. I get no errors at all when the app crashes (when I fast build for debugging and test on device). No errors at all. It just crashes. That's.. not good.
    edit:
    Nope sorry, didn't change a thing. The second time I use URLLoader after properly disposing of it each time it fails on any large files and the app crashes with no info back to Flash Builder. Even with MobileBackup disabled completely. Sucks.. Flash Builder profiler is showing me the reference counts on objects and I can see I'm cleanly disposing of everything properly.Something won't leave memory even though all reference counts are 0. This does NOT happen on iPad2 or iPad3, just iPad1 past OS 5.1. Ugh...
    re-edit:
    After profiling like crazy, tracing like crazy, crossing all my T's and dotting my....... lowercase j's...... I can only conclude there is now an intolerance for MP4s being played in a StageWebView of a certain filesize. YMMV but just making a quick demo app, downloading a 44MB MP4 and playing it works fine the first time. I then dispose of everything and verify it in profiler. I even run garbage collection manually on the profiler and it still curiously has a lot more memory in use than what it had at app launch. All instance (reference) counts are 0. Curiously memory is still pretty close to the same amount as the video I just played regardless that I disposed of the SWV instance completely. It's like the dispose isn't working. My method of dereffing the class level private variable is:
    _swv.stage = null;
    _swv.viewPort = null;
    _swv.dispose();
    _swv = null;
    This doesn't seem to release the memory as fast as I'd like to see. Perhaps there's something lingering but that should properly dispose of that SWV instance.
    Upon downloading the second video, the very second it's finished downloading (via binary mode URLLoader) the app crashes. It doesn't even fire off a complete event or error in any way, the app literally just quits. Perhaps the previous 40MB video is somehow still lingering and once I have that 44MB video in mem and try to load a different 40MB video it's 40+44=84MB ram trying to be allocated. I can't see why because as above, I'm disposing of the SWV. Reference counts of _swv is 0 after the first video is played and closed.
    Really strange but be careful, something new is going on here. It used to work perfectly fine. It appears to be an issue since 5.1. Perhaps Apple caching the SWVs contents when it's not desirable to do so. I may have to go back and use StageVideo and draw up my own video controls. I only use SWV because both it comes with nice controls and a fullscreen built in that runs very smoothly. If it isn't broke, don't fix it.. Well.. it's broken.
    I have verified that 20MB videos download and work fine. 40MB is giving me issues. Not sure where the line is here.

  • AIR 3.9.0.880 StageWebView and Retina MBP

    When I compile my app using AIR 3.9.0.880, my StageWebView is 1/4 size on my Retina MBP unless I pass true to the StageWebView constructor for the "useNative" parameter. Is this by design?
    I have this set in my app descriptor:
    <requestedDisplayResolution>high</requestedDisplayResolution>

    1. It works fine in AIR 3.6,  3.7 and 3.8.
    2. Yes, see code below.
    3. I'm testing on a 15-inch Retina MacBook Pro running OS X 10.8.5.
    Test code:
    package
    import flash.display.Sprite;
    import flash.display.StageAlign;
    import flash.display.StageScaleMode;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    [SWF(width="800", height="800")]
    public class StageWebViewExample extends Sprite
        private var webView:StageWebView = new StageWebView();
        public function StageWebViewExample()
            webView.stage = this.stage;
            webView.viewPort = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
            webView.loadURL("http://www.adobe.com/");
            stage.align = StageAlign.TOP_LEFT;
            stage.scaleMode = StageScaleMode.NO_SCALE;

  • StageWebView could not be found

    I found an example of stagewebview in help. I just put the code on the first frame. I'm getting an error saying flash.media.StageWebView could not be found. How do I use this?
    using Flash Pro CS5
    import flash.display.MovieClip;
    import flash.media.StageWebView;
    import flash.geom.Rectangle;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.desktop.NativeApplication;
    var webView:StageWebView = new StageWebView();
    function StageWebViewExample()
         webView.stage = this.stage;
         webView.viewPort = new Rectangle(0,0,stage.stageWidth,stage.stageHeight);
         webView.loadURL( "http://www.adobe.com" );
         stage.addEventListener( KeyboardEvent.KEY_DOWN, onKey );
    function onKey( event:KeyboardEvent ):void
         if (event.keyCode == Keyboard.BACK && webView.isHistoryBackEnabled)
              trace("Back.");
              webView.historyBack();
              event.preventDefault();
         if (event.keyCode == Keyboard.SEARCH && webView.isHistoryForwardEnabled)
              trace("Forward.");
              webView.historyForward();

    Thanks OMA2K,
    I put it in AIK2.7.1, and pointed the Actionscript library to it. It's found it, but the TwitterWidger thing doesn't want to do it as in for iPhone, so now at least I can experiment with it and hopefully get it working.
    I'm actually trying to get a really simple thing going here. only the Twitter auth bit is really a handfull.
    Pseudo code:
    app is running.
    user taps [send] button
    .... first time, user validates login to Twitter. this is stored so not necessary any successive time.
    ... pre-built message (tweet) is sent to twitter users timeline.
    return and wait till user presses [send] again
    I have another version of this TwitterWidger running on the iphone, which uses the PIN authorization method. However, when the web page opens to set and retrieve the authorization pin, the app closes, thus closing the page that is waiting for the pin to be entered.
    This second version, the PINLESS version - doesn't work at all. It actually just keeps looping.
    I'm beginning to think it just can't be done on the iPhone, which is a pain.
    both TwitterApp and TwitterWidget are from http://www.flashmobileblog.com/examples/
    thanks for the help. Much appreciated.

  • Scrolling to a given line or offset  in a JTextPane   *Please Help*

    I have looked on the web and do not see a solution to this problem. Maybee I am missing somthing very easy here.
    I am using a JTextPane to display text of multiple colours.
    The JTextPane is contained within a JScrollPane.
    I am using a highlighter to highlight individual lines of text within this JTextPane.
    However, the highlighted text may be outside of the viewport of the scrollPane and not be visible.
    How do I scroll so that the highlighted line of code is visible????
    I know you can scrollToVisibleRect. However how do I get the rectangle coordinates from a line of code, or from the highlighter.
    Is it possibile and easy to scroll to make an offset or line number visible.????
    So far I have tried:
    setCaretPosition();
    However this causes problems with highlighting.
    Cheers
    Andrew.

    In the future, Swing related questions should be posted in the Swing forum.
    So far I have tried:
    setCaretPosition();
    However this causes problems with highlighting.Makes no sense, setting the caret position has nothing to do with highlighting. Sounds like you have some other bug. Setting the caret position should work.
    I know you can scrollToVisibleRect. However how do I get the
    rectangle coordinates from a line of code, or from the highlighterAssuming you know the offset of the text you can use
    textPane.modelToView(...)
    to get the location of the text.

  • Why does this Facebook page can't be displayed within a StageWebView?

    Hi,
    By trying to open the website https://www.facebook.com/nike within a StageWebView, I received the following error:
    ReferenceError: Can't find variable: console at https://fbstatic-a.akamaihd.net/rsrc.php/v2/y2/r/KK4271o6DmT.js : 95 TypeError: Result of expression 'bigPipe' [undefined] is not an object.
    The website stopped loading and couldn't be displayed completly.
    This is the Air/AS3 code I'm using:
    var webView:StageWebView = new StageWebView();
    webView.stage = this.stage;
    webView.viewPort = new Rectangle( 0, 0, stage.stageWidth, stage.stageHeight);
    webView.loadURL("https://www.facebook.com/nike")
    How to get to load the website within StageWebView completely? (Is there a way to ignore the errors?)
    I'm using Flash CS6 and Adobe Air 3.9
    Thanks for any ideas!

    This has happened to me in the past.  Though I was not opening Facebook in a StageWebView - I was loading facebook profile images using a Loader.  For me it was a cross-domain permissions/security issue.  The problem is that Facebook loads a lot of content from akamaihd.net which is on a different domain to facebook.com
    This is what I did to fix it - I added this line somewhere before the call to Facebook:
    import flash.system.Security;
    Security.loadPolicyFile('https://fbcdn-profile-a.akamaihd.net/crossdomain.xml');
    You'll likely have to change the URL to this?
    Security.loadPolicyFile('https://fbstatic-a.akamaihd.net/crossdomain.xml');
    Hope it helps!

  • Making a full StageWebView that resizes

    I'm having a lot of trouble getting a stagewebview to resize when the device is rotated. I don't understand how to get stage not null. How do you get the dimensions below the top navigation bar? (fxp file)
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
              xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" creationComplete="creationCompleteHandler(event)" resize="resizeHandler(event)">
         <fx:Script>
              <![CDATA[
                   import mx.events.FlexEvent;
                   import mx.events.ResizeEvent;
                   private var swv:StageWebView;
                   protected function creationCompleteHandler(event:FlexEvent):void
                         if (StageWebView.isSupported==true)
                             swv = new StageWebView();
                             resizeSWV();
                             swv.stage = stage;
                             swv.loadURL("http://www.google.com");
                   protected function resizeHandler(event:ResizeEvent):void
                        resizeSWV();
                   private function resizeSWV():void
                        if (swv != null)
                             swv.viewPort = new Rectangle(0, stage.height - height, width, height);
              ]]>
         </fx:Script>
    </s:View>

    The way I found to get the dimensions is like this:
    private var app:ViewNavigatorApplication = FlexGlobals.topLevelApplication as ViewNavigatorApplication;
    trace("app.navigator.actionBar.height = "+app.navigator.actionBar.height);
    trace("app.navigator.activeView.height = "+app.navigator.activeView.height);
    But I'm still not able to get the stage object. I would have thought that it would be initialized after creationComplete.

  • Print complete document from stagewebview

    I have a air application that shows in a stagewebview a facebook app.
    In that facebook app you have to fill in a form.
    Under the form there is a print button (that won't work)
    So I wrote my own print button.
    But the problem is that I have to convert the viewport of the stagewebview to a bitmap
    and then print the bitmap to pdf or my printer.
    But he always just take the part that is shown on my stage.
    But I have to print the whole document that is in the stagewebview...
    Can anybody help me?
    Here is my code to convert to bitmap and the print...
    var bitmapData:BitmapData = new BitmapData(iBreedte,iHoogte);
      webView.location;
      webView.drawViewPortToBitmapData(bitmapData);
      var webViewBitmap:Bitmap = new Bitmap(bitmapData);
      var myPrintJob:PrintJob = new PrintJob();
      var options:PrintJobOptions = new PrintJobOptions();
      options.printAsBitmap = true;
      myPrintJob.start();
      var s:Sprite = new Sprite();
      s.height = iHoogte;
      s.width = iBreedte;
      s.addChild(webViewBitmap);
      s.scaleX = .40;
      s.scaleY = .40;
      myPrintJob.addPage(s, null, options);
    myPrintJob.send();

    PDL -- thank you for your reply.
    What you gave me did spawn the print dialog allowing me to select a printer. However, when the document printed, the number of pages in the document was correct but the pages were empty except for the page x of y along the top and the name of the document along the bottom. Have you seen this before and do you know how to correct? Also, how do you suppress the info across the top and bottom of the report from printing?
    Thanks

Maybe you are looking for

  • My Macbook Air is running slow with Yosemite.

    My Macbook Air is running slow with Yosemite. I checked out most of the blogs and everything and have removed widgets from the notification center, but everything seems to run kinda slowly. Sure, i have the base model 2014 macbook air but that 4 gb r

  • Index not using in select query

    Hello All, I have table CITY with 2 composite primary key CITYCODE, COUNTRYCODE of course they are NOT NULL. i created an index. CREATE UNIQUE INDEX CITYKEY ON CITY     (CITYCODE, COUNTRYCODE); then i run explain plan as follows explain plan for sele

  • Error occured while building project

    Build error occured while compiling the project in labview11. It asked to contact ni whith following refrance. CDK_Build_Invoke.vi.ProxyCaller >> CDK_Build_Invoke.vi >> CDK_Engine_Main.vi >> IB_MSI.lvclass:Build.vi >> IB_MSI.lvclass:Engine_PreBuild.v

  • Incorrect display of half notes?

    I wanted to write one half note (o) follwed by three 8th notes and when I connect the half note to the 8ths the center on the half note gets filled and looks like the other notes in duration. I checked the piano role and the actual duration of the ha

  • Group and combine loose fonts into Families?

    So I've been using Font Book to organize about 7,000 fonts, but I find it does not group some font families into groups i.e AbsaraSans has 33 weights to It but they are all shown to be individual fonts, is there anything I can do about this to better