开发者

Flex: How to get full screen, withsame vertical and horizontal bar, as it was just before full screen

please check my code

// for Full Screen stage.displayState = StageDisplayState.FULL_SCREEN;

// for the normal screen stage.displayState = StageDisplayState.NORMAL;

But this code does not fulfill my requirement. I need Vertical Scroll Bar, even I go to the FullScreen, but I don't find any Sc开发者_StackOverflowroll with this code.

Even I tried "window.open" of JavaScript with ExternalInterface, but I couldnot succeed.


Well I guess Flex usually automatically hides scrol-bars as soon as they are not needed. In your case I would create a custom skin for Scroller or whatever component you are using. Here an example:

<fx:Metadata>
<![CDATA[ 
    /** 
     * @copy spark.skins.spark.ApplicationSkin#hostComponent
     */
    [HostComponent("spark.components.Scroller")]
]]>
</fx:Metadata> 

<fx:Script>
<![CDATA[    
    /**
     *  @private
     */
    override public function beginHighlightBitmapCapture() : Boolean
    {
        var needUpdate:Boolean = super.beginHighlightBitmapCapture();

        // Draw an opaque rect that fill our entire skin. Our background
        // is transparent, but we don't want focus/error skins to
        // poke through.  This is safe to do since we don't have any 
        // graphic elements as direct children.
        graphics.beginFill(0);
        graphics.drawRect(0, 0, width, height);
        graphics.endFill();

        return needUpdate;
    }

    /**
     *  @private
     */
    override public function endHighlightBitmapCapture() : Boolean
    {
        var needUpdate:Boolean = super.endHighlightBitmapCapture();

        // Clear the rect we drew in beginBitmapCapture();
        graphics.clear();

        return needUpdate;
    }
]]>
</fx:Script>

<s:VScrollBar id="verticalScrollBar"/>

<s:HScrollBar id="horizontalScrollBar"/>


Thanks chrisdutz for your reply, but finally I got that this is not possible if we want to get scrollBar in new window, without externelInterface. So I tried this JavaScript function:

function browserFullScreen(myUrl) {

    var url = myUrl;
    params  = 'width='+screen.width; 
    params += ', height='+screen.height;
    params += ', top=0, left=0';
    params += ', fullscreen=yes';
    params += ', scrollbars=yes';
    window.open (url, "_blank", params);
}

It really works. and because of so much google and other research, I found that Full Screen is possible with Flex code, but we can not get Browser Scroll Bars.

Thanks All.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜