Code Review on a Full Screen Graphics Wrapper

Hi all, if you could be so kind, could I get a quick review of my full screen graphics wrapper? It is giving strange flickering issues on an OSX TIBook, although that may be Apple's implementation. Also, am I breaking any major rules? Thanks, Ryan
package rpgClient.graphics;
import java.awt.*;
import java.awt.image.*;
public class Screen
     private Frame mainFrame;
     private GraphicsDevice gd;
     private BufferStrategy bs;
     private DisplayMode oldDisplayMode;
     private DisplayMode newDisplayMode;
     public Screen(GraphicsDevice gd, DisplayMode dm)
          System.setProperty( "sun.java2d.translaccel" ,"true" );
          this.gd = gd;
          oldDisplayMode = gd.getDisplayMode();
          newDisplayMode = dm;
          GraphicsConfiguration gc = gd.getDefaultConfiguration();
          mainFrame = new Frame(gc);
          mainFrame.setUndecorated(true);
          mainFrame.setIgnoreRepaint(true);
     //screen specifications
     public static GraphicsDevice[] getGrephicsDevices()
          return GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
     public static GraphicsDevice getDefaultGraphicsDevice()
          return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
     public static DisplayMode createDisplayMode(int width, int height, int bitdepth)
          return new DisplayMode(width, height, bitdepth, DisplayMode.REFRESH_RATE_UNKNOWN);
     public static DisplayMode[] getDefaultDisplayModes()
          return GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDisplayModes();
     public static DisplayMode[] getDisplayModes(GraphicsDevice gd)
          return gd.getDisplayModes();
     public static boolean isValidDisplayMode(GraphicsDevice gd, DisplayMode dm)
          DisplayMode[] dms = getDisplayModes(gd);
          for(int i = 0; i < dms.length; i++)
               if(dms.getWidth() == dm.getWidth() &&
               dms[i].getHeight() == dm.getHeight() &&
               dms[i].getBitDepth() == dm.getBitDepth())
                    return true;
          return false;
     public static boolean isValidDefaultDisplayMode(DisplayMode dm)
          return isValidDisplayMode(getDefaultGraphicsDevice(), dm);
     //class methods
     public boolean isFullScreenSupported()
          return gd.isFullScreenSupported();
     public boolean isDisplayChangeSupported()
          return gd.isDisplayChangeSupported();
     public void initFullscreen() throws Screen.FullScreenInitException
          if(!isFullScreenSupported() || !isDisplayChangeSupported())
               throw new Screen.FullScreenInitException();
          //init the display
          gd.setDisplayMode(newDisplayMode);
          gd.setFullScreenWindow(mainFrame);
          mainFrame.createBufferStrategy(3);
          bs = mainFrame.getBufferStrategy();
     public void deinitFullscreen()
          gd.setFullScreenWindow(null);
          gd.setDisplayMode(oldDisplayMode);
     public Frame getBaseFrame()
          return mainFrame;
     public GraphicsConfiguration getCurrentGraphicsConfiguration()
          return mainFrame.getGraphicsConfiguration();
     public void dispose()
          mainFrame.dispose();
          mainFrame.removeNotify();
     //Draw method one: Pass in an image of the screen
     public void bltImage(Image i)
          Graphics g = bs.getDrawGraphics();
          g.setColor(Color.BLACK);
          g.fillRect(0,0, newDisplayMode.getWidth(), newDisplayMode.getHeight());
          g.drawImage(i, 0, 0, null);
          g.dispose();
          bs.show();
     //Draw method two: Get the back buffer, do you buisness, then initiate the blt
     public Graphics2D getGrahphics2D()
          Graphics2D g = (Graphics2D)bs.getDrawGraphics();
          g.setColor(Color.BLACK);
          g.fillRect(0,0, newDisplayMode.getWidth(), newDisplayMode.getHeight());
          return g;
     public void bltGraphics2D(Graphics2D g)
          bs.show();
          g.dispose();
     public class FullScreenInitException extends Exception {}

Hi there,
Did you ever resolve this problem? I am new to the Fullscreen API but I am writing a complicated interactive screensaver. It works really well on Windows XP but there is terrible startup flicker on OS X. My own graphics is repeatedly overdrawn with a blank white screen, about four or five times over a few seconds, then finally the window starts behaving (nearly) as expected. The same drawing code works well in a windowed version on OS X.
Anyone else have this problem?

Similar Messages

  • FlashBuilder: Android/Flex Components+Full Screen Graphic possible?

    I'm new to flash and interested in multi-platform graphical game development.
    I've installed the Flash Builder Burrito test version and want to develop
    a full screen Android graphical game with Android-Flex components
    (like buttons etc.).
    a)
    Is it possible to have a full graphical screen and then overlay
    Android-Flex components (buttons etc.) or ist only possible
    to integrate a graphical screen within a Flex components app
    so that Android/Flex components have to been outside the screen
    and so no full graphical screen overlayed with Android/Flex
    components is possible?
    b)
    If full graphical screen + Android/Flex components is possible:
    which project type have I to choose:
    File->New->Flex Project or File->New->ActionScript Mobile Project?
    c)
    Are the components I can choose to design my Flash-Android project
    Android-like Flex components or are they real Android components?

    a) yes you can
    b) Flex Mobile Project
    c) Those are Flex components
    If you are creating a game for an Android device I would rather do it with Actionscript. The Flex "Hero" Framework for Mobile is great, but in my opinion laid out for applications not for games. Still you can use parts of it, but if you only lists, buttons and that kind of component then I would rather write them up in AS3.

  • Full screen graphical output

    I am working on a project for a school where I need to do fast (relatively speaking) graphics rendering in real time.
    Essentially, I have 5 computers; 1 Server and 4 clients.  Each client is hooked to a projector and is responsible for one letter of the word LASA. I have the network bits working, so that each client is told what color  and what position to draw the letter at, but now I am having trouble with getting it to draw quickly and smoothly.
    First I tried working with just making the pane full screen using a property node and modifying its background color at runtime, this worked great, so long as I didn't try to change anything on the panel, which made moving the letter using this method impossible.  Next, I thought I could use an image control since they are designed to handle quickly changing graphics and I could then just pragmatically generate the image on the fly.  While this seems like a great idea, I can't figure out how to make it full screen.
    Any help is appreciated.

    Attached is an example of the picture control doing this by changing the origin.  You can coordinate VIs by changing this origin synchronously in your displays using commands.  You can change the appearance of the VI front panel so that the title bar, scroll bars, etc are all not shown, and even make the background transparent, then maximize it.  The picture control allows you to easily change the background color of your text using either a rectangle in the background or with the text background itself (if the text is large enough).  You can programmatically scale the picture control and font size so that it looks good on your monitor.  You could also programmatically make the VI front panel slightly larger than your monitor so there are no seams.  Remember to have a way to close everything.  The picture control has a rich set of mouse events, so this should be pretty easy.
    Let us know if you need more help.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    ScrollText.vi ‏13 KB

  • Full screen graphics corruption

    Every few days I am getting full screen corruption like this: http://twitpic.com/48qx4
    Multicolored triangles criss-crossing the screen and a reboot is the only way to fix it.
    I have all of the latest updates installed, and I can't find anybody who has the same problem.

    Adam,
    If your profile is correct, you could try updating your system software to 10.5.6.
    Try a process of elimination. Try running QT, Dreamweaver, and iTunes, but not the open source WebKit.
    See if you can locate a crash log. How to locate a crash log:
    1. Open Finder.
    2. Click "Go" in the menu, then select "Go to Folder".
    3. Copy and paste this path into the Finder dialog:
~/Library/Logs/CrashReporter/
    4. Click the Go button.
    5. Finder opens the folder containing the crash log. Look for a the crash file with a date field that looks like the most recent.
    I'm still learning how to read these but there are more experienced users here that can.
    Carolyn

  • Problem - loose connection (presumed)? Full screen graphical distortion.

    My Macbook pro (bought last November) has developed a problem in the last week.
    The screen will glitch - like as shown in this photo
    http://www.flickr.com/photos/theotherblackstuff/3617817234/sizes/l/
    Sometimes tilting the screen forward or backwards slightly will temporarily resolve the issue, sometimes just applying some pressure near the base of the screen (at the back) will.
    It strikes me that it would be caused by a loose connection...
    Will upload a video...

    Hi,
    I'm having the very same problem, but my MacBook is out of Applecare. Same behavior, same rudimentary remedy.
    Since my machine is not covered, I'm pretty much going to have to do this on my own then, aren't I? So could someone point me to a guide on how to repair this thing, because I'm getting incredibly frustrated.

  • Problem with Full Screen

    Ok I am getting problems with full screen graphics on some computers.
    I am writing an internet based RPG and this is really eating into my time...
    Can any one explain why my graphics will not show some times (works others) with the exact same code running....
    I am using a BufferStratagy with a frame.
    Any help would be gladly apreashiated thank you in advance,
    Phibred

    Not a thread issue, no thread on this side of the program and yes there is a media tracker. However I have learned that my problem was that my screen does not like to flip to 800x600 for java applications for some reason thx any way.

  • How do i add a Full Screen Button?

    Hi guys,
    I have used Quicklime X - File > Save for Web option to upload a video to my web site.
    This gave me a Java Script player and code to embed into my site, i have all the files running local on my server and the videos works well.
    My problem is that there is no full screen button on this player...
    Dose anyone know where i could find some code to add a full screen button to this player?
    I cant imagine it being to hard... but my knowledge of java is very limited.
    Thanks for your help
    Alex
    Edited by: swishk on May 21, 2010 10:35 PM

    Despite the similarity in names, Java and JavaScript are separate languages. For embedding Flash players or controls in web pages, you would be using JavaScript.

  • QT video in Full Screen mode

    Dear friends, my web www.aproduction.com.ua
    1. How I can play QT video in Full Screen mode (MAC & PC)?
    2. How I can set some attention info for visitors that I use QT video and for playback they should click on video & press space. Some popup or what you reccomend me?
    Thank you in advance!
    Boris

    Your troubles are caused by the file dimensions used in your html page code. The QuickTime file is 640X480 and your page code uses 533X381.
    The QuickTime controller (your page code shows 'true') requires an extra 16 pixels be added to the actual file dimensions. Your page code dimensions should be 640X496. The controller would now appear in your Web page. Changing the code to autoplay (not autostart) is the required tag and the value would be 'true' (your current code uses 'false').
    Full screen playback can only be achieved via the QuickTime Player application. To do this you need a few more "special" tags in your html file code.
    You need a "target" tag and a linked file (uses the href tag). The 'target' ='quicktimeplayer' would launch the QuickTime Player when your "poster" movie is clicked. One of my pages as an example:
    http://homepage.mac.com/kkirkster/64
    A free tool to help with the correct html page code:
    http://www.qtbridge.com/pageot/pageot.html

  • Hi, after installing Adobe CC I tried opening Adobe Photoshop. This failed. I get the opening window where it says installing plugins searching etc, after which PS opens in full screen. Just moments after that there's a fail warning, no code number, only

    Hi, after installing Adobe CC I tried opening Adobe Photoshop. This failed.
    I get the opening window where it says installing plugins searching etc, after which PS opens in full screen.
    Just moments after that there's a failure warning, no code number, only the warning that PS failed to open and PS will close.
    I tried downloading it for a second time, but this did'nt solve the problem.
    Befor the CC version I used a one year student version of Adobe CS6.
    What can I do?

    Regarding the Flash Player problem, disable Hardware Acceleration to circumvent driver incompatibilities.
    Regarding the Flash Pro installation problems, post in the Flash forums or http://forums.adobe.com/community/download_install_setup

  • How do I code a full screen button?

    I need to code a full screen button for a SWF. I've tried a few ways but I can't get it to work.
    Here's my Action Script:
    function goFullScreen():void
        if (stage.displayState == StageDisplayState.NORMAL)
        stage.displayState=StageDisplayState.FULL_SCREEN;
        else
        stage.displayState=StageDisplayState.NORMAL;
        fsb.addEventListener(MouseEvent.CLICK, _handleClick)
        function _handleClick(event:MouseEvent):void
        goFullScreen();
    Here's my html:
      <param name="allowFullScreen" value="true">  
      <param name="allowFullScreenInteractive" value="true" />
    Any help with this would be greatly appriciated. I've tried online tutorials and code snippets but none of them work. It's only a few lines of code but I can't seem to get this feature to work.
    Thanks,
    David

    This is my full swf embed html:
    <BODY>
    <DIV id=flashContent>
    <OBJECT id=C:\Users\ddaugher\Documents\AAPUT
    classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000 width=960 align=middle
    height=540><PARAM NAME="movie" VALUE="C:\Users\ddaugher\Documents\AAPUT.swf"><PARAM NAME="quality" VALUE="high"><PARAM NAME="bgcolor" VALUE="#ffffff"><PARAM NAME="play" VALUE="true"><PARAM NAME="loop" VALUE="true"><PARAM NAME="wmode" VALUE="window"><PARAM NAME="scale" VALUE="showall"><PARAM NAME="menu" VALUE="true"><PARAM NAME="devicefont" VALUE="false"><PARAM NAME="salign" VALUE=""><PARAM NAME="allowScriptAccess" VALUE="sameDomain">
                                                    <!--[if !IE]>-->    <object
    type="application/x-shockwave-flash"
    data="C:\Users\ddaugher\Documents\AAPUT.swf" width="960" height="540">
         <param name="movie" value="C:\Users\ddaugher\Documents\AAPUT.swf" />
         <param name="quality" value="high" />     <param name="bgcolor"
    value="#ffffff" />     <param name="play" value="true" />     <param name="loop"
    value="true" />     <param name="wmode" value="window" />     <param
    name="scale" value="showall" />     <param name="menu" value="true" />
         <param name="devicefont" value="false" />     <param name="salign" value=""
    />     <param name="allowScriptAccess" value="sameDomain" />    <!--<![endif]-->
         <a href="http://www.adobe.com/go/getflash">      <img
    src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"
    alt="Get Adobe Flash player" />     </a>    <!--[if !IE]>-->    </object>
        <!--<![endif]-->   <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="C:\Users\ddaugher\Documents\AAPUT.swf" width="960" height="540">
         <param name="movie" value="C:\Users\ddaugher\Documents\AAPUT.swf" />
                       <param name="quality" value="high" />
         <param name="bgcolor" value="#ffffff" />
         <param name="play" value="true" />
         <param name="loop" value="true" />
         <param name="wmode" value="window" />
         <param name="scale" value="showall" />
         <param name="menu" value="true" />
         <param name="devicefont" value="false" />
         <param name="salign" value="" />
         <param name="allowScriptAccess" value="sameDomain" />
                        <param name="allowFullScreen" value="true">  
                        <param name="allowFullScreenInteractive" value="true" />
        <!--<![endif]--><!--[if !IE]>-->
        </object>
        <!--<![endif]--></OBJECT></DIV></BODY></HTML>

  • Slow graphics performance - login screen, launchpad, full screen video all stutter

    Since installing Mavericks, I've found that several system animations are slow/stutter. This is on a 2012 MacBook Air with maxed out hardware specs so its not b/c I'm running an old system.
    Some examples:
    - When booting up, right before I reach the login screen, the display quickly flashes blue. This leads me to believe something funky is going on with my graphics card/drivers
    - The login animation, where you click your username and it floats to the middle of the screen so you can type in your password, is very jerky, taking 2+ seconds to complete. Previously it had been fast and smooth
    - When using Launchpad, expanding folders often takes several seconds. The folder will start to expand, freeze, and then finally finish. This tends to be more of a problem for folders with 1 row of icons. Large folders oddly seem to expand ok / smoothly
    - Watching full screen video in iTunes causes the audio to stutter (the video playback is still smooth). If I make the window smaller, audio and video playback are smooth again
    Is anyone else experiencing these kinds of graphics issues? Any idea whats going on or how to fix?

    Quit Chrome and see whether there's any change. If not, see below.
    Step 1
    When you notice the problem, launch the Activity Monitor application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Activity Monitor in the icon grid.
    Select the CPU tab of the Activity Monitor window.
    Select All Processes from the View menu or the menu in the toolbar, if not already selected.
    Click the heading of the % CPU column in the process table to sort the entries by CPU usage. You may have to click it twice to get the highest value at the top. What is it, and what is the process? Also post the values for User, System, andIdle at the bottom of the window.
    Select the Memory tab. What value is shown in the bottom part of the window for Swap used?
    Next, select the Disk tab. Post the approximate values shown for Reads in/sec and Writes out/sec (not Reads in and Writes out.)
    Step 2
    If you have more than one user account, you must be logged in as an administrator to carry out this step.
    Launch the Console application in the same way you launched Activity Monitor. Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Select the 50 or so most recent entries in the log. Copy them to the Clipboard by pressing the key combinationcommand-C. Paste into a reply to this message (command-V). You're looking for entries at the end of the log, not at the beginning.
    When posting a log extract, be selective. Don't post more than is requested.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some personal information, such as your name, may appear in the log. Anonymize before posting. That should be easy to do if your extract is not too long.

  • Adding full screen code into Captivate 5's basic Button Widget

    Hi everyone!
    I was able to create a full screen button in Flash that works with Captivate 5 projects, however, I want to be able to active the full screen feature for every button created using the basic 'button' widget that comes with the Captivate program.  I am not a AS3 programmer so I think my issue is that I am confused as  to where to place the full screen code into the existing 'button widget'  code. Below is the code ...
    Thanks in advance!!
    edlearner
    HERE IS THE FULLSCREEN CODE THAT I USE
    button_name.addEventListener(MouseEvent.CLICK, fullScreen_action);
    function fullScreen_action(event:MouseEvent):void {
    stage.displayState=StageDisplayState.FULL_SCREEN;
    stop();
    HERE IS THE BASIC CODE FOR THE BUTTON WIDGET IN CAPTIVATE 5
    //..........................Template for Static Widget(AS3)....................
    //flash construct to use external interface : This is needed to use flash functionality for communication between two swfs
    import flash.external.ExternalInterface;
    import fl.controls.ComboBox;
    var widgetMode:String = '';
    var widgetParam:String = '';
    var varHand:Object = null;
    var movieHandle:Object = null;
    XML.prettyIndent = 0;
    XML.prettyPrinting = false;
    XML.ignoreWhitespace = true;
    var checkUpdatedXML = false;
    var playedByButton = false;
    var pauseFrame = 0;
    var addednoskipframe = false
    var myXML:XML;
    var myData:String = '<element1><textProperties><font face="Trebuchet MS" style="" size="12"/><textDecoration bold="true" underline="false" italic="false"/><color textColor="0x000000" highlightRequired="false" highlightColor="0xffffff"/></textProperties><captions style="BUTTON_1" themeLabel="0" backColor="0xffffcc" eventAssign="" eventParam="" txtXPos="9" txtYPos="4" imgXPos="190" imgYPos="40" a="1" b="0" c="0" d="1" tx="0" ty="0" bgSelected="false" borderColor="0xff9933" borderSelected="false" containerXPos="" containerYPos=""><text visible="true" width="42" height="20" a="1" b="0" c="0" d="1" tx="18" ty="4">Button</text><image visible="false" width="22" height="18" a="1" b="0" c="0" d="1" tx="NaN" ty="NaN"></image></captions></element1>';
    var xmlConfig:String = '<configs><styles label="Ivory" movieclip="BUTTON_1" backColor=""/><styles label="Frosted" movieclip="BUTTON_8" backColor=""/><styles label="Grey Space" movieclip="BUTTON_9" backColor=""/><styles label="Honey Comb" movieclip="BUTTON_10" backColor=""/><styles label="Mountain Blue" movieclip="BUTTON_11" backColor=""/><styles label="Aero" movieclip="BUTTON_12" backColor=""/><styles label="Gradient" movieclip="BUTTON_13" backColor=""/><styles label="Vivid 1" movieclip="BUTTON_14" backColor=""/><styles label="Vivid 2" movieclip="BUTTON_15" backColor=""/><styles label="Aqua" movieclip="BUTTON_16" backColor=""/><styles label="Glitter" movieclip="BUTTON_17" backColor=""/></configs>';
    //var xmlConfig:String = '<configs><styles label="Button 1" movieclip="BUTTON_1" backColor=""/><styles label="Button 2" movieclip="BUTTON_2" backColor=""/><styles label="Button 1" movieclip="BUTTON_1" backColor=""/><styles label="Button 2" movieclip="BUTTON_2" backColor=""/><styles label="Button 3" movieclip="BUTTON_3" backColor=""/><styles label="Button 4" movieclip="BUTTON_4" backColor=""/></configs>';
    var myConfig:XML = new XML(xmlConfig);
    var myWM = "";
    var mc:MovieClip;
    CaptionMc.visible = false;
    textFormatterMc.visible = false;
    //update ();
    var objName;
    function fnHandleButtonEvent (evt:MouseEvent)
        if (varHand != null)
            switch (Number(myXML.captions.@eventAssign))
                case 1 :
                    varHand.rdcmndResume = 1;
                    break;
                case 2 :
                    varHand.rdcmndPrevious = 1;
                    break;
                case 3 :
                    varHand.rdcmndNextSlide = 1;
                    break;
                case 4 :
                    varHand.cpCmndGotoSlide = varHand.cpInfoLastVisitedSlide;
                    varHand.rdcmndResume = 1;
                    break;
                case 5 :
                    if(varHand.rdinfoCurrentSlide != (Number(myXML.captions.@eventParam) - 1)){
                        varHand.cpCmndGotoSlide = Number(myXML.captions.@eventParam) - 1;
                        varHand.rdcmndResume = 1;
                    break;
                case 6 :
                    navigateToURL (new URLRequest(myXML.captions.@eventParam), "_blank");
                    break;
                case 7 :
                    navigateToURL (new URLRequest("mailto:"+myXML.captions.@eventParam), "_blank");
                    break;
            playedByButton = true;
    function update ()
        myXML = new XML(myData);
        if (myWM == "Edit")
            textFormatterMc.setData (myXML.textProperties);//strCaptivateXML:String
            textFormatterMc.init ();
            CaptionMc.setData (myXML.captions, textFormatterMc);
            CaptionMc.setConfig (myConfig.styles);
            CaptionMc.init ();
            CaptionMc.visible = true;
            textFormatterMc.visible = true;
            var arr = [textFormatterMc.sizeSelectorMc];
            initCursor(arr);
        else
            CaptionMc.visible = false;
            textFormatterMc.visible = false;
            if(mc != null){
                removeAllChildren(mc);
            }else{
                mc = new MovieClip();
                addChild (mc);
            var xmlRef = myXML.captions;
            var textMatrix:Matrix = new Matrix(xmlRef.text.@a, xmlRef.text.@b, xmlRef.text.@c, xmlRef.text.@d, xmlRef.text.@tx, xmlRef.text.@ty)
            var txt:TextField = new TextField();
            objName = txt;
            txt.name = "txt";
            txt.mouseEnabled = false;
            txt.selectable = false;
            txt.multiline = true;
            txt.wordWrap = true;
            mc.addChild (txt);
            txt.text = xmlRef.text;
            txt.mouseEnabled = false;
            txt.width = Number(xmlRef.text.@width);
            txt.height = Number(xmlRef.text.@height);
            //txt.x = Number(xmlRef.text.@tx);
            //txt.y = Number(xmlRef.text.@ty);
            txt.transform.matrix = textMatrix;
            var txtProp = myXML.textProperties;
            var tf = new TextFormat(txtProp.font. @ face,txtProp.font. @ size,txtProp.color. @ textColor,getBool(txtProp.textDecoration. @ bold),getBool(txtProp.textDecoration. @ italic),getBool(txtProp.textDecoration. @ underline));
            txt.setTextFormat (tf);
            if (txtProp.color. @ highlightRequired == "true")
                txt.background = true;
                txt.backgroundColor = uint(txtProp.color. @ highlightColor);
            txt.visible = getBool(xmlRef.text. @visible)
            var mcCaption = new MovieClip();
            var mcCaptionMatrix = new Matrix(xmlRef.@a, xmlRef.@b, xmlRef.@c, xmlRef.@d, xmlRef.@tx, xmlRef.@ty);
            var ClassName:Class = getDefinitionByName(xmlRef.@style) as Class;
            var objHolder = new ClassName();
            objHolder.buttonMode = true;
            objHolder.addEventListener (MouseEvent.CLICK, fnHandleButtonEvent);
            mcCaption.addChild (objHolder);
            objHolder.transform.matrix = mcCaptionMatrix;
            if (SimpleButton(objHolder.getChildByName("btn")) != null && xmlRef.@bgSelected == "true")
                var tempColorStr = [email protected]();
                if (tempColorStr.length > 0)
                    var objColorTransform = new ColorTransform();
                    objColorTransform.color = uint(tempColorStr);
                    SimpleButton(objHolder.getChildByName("btn")).transform.colorTransform = objColorTransform;
            if (MovieClip(objHolder.getChildByName("mcBorder")) != null && xmlRef.@borderSelected == "true")
                var borderColorStr = [email protected]();
                if (borderColorStr.length > 0)
                    var borderColorTransform = new ColorTransform();
                    borderColorTransform.color = uint(borderColorStr);
                    MovieClip(objHolder.getChildByName("mcBorder")).transform.colorTransform = borderColorTransform;
            mcCaption.addChild (objHolder);
            mc.addChildAt (mcCaption, 0);
            var mcIconMatrix = new Matrix(xmlRef.image.@a, xmlRef.image.@b, xmlRef.image.@c, xmlRef.image.@d, xmlRef.image.@tx, xmlRef.image.@ty)
            var mcIcon = new Loader();//IconMovie();
            mcIcon.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);
            if (xmlRef.image != ""){
                mcIcon.load (new URLRequest(String(xmlRef.image)));
            mcIcon.name = "mcIcon";
            mcIcon.transform.matrix = mcIconMatrix;
            mcIcon.visible = getBool(xmlRef.image. @visible)
            mc.addChild (mcIcon);
    var cursor;
    var otherCursor;
    var downState = false;
    function initCursor(arr:Array){
        cursor = new Cursor();
        cursor.mouseEnabled = false
        cursor.visible = false;
        addChild(cursor);
        otherCursor = new StretchCursor();
        otherCursor.mouseEnabled = false
        otherCursor.visible = false;
        addChild(otherCursor);
        for(var i=0 ; i< arr.length; i++){
            arr[i].addEventListener(MouseEvent.ROLL_OVER, showCursor)
            arr[i].addEventListener(MouseEvent.ROLL_OUT, hideCursor)
            arr[i].addEventListener(MouseEvent.MOUSE_DOWN, showOtherCursor)
            arr[i].addEventListener(MouseEvent.MOUSE_UP, hideOtherCursor)
        this.addEventListener(MouseEvent.MOUSE_UP, hideOtherCursor);
        this.addEventListener(MouseEvent.ROLL_OUT, hideOtherCursor);
    function showCursor(e:MouseEvent){
        var txt = MovieClip(e.target).sizeTxt;
        if(!downState && txt.type == "dynamic"){
            cursor.visible = true;
            cursor.startDrag(true)
            Mouse.hide();
    function hideCursor(e:MouseEvent){
        if(!downState){
            cursor.stopDrag()
            cursor.visible = false;
            Mouse.show();
    function showOtherCursor(e:MouseEvent){
        var txt = MovieClip(e.currentTarget).sizeTxt;
        if(txt.type == "dynamic"){
            hideCursor(e);
            downState = true
            otherCursor.startDrag(true)
            otherCursor.visible = true;
            Mouse.hide();
    function hideOtherCursor(e:MouseEvent){
        downState = false;
        otherCursor.stopDrag()
        otherCursor.visible = false;
        Mouse.show();
    function removeAllChildren(mcRef:MovieClip){
        for(var i=(mcRef.numChildren-1); i>=0; i--){
            mcRef.removeChildAt(i);
    function imageLoaded (e:Event)
        var mc = e.target.content;
        mc.width = Number(myXML.captions.image. @ width);
        mc.height = Number(myXML.captions.image. @ height);
    function getBool (str:String):Boolean
        var ret:Boolean;
        if (str == "true")
            ret = true;
        else
            ret = false;
        return ret;
    function getModifiedXML ():String
        return myXML.toString();
    //to register enter frame function
    this.addEventListener (Event.ENTER_FRAME,onEnterEveryFrame);
    //Captivate App will not recognize a Static Widget unless this function is implemented and returns true
    function isStatic ():Boolean
        return true;//denotes that this is indeed a Captivate Interactive Learning Object
    //a object needs to be created and values filled in . This is taken by captivate and stored as //xml string. This is the mean to pass values between captivate and widget swf.
    function getInspectorParameters ():Object
        //dev//Apply
        //set the data in _parameters fields. This is called by captivate to get the values of widget swf
        var _parameters: Object = new Object();
        _parameters.dataXML = getModifiedXML();
        return _parameters;
    // whenever widget is inserted the widget swf is passed on the parameters stored inside captivate so that it is drawn in updated stage.
    function setInspectorParameters (inParam:Object):void
        //Dev//on Double click //edit window
        myData = inParam.dataXML;
        myWM = widgetMode;
        update ();
    //is called whenever widget needs to be drawn as per the changed
    //parameters like OK to widget dialog and stage swf is updated with the current values.
    function setParameters (inParam:Object):void
        if (inParam.dataXML != null)
            //redraw the widget as parameters has changed
            //dev//OK button
            myData = inParam.dataXML;
            myWM = widgetMode;
            update ();
    //this function is called to set the variable on player
    function cpSetValue (variable:String, val):void
        if (variable == 'movieHandle')
            movieHandle = val;
            varHand = movieHandle.getMovieProps().variablesHandle;
            //using varHand the variables can be accessed for eg. varHand.rdcmndPause = 1;
        if (variable == 'widgetMode')
            widgetMode = val;
            //dev//set mode
    function getEditModeWidth ( ):int
        return 411;// return required width of widget properties dialog here
    function getEditModeHeight ( ):int
        return 480;// return required height of widget properties dialog here
    //Register all the functions with ExternalInterface
    if (ExternalInterface.available == true)
        ExternalInterface.addCallback ("isStatic",isStatic);
        ExternalInterface.addCallback ("getInspectorParameters",getInspectorParameters);
        ExternalInterface.addCallback ("setInspectorParameters",setInspectorParameters);
        ExternalInterface.addCallback ("setParameters",setParameters);
        ExternalInterface.addCallback ("cpSetValue", cpSetValue);
        ExternalInterface.addCallback ( "getEditModeWidth", getEditModeWidth);
        ExternalInterface.addCallback ( "getEditModeHeight", getEditModeHeight);
    //take care of optimised drawing inside this function. Check the widgetMode , widgetParams  and draw accordingly
    function onEnterEveryFrame (aevent:Event):void
        var wm:String = widgetMode;//this variable will be provided by Captivate App or Captivate Movie
        if (wm == null)
            wm = widgetMode;
        if (wm == null)
            wm = 'Stage';
            this.removeEventListener (Event.ENTER_FRAME,onEnterEveryFrame);
        else if (wm == 'Edit')
            //Property inspection inside Captivate app
            myWM = wm;
            update ();
            this.removeEventListener (Event.ENTER_FRAME,onEnterEveryFrame);
        else if (wm == 'Preview')
            //The code here is used for previewing the widget in the preview window of widget panel
            myWM = wm;
            update ();
            this.removeEventListener (Event.ENTER_FRAME,onEnterEveryFrame);
        else
            //On stage scrubbing/live preview inside Captivate app (OR) at runtime inside Captivate movie.
            if(!checkUpdatedXML){
                if (movieHandle != null)
                    widgetParam = movieHandle.widgetParams();
                if (widgetParam != "")
                    var myXml:XML = new XML(widgetParam);
                    myData = myXml.property.(@id == "dataXML").string;
                    wm = "Runtime";
                    myWM = wm;
                    update ();
                    checkUpdatedXML = true
            if (movieHandle != null)
                if (movieHandle.isWidgetEnabled() == true)
                    if(addednoskipframe == false)
                        var slidestart = movieHandle.getSlideProps().startFrame;
                        var slideend = movieHandle.getSlideProps().endFrame;
                        pauseFrame = Math.ceil((slidestart  + slideend)/2);
                        var SlidePauseFrame = pauseFrame - slidestart + 1;
                        movieHandle.getSlideProps().slideHandle.AddNoSkipFrame(SlidePauseFrame);
                        addednoskipframe = true;
                    if(movieHandle.isWidgetEnabled()  && varHand.rdinfoCurrentFrame == pauseFrame && playedByButton == false)
                        varHand.rdcmndPause = 1;
                        this.removeEventListener (Event.ENTER_FRAME,onEnterEveryFrame);
    stage.scaleMode = StageScaleMode.NO_SCALE;
    stage.align = StageAlign.TOP_LEFT;

    Hi again,
    I just added a virtual keyboard widget, so that you can enter text even in Fullscreen Mode
    http://www.m-gd.com/virtual-keyboard-captivate-widget-en/

  • Full Screen slide show not functional since upgrading Graphics card??

    Just upgraded to a geforce fx 5200 graphics card...now the individual full screen pic or the full screen slideshow will not function. Get Fatal Error C0000005 at Address: 6e310c01. Dumps me out of Photoshop album starter edition 3.0. I have about 1000 images in multiple groups, files, email shares, etc and need to be able to get back to functionality. This has occurred since installing the graphics card mentioned. Is the newer 3.2 version an "upgrade" to 3.0. If I download it will it overwrite the existing version and still have all of my photos in place? It's an option I am considering to try to get back to properly functioning. ANY I repeat ANY help would be appreciated...THANKS....

    I have a Geforce FX5500 card & updated the driver for it, why I have no idea! Anyway the slideshow came up with some sort of major error & as I already knew using bang up to date graphics card driver stops certain old games working I rolled back the driver from the 23/4/08 (approx) version to driver version 6.14.10.9371 dated 22/10/06. Different card I know but an older driver may sort it.
    Les

  • X220:Graphics problem with full screen videos

    I have got my X220 laptop last month. I am facing problem while playing youtube videos full sceen.
     videos can be seen best with smaller window but there is major graphics problem with full screen.
    Can someone help on this?
    I am using Windows 7 Enterprise edition.
    Thanks

    what do you mean by major graphics problem, please elaborate.
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

  • How to get Fennec full screen from the android project's source code?

    Hi,
    First and foremost, I'm sure this was not the proper category to post that question but I couldn't really figure out a better one. Hopefully you'll forward it to a better place.
    We would like to take the advantages of Fennec with out HTML5 framework by wrapping it into a somewhat WebView like you can do on Android. The native implementation of the webview on Android turns out to be very disappointing so far whereas Fennec runs seamlessly.
    Could you recommend us any tips to do that properly from the Fennec's Android app project?
    Basically we just want to be able to call sort of a new FennecWebView() class instance in our code (instead of the formerly new WebView() ) that will run full-screen and won't call any further things such as, bookmark manager, setting. We just want to scale this down to the very strict minimum in order to run our Canvas framework in a native app thanks to the Fennec's engine.
    Thank you very much!
    BR,
    Armand

    I've seen some interest in this from others. It was suggested that they build a web app manifest.
    https://developer.mozilla.org/en-US/docs/Apps/Getting_Started
    https://hacks.mozilla.org/2013/01/join-us-for-firefox-os-app-days/

Maybe you are looking for

  • Firefox hangs/crashes wont' load; i've uninstalled/reinstalled; safe mode also; older version also; it used to work

    Firefox was working prior to updating to version 17. Then when I click it, it won't start. I tried to start in Safe Mode, also Reset Mode. I tried to uninstall version 17, and do a clean install. Also, I cannot run an older version of Firefox since t

  • Ssrs 2008 r2 pass mutiple values to stored procedure that is being called

    In an SSRS 2008 r2 report, I am currently calling a stored procedure called spRoom. I obtain the results of the stored procedure by creating a  temptable called #roomReults The temp table that I am creating and using to obtain results looks like the

  • Date  in text field

    Hi, I have a text field :P1_DATE . I want to enter date into it and date can be in any format like 01102012 means 01/10/2012 .if i enter date like 01102012 this should be enter like a date in table as date column accept.when i edit to the record date

  • Reports on PO

    Hi Experts, Can you please help me to create a report with the following entries : PO Number         Vendor Number       PO Qty   PO Value     Received Qty   Value (Recd) Kindly advice me. Thanks in advance, Regards, Rounak

  • Trying to make world's simplest air app, but it won't build

    Hi all -- I'm trying to make my first AIR project in Flash Professional -- I've made AIR projects before using Flex.  However, I'm dead before I even get started. I'm getting "Application descriptor file cannot be parsed" before I've done anything --