Enable smoothing on VideoDisplay

Hi,
When playback a video in Flex air application, the video looks pixel and the edges is not smooth. I have do some searching for example, but all examples are for Flex 3 with MX videodisplay, not spark videodisplay. I tried it and I get the error message "Error exist in the project: SWF Loader". I don't have SWF loader in that project.
Here is my code:
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                       xmlns:s="library://ns.adobe.com/flex/spark"
                       xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:custom="custom.*">
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import org.osmf.events.TimeEvent;
            protected function videodisplay1_completeHandler(event:TimeEvent):void
                Alert.show("The Video Playback completed.");
        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <!--<s:VideoDisplay source="video/00_02_setup.mov" complete="videodisplay1_completeHandler(event)" right="0" left="0" top="0" bottom="0"/>-->
    <custom:SmoothVideoDisplay source="video/00_02_setup.mov" smoothing="true"/>
</s:WindowedApplication>
package custom { 
    import mx.controls.VideoDisplay;
    import mx.core.mx_internal;
    use namespace mx_internal;
    public class SmoothVideoDisplay extends VideoDisplay
        private var _smoothing:Boolean = false;
        public function SmoothVideoDisplay()
            super();
        [Bindable]
        public function set smoothing(val:Boolean):void{
            if (val == _smoothing) return;
            _smoothing = val;
            videoPlayer.smoothing = _smoothing;
        public function get smoothing():Boolean{
            return _smoothing;
How can I solve the problem?  How can I have the good video quality playback in flex? Thanks.

See this article to improve the scaled video quality in flex by enabling the smoothing property. Here the videoDisplay component is extended to expose the smoothing and deblocking property.
http://askmeflash.com/tutorial/8/how-to-smooth-resized-video-in-videodisplay-component

Similar Messages

  • Did you know? You can enable smooth animations in ...

    Go to Settings -> Personal -> Themes -> General -> “Sound Waves” Options -> Theme effects -> On
    Now the phone will have nice transition effects.
    Source

    Angstrol wrote:
    How long has this been possible?
    Since June 7 or so:
    https://discussions.apple.com/message/15358016#15358016

  • VideoDisplay component - smoothing/deblocking?

    I'm new to Flex 2 (coming from a Flash 7/8 background) and am
    currently
    learning how it works.
    Is it possible to enable smoothing and deblocking on a
    VideoDisplay instance
    in Flex 2? I have read through the docs but can't seem to
    find the property.
    In Flash 8, I was able to achieve this with a FLVPlayback
    component using:
    MovieClip(myVideo.getVideoPlayer(myVideo.activeVideoPlayerIndex))._video.smoothing
    = true;
    Thanks in advance
    -Scrawl

    yes you can enable smoothing and deblocking in flex by extending the videodisplay component . See this article :
    http://askmeflash.com/tutorial/8/how-to-smooth-resized-video-in-videodisplay-component

  • Smooth Scrolling not available

    I tried to enable Smooth Scrolling in Adobe Reader by using Preferences -> Page Display, but the option is not even available for me to select.
    According to the Reader help pages, the last option on the page (below) should be "use smooth scrolling". Any idea why it's not available? I am running Adobe Reader on a MacBook running Tiger.
    Thank you,
    Neil

    I tried to enable Smooth Scrolling in Adobe Reader by using Preferences -> Page Display, but the option is not even available for me to select.
    According to the Reader help pages, the last option on the page (below) should be "use smooth scrolling". Any idea why it's not available? I am running Adobe Reader on a MacBook running Tiger.
    Thank you,
    Neil

  • QT RTSP client doesn't display when direct3d acceleration is enabled

    Hi ,
    I am using Quicktime7.6.5 on WinXP (Core 2 Duo 2.33Ghz and 1GB RAM)as an RTSP client to playback HD streams sent over IP networks by a streaming server.
    If direct3d checkbox(edit->preferences->quicktime->advanced) is enabled(by default it is enabled),actual video streamed is not being displayed,but large quicktime icon is displayed .
    If direct3d acceleration is disabled actual video is played out, but with lot of jerks because of performance issues as acceleration is disabled.
    Instead of RTSP,if the SDP file is directly opened in quicktime to playback same video stream with direct3d enabled, QT plays out without any issues.
    Any ideas on enabling smooth playback of HD streams in quicktime(as RTSP client) ?
    Thanks and regards
    Anil

    Flash often crashes here too, since I’ve installed a GeForce card with the nvidia blob. I think it’s pretty common.
    For youtube and some other video sites you can use the GreaseMonkey script ViewTube in order not to use Flash.

  • Smooth Scrolling in Safari

    Is there a way to enable smooth scrolling in Safari? I know is enabled in the Mac version of Safari but is there a way to do it on PC?

    I already discovered the answer to my question in another post. Turns out Safari 5.1 does not have the feature for smooth scrolling. I think it did in earlier versions but was dropped in v 5.1.1. Apple, we need it back!
    Now, I don't know how to cancel/withdraw this question. Can someone help me with that?

  • Smooth fonts in thunderbird

    how can i enable smooth fonts in thunderbird ?
    i think is a xulrunner issue because system fonts are smooth and only in thunderbird aren't....
    thanks

    karol wrote:Search the forums https://bbs.archlinux.org/viewtopic.php?id=105660
    thanks

  • Smoothing external images

    how to load images before creating the image class for enable
    smoothing?
    In this examples the image is embeded. but i need to load the
    image from {data.image}
    examples:
    The first approach uses the BitmapAsset class, where init()
    is called on creationComplete as follows:
    import mx.core.BitmapAsset;
    [Bindable]
    public var mySmoothImage:BitmapAsset;
    [Bindable]
    [Embed(source="assets/image.jpg")]
    public var myImage:Class;
    public function init():void
    smoothImage = BitmapAsset(new myImage());
    smoothImage.smoothing = true;
    The second approach is somewhat more compact, and uses a
    class level embed that extends Bitmap, as follows:
    [Embed(source="Image.jpg")]
    public class smoothImage extends Bitmap
    public function smoothImage()
    smoothing = true;

    If u want to smooth external loaded images use this metod to make it smooth on "complete" event of image all  image loaders  where ever you need the image smoothing . I have implemented it in my flex project . Taken code from this article: http://askmeflash.com/article_m.php?p=article&id=4

  • Java using GUI's mixed with opengl... needs help...urgent....

    guys, i need help.... is anyone there have an idea about opengl...? ill attach 4 files that needs to be enhanced or debug for possible errors. to see the canvas... you should have atleast all the needed lib and jar of opengl in your pc.
    its urgent, its for our thesis actually....ill be dividing the codes with the use of (" **** ")sign...
    * Main.java
    * Created on 29 January 2007, 08:12
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package longgong;
    * @author welcome
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
            frmMain f = new frmMain();
    * frmMain.java
    * Created on November 10, 2006, 10:52 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package longgong; // create a floder named longgong and add the class inside
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    * @author all user
    public class frmMain extends JFrame implements ActionListener, ChangeListener, ItemListener{
        JPanel pnlWest, pnlEast, pnlCenter, pnlSouth, pnlTitle, pnlSlider, pnlPlayers;
        JSlider slrSpeed;
        JList lstResults;
        String varResults [] = new String[31];
        JLabel lblPlayers, lblTitle;
        JCheckBox lblPlayer1, lblPlayer2, lblPlayer3, lblPlayer4, lblPlayer5, lblPlayer6;
        ImageIcon imgDice1;
        MyCanvas canvas;
        JButton btnStart, btnStop;
        JMenuBar menuBar;
        JMenu menuFile, menuView, menuHelp;
        JMenuItem menuNew, menuExit, menuIn, menuOut, menuHigh, menuPlay, menuAbout;
        boolean isNew = false;
        /** Creates a new instance of frmMain */
        public frmMain() {
            setLayout(new BorderLayout());
            setTitle("Longgong");
            setSize(780,600);
            canvas = new MyCanvas(getSize().width, getSize().height);
            imgDice1 = new ImageIcon("c:\\java\\images\\one.png");
            menuBar = new JMenuBar();
            menuFile = new JMenu("File");
            menuView = new JMenu("View");
            menuHelp = new JMenu("Help");
            menuNew = new JMenuItem ("New Game");
            menuNew.addActionListener(this);
            menuExit = new JMenuItem ("Exit");
            menuExit.addActionListener(this);
            menuIn = new JMenuItem ("Zoom In");
            menuIn.addActionListener(this);
            menuOut = new JMenuItem ("Zoom Out");
            menuOut.addActionListener(this);
            menuHigh = new JMenuItem ("High Score");
            menuPlay = new JMenuItem ("How To Play");
            menuPlay.addActionListener(this);
            menuAbout = new JMenuItem ("About");
            menuAbout.addActionListener(this);
            menuFile.add(menuNew);
            menuFile.add(menuExit);
            menuView.add(menuIn);
            menuView.add(menuOut);
            menuView.add(menuHigh);
            menuHelp.add(menuPlay);
            menuHelp.add(menuAbout);
            menuBar.add(menuFile);
            menuBar.add(menuView);
            menuBar.add(menuHelp);
            setJMenuBar(menuBar);
            varResults[0] = "Dice Results";
            varResults[1] = "1. 3-4-2";
            varResults[2] = "2. 3-1-4";
            varResults[3] = "3. 3-6-5";
            slrSpeed = new JSlider(0, 100, 0);
            slrSpeed.setPaintTicks(true);
            slrSpeed.setMinorTickSpacing(1);
            slrSpeed.setPaintLabels(true);
            slrSpeed.setSnapToTicks(true);
            slrSpeed.addChangeListener(this);
            slrSpeed.setEnabled(false);
            btnStart =  new JButton("Start");
            btnStart.addActionListener(this);
            btnStop =  new JButton("Stop");
            btnStop.addActionListener(this);
            pnlWest = new JPanel();
            pnlEast = new JPanel();
            pnlCenter = new JPanel();
            pnlSouth = new JPanel();
            pnlTitle = new JPanel();
            pnlSlider = new JPanel();       
            pnlPlayers = new JPanel();
            pnlWest.setLayout(new BorderLayout());
            pnlEast.setLayout(new BorderLayout());
            pnlEast.setPreferredSize(new Dimension(100,400));
            pnlCenter.setLayout(new BorderLayout());
            pnlSouth.setLayout(new FlowLayout());
            pnlTitle.setLayout(new FlowLayout());
            pnlSlider.setLayout(new FlowLayout());       
            pnlPlayers.setLayout(new BoxLayout(pnlPlayers,BoxLayout.Y_AXIS));
            pnlPlayers.setPreferredSize(new Dimension(150,400));
            lblPlayers = new JLabel("  Players: Choice (s)");
            lblPlayer1 = new JCheckBox("None");
            lblPlayer1.addItemListener(this);
            lblPlayer2 = new JCheckBox("None");
            lblPlayer2.addItemListener(this);
            lblPlayer3 = new JCheckBox("None");
            lblPlayer3.addItemListener(this);
            lblPlayer4 = new JCheckBox("None");
            lblPlayer4.addItemListener(this);
            lblPlayer5 = new JCheckBox("None");
            lblPlayer5.addItemListener(this);
            lblPlayer6 = new JCheckBox("None");
            lblPlayer6.addItemListener(this);
            lstResults = new JList(varResults);
            pnlPlayers.add(lblPlayers);
            pnlPlayers.add(lblPlayer1);
            pnlPlayers.add(lblPlayer2);
            pnlPlayers.add(lblPlayer3);
            pnlPlayers.add(lblPlayer4);
            pnlPlayers.add(lblPlayer5);
            pnlPlayers.add(lblPlayer6);
            pnlSlider.add(slrSpeed);
            pnlSlider.add(btnStart);
            pnlSlider.add(btnStop);
            pnlEast.add(BorderLayout.CENTER, lstResults);
            pnlCenter.add(BorderLayout.SOUTH, pnlSlider);    
            pnlCenter.add(BorderLayout.CENTER, canvas);    
            lblTitle = new JLabel("LONGGONG DICE GAME SIMULATION");
            pnlTitle.add(lblTitle);
            getContentPane().add(BorderLayout.NORTH,pnlTitle);   
            getContentPane().add(BorderLayout.WEST,pnlPlayers);
            getContentPane().add(BorderLayout.EAST,pnlEast);
            getContentPane().add(BorderLayout.CENTER, pnlCenter);
            getContentPane().add(BorderLayout.SOUTH,pnlSouth);
            setResizable(false);
            canvas.start();
            show();       
        //name change when player is selected
        public void itemStateChanged(ItemEvent e) {
        Object source = e.getItemSelectable();
        int choice;
        if (source == lblPlayer1) {
            if (lblPlayer1.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer1);
        if (source == lblPlayer2) {
            if (lblPlayer2.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer2);
        if (source == lblPlayer3) {
            if (lblPlayer3.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer3);
        if (source == lblPlayer4) {
            if (lblPlayer4.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer4);
        if (source == lblPlayer5) {
            if (lblPlayer5.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer5);
        if (source == lblPlayer6) {
            if (lblPlayer6.isSelected()) {
                frmChoices fchoices = new frmChoices(lblPlayer6);
           // if (e.getStateChange() == ItemEvent.DESELECTED)
            //...make a note of it...
        //slider speed change
        public void stateChanged(ChangeEvent e){      
               canvas.speed(slrSpeed.getValue());
        public void actionPerformed (ActionEvent e){
            if (e.getActionCommand().equals ("Exit")){
                System.exit (0);     
            //connects to frmNew
            if (e.getActionCommand().equals ("New Game")){
                frmNew n = new frmNew(this);   
                lblPlayer1.setText("None");
                lblPlayer2.setText("None");
                lblPlayer3.setText("None");
                lblPlayer4.setText("None");
                lblPlayer5.setText("None");
                lblPlayer6.setText("None");
                isNew = true;
                lblPlayer1.setSelected(false);
                lblPlayer2.setSelected(false);
                lblPlayer3.setSelected(false);
                lblPlayer4.setSelected(false);
                lblPlayer5.setSelected(false);
                lblPlayer6.setSelected(false);
            if (e.getActionCommand().equals ("Start")){
               slrSpeed.setEnabled(true);
               canvas.setRandomDicePosition();
            if (e.getActionCommand().equals ("Stop")){
                slrSpeed.setValue(0);
                slrSpeed.setEnabled(false);
            //ADDED
             if (e.getActionCommand().equals ("New Game")){
               frmNew n = new frmNew(this);           
            if (e.getActionCommand().equals ("Zoom In")){
                canvas.zoomIn();          
            if (e.getActionCommand().equals ("Zoom Out")){
                canvas.zoomOut();          
            if (e.getActionCommand().equals ("How To Play")){
                frmPlay p = new frmPlay();           
            if (e.getActionCommand().equals ("About")){
                frmAbout a = new frmAbout();           
    package longgong;
    // Java  classes
       import java.awt.*;
       import java.awt.event.*;
       import java.net.URL;
    // GL4Java classes
       import gl4java.GLContext;
       import gl4java.awt.GLAnimCanvas;
       import gl4java.utils.textures.*;
       class MyCanvas extends GLAnimCanvas implements KeyListener, MouseListener
         // holds information on which keys are held down.
          boolean[] keys=new boolean[256];
          float     xrot;                    // X Rotation ( NEW )
          float     yrot;                    // Y Rotation ( NEW )
          float     zrot;                    // Z Rotation ( NEW )
          float[] diceRotX = new float[3];
          float[] diceRotY = new float[3];
          float[] diceRotZ = new float[3];
          float[] diceTranX = new float[3];
          float[] diceTranY = new float[3];
          float[] diceTranZ = new float[3];     
          float speedValue;
          Dice[] D;
          float zoom = -15.0f;
          public MyCanvas(int w, int h)
             super(w, h);
             //Registers this canvas to process keyboard events, and Mouse events
             addKeyListener(this);
             addMouseListener(this);  
             setAnimateFps(60); // seemed to be essential in getting any performance
             speedValue=0.0f;
             diceTranX[0] = -2.0f;
             diceTranY[0] = 2.0f;
             diceTranZ[0] = zoom;
             diceTranX[1] = 2.0f;
             diceTranY[1] = 1.0f;
             diceTranZ[1] = zoom;
             diceTranX[2] = 0.0f;
             diceTranY[2] = -2.0f;
             diceTranZ[2] = zoom;
          public void zoomIn(){
              zoom=zoom+1.0f;
           public void zoomOut(){
              zoom=zoom-1.0f;
          public void speed(float s){
            speedValue=s/100;
        /** void reshape(int width, int height) Called after the first paint command.  */  
          public void reshape(int width, int height)
             if(height==0)height=1;
             gl.glViewport(0, 0, width, height);                       // Reset The Current Viewport And Perspective Transformation
             gl.glMatrixMode(GL_PROJECTION);                           // Select The Projection Matrix
             gl.glLoadIdentity();                                      // Reset The Projection Matrix
             glu.gluPerspective(45.0f, width / height, 0.1f, 100.0f);  // Calculate The Aspect Ratio Of The Window
             gl.glMatrixMode(GL_MODELVIEW);                            // Select The Modelview Matrix
             gl.glLoadIdentity();                                      // Reset The ModalView Matrix     
       /** void preInit() Called just BEFORE the GL-Context is created. */  
          public void preInit()
          { doubleBuffer = true; stereoView = false; // buffering but not stereoview
          public void setRandomDicePosition(){
             for (int i=0; i<3; i++){
               D.setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
    D[i].getRandomDice();
    /** void init() Called just AFTER the GL-Context is created. */
    public void init()
    //float width = (float)getSize().width;
    //float height = (float)getSize().height;
    D = new Dice[5];
    D[0] = new Dice(this);
    D[1] = new Dice(this);
    D[2] = new Dice(this);
    //initialize dice location
    for (int i=0; i<3; i++){
    D[i].setCoordinates(diceRotX[i],diceRotY[i],diceRotZ[i],diceTranX[i],diceTranY[i],diceTranZ[i]);
    D[i].getRandomDice();
    gl.glEnable(GL_TEXTURE_2D);                              //Enable Texture Mapping ( NEW )
    gl.glShadeModel(GL_SMOOTH); //Enables Smooth Color Shading
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //This Will Clear The Background Color To Black
    gl.glClearDepth(1.0); //Enables Clearing Of The Depth Buffer
    gl.glEnable(GL_DEPTH_TEST); //Enables Depth Testing
    gl.glDepthFunc(GL_LEQUAL); //The Type Of Depth Test To Do
    gl.glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); //Really Nice Perspective Calculations
    public void DrawBoundaries(){
    double x,y;
    double radius = 5.0f;
    gl.glLoadIdentity();                                             // Reset The View
    gl.glTranslatef(0.0f,0.0f,zoom-1.0f);
    gl.glRotatef(90.0f,0.0f,0.0f,1.0f);
    gl.glColor3f(0.6f,0.3f,0.3f);
    gl.glBegin(gl.GL_POLYGON);
    // angle is
    // x = radius * (cosine of angle)
    // y = radius * (sine of angle)
    for (double a=0; a<360; a++) {
    x = radius * (Math.cos(a));
    y = radius * (Math.sin(a));
    gl.glVertex3d(x, y, 0.0f);
    gl.glEnd();
    gl.glColor3f(1.0f,1.0f,1.0f);
    public void DrawGLScene()
    gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);     // Clear The Screen And The Depth Buffer
    DrawBoundaries();
    for (int i=0; i<3; i++){
    D[i].startDiceMovement();
    D[i].setTz(zoom);
    D[i].setSpeed(speedValue);
    D[i].drawDice();
    for (int i=0; i<3; i++){
    //start of loop
    if(i!=0){    
    if (D[0].getMoveLeft()==true){        
    if ( (D[0].getTx()>=D[i].getTx()-1.0f) && (D[0].getTx()<=D[i].getTx()) ){
    if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
    else D[0].setMoveLeft(true);
    }else{
    if ( (D[0].getTx()-1<=D[i].getTx()) && (D[0].getTx()-1>=D[i].getTx()-1) ){
    if (D[0].getMoveLeft()== true) D[0].setMoveLeft(false);
    else D[0].setMoveLeft(true);
    if (D[0].getMoveUp()==true){        
    if ( (D[0].getTy()>=D[i].getTy()-1.0f) && (D[0].getTy()<=D[i].getTy()) ){
    if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
    else D[0].setMoveUp(true);
    }else{
    if ( (D[0].getTy()-1<=D[i].getTy()) && (D[0].getTy()-1>=D[i].getTy()-1) ){
    if (D[0].getMoveUp()== true) D[0].setMoveUp(false);
    else D[0].setMoveUp(true);
    }//end of if i!=0
    if(i!=1){    
    if (D[1].getMoveLeft()==true){        
    if ( (D[1].getTx()>=D[i].getTx()-1.0f) && (D[1].getTx()<=D[i].getTx()) ){
    if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
    else D[1].setMoveLeft(true);
    }else{
    if ( (D[1].getTx()-1<=D[i].getTx()) && (D[1].getTx()-1>=D[i].getTx()-1) ){
    if (D[1].getMoveLeft()== true) D[1].setMoveLeft(false);
    else D[1].setMoveLeft(true);
    if (D[1].getMoveUp()==true){        
    if ( (D[1].getTy()>=D[i].getTy()-1.0f) && (D[1].getTy()<=D[i].getTy()) ){
    if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
    else D[1].setMoveUp(true);
    }else{
    if ( (D[1].getTy()-1<=D[i].getTy()) && (D[1].getTy()-1>=D[i].getTy()-1) ){
    if (D[1].getMoveUp()== true) D[1].setMoveUp(false);
    else D[1].setMoveUp(true);
    }//end of if i!=1
    if(i!=2){    
    if (D[2].getMoveLeft()==true){        
    if ( (D[2].getTx()>=D[i].getTx()-1.0f) && (D[2].getTx()<=D[i].getTx()) ){
    if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
    else D[2].setMoveLeft(true);
    }else{
    if ( (D[2].getTx()-1<=D[i].getTx()) && (D[2].getTx()-1>=D[i].getTx()-1) ){
    if (D[2].getMoveLeft()== true) D[2].setMoveLeft(false);
    else D[2].setMoveLeft(true);
    if (D[2].getMoveUp()==true){        
    if ( (D[2].getTy()>=D[i].getTy()-1.0f) && (D[2].getTy()<=D[i].getTy()) ){
    if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
    else D[2].setMoveUp(true);
    }else{
    if ( (D[2].getTy()-1<=D[i].getTy()) && (D[2].getTy()-1>=D[i].getTy()-1) ){
    if (D[2].getMoveUp()== true) D[2].setMoveUp(false);
    else D[2].setMoveUp(true);
    }//end of if i!=2
    //end of loop for i
    /** void display() Draw to the canvas. */
    // Purely a Java thing. Simple calls DrawGLScene once GL is Initialized
    public void display()
    for(int i=0;i<3;i++){
    glj.gljMakeCurrent(); //Ensure GL is initialised correctly
    DrawGLScene();
    glj.gljSwap(); //Swap buffers
    glj.gljFree(); // release GL
    // Key Listener events
    public void keyTyped(KeyEvent e){
    public void keyPressed(KeyEvent e){
    switch(e.getKeyCode())
    //Kill app
    case KeyEvent.VK_ESCAPE:
    System.exit(0);
    break;
    default :
    if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
    keys[e.getKeyCode()]=true;     
    break;
    public void keyReleased(KeyEvent e){
    if(e.getKeyCode()<250) // only interested in first 250 key codes, are there more?
    keys[e.getKeyCode()]=false;
    // mouse listener events
    public void mouseEntered( MouseEvent evt )
    Component comp = evt.getComponent();
    if( comp.equals(this ) )
    //requestFocus();
    public void mouseExited( MouseEvent evt ){
    public void mousePressed( MouseEvent evt ){
    public void mouseReleased( MouseEvent evt ){
    public void mouseClicked( MouseEvent evt )
    Component comp = evt.getComponent();
    if( comp.equals(this ) )
    requestFocus();
    * Dice.java
    * Created on 08 February 2007, 22:26
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package longgong;
    import java.net.URL;
    import gl4java.GLContext;
    import gl4java.awt.GLAnimCanvas;
    import gl4java.utils.textures.*;
    * @author welcome
    public class Dice {
          GLAnimCanvas glCanvas ;
          URL codeBase;
          int[]texture1 = new int[1]; //Storage for one texture ( NEW )    
          int[]texture2 = new int[1]; //Storage for one texture ( NEW )    
          int[]texture3 = new int[1]; //Storage for one texture ( NEW )    
          int[]texture4 = new int[1]; //Storage for one texture ( NEW )    
          int[]texture5 = new int[1]; //Storage for one texture ( NEW )    
          int[]texture6 = new int[1]; //Storage for one texture ( NEW )    
          float rx;
          float ry;
          float rz;
          float tx;
          float ty;
          float tz;
          float speed;
          boolean txMoveLeft;
          boolean tyMoveUp;
          boolean tzMoveFront;
        /** Creates a new instance of Dice */
        public Dice(GLAnimCanvas g) {
            glCanvas = g;       
            if(!LoadGLTexture("c:\\java\\images\\one.png",texture1)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            if(!LoadGLTexture("c:\\java\\images\\two.png",texture2)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            if(!LoadGLTexture("c:\\java\\images\\three.png",texture3)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            if(!LoadGLTexture("c:\\java\\images\\four.png",texture4)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            if(!LoadGLTexture("c:\\java\\images\\five.png",texture5)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            if(!LoadGLTexture("c:\\java\\images\\six.png",texture6)){
                System.out.println("Failed to load Textures,Bailing!");
                System.exit(0);
            txMoveLeft = true;
            tyMoveUp = true;
         public boolean inCircleBoundaries(float x, float y, float radius)
            float r;       
            r = (float)Math.sqrt((x*x) + (y*y));
            if (r <= radius)
                return  true;
            else
                return false;
        public void setCoordinates(float corRx,float corRy,float corRz,float corTx,float corTy,float corTz){
            rx = corRx;
            ry = corRy;
            rz = corRz;
            tx = corTx;
            ty = corTy;
            tz = corTz;
        public void getRandomDice(){
            int num = (int)(Math.random() * 6);
            if (num==1){
                rx=0.0f;
                ry=0.0f;
                rz=0.0f;
            else if (num==2){
                rx=90.0f;
                ry=0.0f;
                rz=0.0f;
            else if (num==3){
                rx=0.0f;
                ry=-90.0f;
                rz=0.0f;
            else if (num==4){
                rx=0.0f;
                ry=90.0f;
                rz=0.0f;
            else if (num==5){
                rx=-90.0f;
                ry=0.0f;
                rz=0.0f;
            else{
                rx=180.0f;
                ry=0.0f;
                rz=0.0f;
        public float getTx(){
            return tx+0.5f;
        public float getTy(){
            return ty+0.5f;
        public float getTz(){
            return tz+0.5f;
        public void setTz(float z){
            tz=z;
        public boolean getMoveLeft(){
            return txMoveLeft;
        public boolean getMoveUp(){
            return tyMoveUp;
        public void setMoveLeft(boolean m){
            txMoveLeft = m;
        public void setMoveUp(boolean m){
            tyMoveUp = m;
        public void startDiceMovement(){    
            if (txMoveLeft==true) {
                tx+=speed;           
            else {
                tx-=speed;
            if (tyMoveUp==true) {
                ty+=speed;
            else {
                ty-=speed;
            ry+=(speed*4);
            rx+=(speed*4);
            //rz+=(speed*2);
            //tx+=speed;
            //ty+=speed;
            //tz+=speed;             
         if (inCircleBoundaries(tx,ty,3.5f)==false) {  
            if (tx>=3.0f) txMoveLeft = false;
            if (tx<=-3.0f) txMoveLeft = true;
            if (ty>=3.0f) tyMoveUp = false;
            if (ty<=-3.0f) tyMoveUp = true;
        public void setSpeed(float s){
            speed = s;
         public void drawDice(){        
             glCanvas.gl.glLoadIdentity();                                             // Reset The View
             glCanvas.gl.glTranslatef(tx,ty,tz);
             glCanvas.gl.glRotatef(rx,1.0f,0.0f,0.0f);
             glCanvas.gl.glRotatef(ry,0.0f,1.0f,0.0f);
             glCanvas.gl.glRotatef(rz,0.0f,0.0f,1.0f);
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture1[0]);        
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
                // Front Face
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
             glCanvas.gl.glEnd();
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture6[0]);
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
               // Back Face          
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
             glCanvas.gl.glEnd();
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture2[0]);
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
                // Top Face
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
             glCanvas.gl.glEnd();
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture5[0]);
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
                // Bottom Face
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
             glCanvas.gl.glEnd();
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture3[0]);
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
                // Right face
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f( 1.0f,  1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f( 1.0f, -1.0f,  1.0f);
             glCanvas.gl.glEnd();
             glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, texture4[0]);
             glCanvas.gl.glBegin(glCanvas.gl.GL_QUADS);        
                // Left Face
             glCanvas.gl.glTexCoord2f(0.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f, -1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 0.0f); glCanvas.gl.glVertex3f(-1.0f, -1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(1.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f,  1.0f);
             glCanvas.gl.glTexCoord2f(0.0f, 1.0f); glCanvas.gl.glVertex3f(-1.0f,  1.0f, -1.0f);
             glCanvas.gl.glEnd();
          public boolean LoadGLTexture(String fileName, int textureNumber[])
             PngTextureLoader texLoader = new PngTextureLoader(glCanvas.gl, glCanvas.glu);
             if(codeBase!=null)  
                texLoader.readTexture(codeBase, fileName);
             else
                texLoader.readTexture(fileName);
             if(texLoader.isOk())
                //Create Texture
                glCanvas.gl.glGenTextures(1, textureNumber);
                glCanvas.gl.glBindTexture(glCanvas.gl.GL_TEXTURE_2D, textureNumber[0]);
                glCanvas.gl.glTexParameteri(glCanvas.gl.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    ill attach 4 files that needs to be
    enhanced or debug for possible errors. i hate to break it to you, but even if you post this for the seventh time, finding and fixing errors in your code remains your task.

  • Screen page keeps moving or bouncing up and down slightly when I use my scroll wheel on my mouse, it only happened after updating to 6.0

    I just updated to Firefox 6.0 with my windows 7 64bit OS. As soon as it was installed, pages began making quick moves up and down just a half inch or so when I use the scroll wheel on my Logitech MX620 mouse. When I use the scroll wheel, it does scroll, but when I stop scrolling, the page bounces up and down a half inch a few times before the page stops moving.

    I found a temporary fix, go into Logitech Setpoint and uncheck the box "Enable Smooth Scrolling" in the pointer and scrolling settings. It will make scrolling slightly less smooth but at least the web pages stop bouncing up and down on their own.

  • Problem removing referrals in 5.2

    Hi.
    I've been trying to relocate some data from one set of DS installations to another set, on the same machines--which I did by replicating to the new master, promoting it to hub, adding the new replica, promoting the new master to master, enabling multimaster, then disabling replication from the old master and then taking it down. Everything went fairly smoothly, except I ended up with some strange behavior when changes are being made on the replica--and the only thing I can come up with to explain it is that there are referrals from the connections to the original pair of servers, which will NOT go away permanently.
    The master has a referral to the old master, though it shouldn't be using it at all. However, nothing I can do will make this referral go away permanently. If i delete it from the console, directly, it goes away--then comes back either in a matter of minutes, or after a restart. Same if I delete it from the dse.ldif file. I can't find anything else which holds this referral data (including the o=netscaperoot area of the config directory), where it could be reloading every time I restart. Clearly the "Delete" function in the console is pointless since no delete will actually stick.
    But I think my problem is on my replica, where I have referrals to two different servers, which may both have been the current master, but while it was on two different ports (btw, I'll point out as well that changing the port the server runs on via the console appears to leave a lot of configs pointing to the original install port, implying it's far from a clean port change). And my best guess as to the strange behavior I'm seeing is that somehow the replica is trying to pass referrals to both server instances, which are actually the same master, and the master is attempting to make the change twice. Which causes problems when you're doing adds and deletes--the first one works fine, but then you get an error that it already exists or that there's no such object.
    I even brought back my original master instance and made sure to delete (rather than merely disabling) the original replication agreements, on the theory that only by deleting would the replica know to remove the referral, but that didn't work either. So as it stands, I have 2 bad referrals on 2 instances, and no way I can find anywhere, as to how to remove these referrals without completely replacing the instances. I may end up deciding I need to rebuild the replica anyway, in hopes this will clear up my problems, if I don't get a solution to this behavior very quickly. Getting errors every time you try to access/modify ldap is hardly a desirable state of affairs.
    Anyone, help?

    I had master:4389 -> replica:4389. I added master:3389 as consumer. I promoted master:3389 to hub and added replica:3389. I promoted master:3389 to master as part of a step-by-step process to verify at each stage things were still working properly. Made master:4389 and master:3389 multimaster. Then either demoted master:4389 to hub or just disabled its replication agreements and shut it down. Then with only master:3389 and replica:3389 left, I changed the ports for both instances to get them back to port 4389.
    This left the master, now back to 4389, witha referral to master:4389 which was impossible to delete. And replica, now 4389, with referrals to both master:4389 and master:3389. Deleting the referrals didn't work, obviously.
    A little while ago, I returned the new master:4389 to master:3389, and replica:4389 to replica:3389 (as mentioned, there were other references to the port number which didn't change with a console port-number change), brought back the old master:4389, and deleted both of its replication agreements. Referrals weren't automatically removed. Deleted them manually again. They stayed gone... until I restarted the directory servers. Are you claiming the only way to remove a referral to a nonexistent master is to completely turn off replication at the consumer? That seems kind of stupid, considering the whole point of this promotion-demotion thing is to enable smooth and flexible reorganization of your replication architecture--if I have to disable replication in order to do it safely, that seems an extremely questionable requirement, and certainly not one that's advertised anywhere I've been able to find.
    And you can't make a server a master without promoting it. If you enable replication as a consumer in order to get the initial data populated from the old master, in order to change it to be a master itself, you are required to promote it to Hub, so it can add changelog configs, etc, and then promote it to be a master. I suppose if somehow I'd had any reason to know the built-in system for manipulating the replication architecture was this screwy, I might have chosen to turn off replication completely (which may or may not have removed the referral to the original master, I have no proof from anything I've done yet that it would work), then enable it again as a master.
    But why would I do that? Without some reason to believe things wouldn't work as advertised??

  • My options are not being saved/updated?

    I have, for example, enabled smooth scrolling, but I don't see its effect. I have also enabled to remember some passwords, but it's not happening. It also doesn't keep me logged into sites such as Hotmail once I close the browser without signing out. And every time I open a .pdf file, it directly asks me where to save when I don't want to. How can I fix it so that it automatically opens such files '''or''' ask me whether I first want to open it or save it?

    589/3035
    Hi Tom,
    "Maybe I shouldn't be doing this in Firefox?"
    IMO it has nothing to do with our local browsers, as we should be able to visit Apple websites from any XYZ browser on a Windows machine in a public library?
    If the browser was a problem, well this would be a huge bug/misconception...
    Sorry I don't have an answer, but the problem may be temporary, it may occur at the same times when there is also a long delay before updating new posts?
    Try again (and clear cookies again), see if it works today?
    Good luck!
    Axl

  • I have a few technical questions on Safari 4!

    *Keyboard Shortcuts*
    How do I set these?
    *Smooth scrolling*
    I am using the Windows version of Safari 4. Is there a way to enable smooth scrolling?

    - You can just use the built-in keyboard short cuts.
    - Smooth Scrolling is not available (unfortunately).

  • ANNC: Image Gallery Magic Now Available

    Picture perfect...
    Bring your images to life with the most powerful,
    feature-rich image
    gallery solution available for Dreamweaver: Image Gallery
    Magic by
    PVII - the leader in creative Dreamweaver extensions. Create
    image
    galleries from from inside Dreamweaver - in Windows or OS X.
    Image
    Gallery Magic can create the entire layout for you or you can
    insert a
    gallery into an existing page. While Image Gallery Magic is
    powered by
    thoroughly modern CSS and Scripting, we've taken great pains
    to ensure
    that your gallery will work in all modern browsers (on all
    operating
    systems) and some key older browsers, such as IE5.x (Windows
    and OS X).
    http://www.projectseven.com/products/galleries/hgmagic/index.htm
    All aspects of your gallery are managed from within the iGM
    user
    interface window.
    Add (append) new images to your gallery. You can use the
    automatic build
    mode, which leverages the Fireworks image processing engine,
    or you can
    select images that you've already processed yourself in
    Photoshop or any
    other image editor.
    Delete images or re-order them.
    Manage Captions, Descriptions, and a counter - including
    where they
    appear.
    Edit images (the edit command launches your default image
    editor and
    loads the selected image).
    Re-generate thumbnails automatically after editing a
    full-size image
    (Fireworks interoperability).
    Choose a full-size image to load when your page loads.
    Select the number of thumbnails to display per row.
    Enable smooth-glide scrolling of thumbnail rows.
    Choose an animation effect for your full-size images.
    Supports Dreamweaver Templates.
    Allows direct linking to individual images.
    Search-engine friendly.
    Accessible - even with JavaScript disabled.
    The PVII Team
    http://www.projectseven.com

    Picture perfect...
    Bring your images to life with the most powerful,
    feature-rich image
    gallery solution available for Dreamweaver: Image Gallery
    Magic by
    PVII - the leader in creative Dreamweaver extensions. Create
    image
    galleries from from inside Dreamweaver - in Windows or OS X.
    Image
    Gallery Magic can create the entire layout for you or you can
    insert a
    gallery into an existing page. While Image Gallery Magic is
    powered by
    thoroughly modern CSS and Scripting, we've taken great pains
    to ensure
    that your gallery will work in all modern browsers (on all
    operating
    systems) and some key older browsers, such as IE5.x (Windows
    and OS X).
    http://www.projectseven.com/products/galleries/hgmagic/index.htm
    All aspects of your gallery are managed from within the iGM
    user
    interface window.
    Add (append) new images to your gallery. You can use the
    automatic build
    mode, which leverages the Fireworks image processing engine,
    or you can
    select images that you've already processed yourself in
    Photoshop or any
    other image editor.
    Delete images or re-order them.
    Manage Captions, Descriptions, and a counter - including
    where they
    appear.
    Edit images (the edit command launches your default image
    editor and
    loads the selected image).
    Re-generate thumbnails automatically after editing a
    full-size image
    (Fireworks interoperability).
    Choose a full-size image to load when your page loads.
    Select the number of thumbnails to display per row.
    Enable smooth-glide scrolling of thumbnail rows.
    Choose an animation effect for your full-size images.
    Supports Dreamweaver Templates.
    Allows direct linking to individual images.
    Search-engine friendly.
    Accessible - even with JavaScript disabled.
    The PVII Team
    http://www.projectseven.com

  • MOV files won't play on Windows computers

    I have a number of MOV files (shot in full 1080 resolution) that won't play on a Windows PC. When I attempt to open them I get a warning stating that Quicktime may need extra files (or plugins?) in order to play the file. When I select the link it takes me to a page with all sorts of other providers such as DivX. With that said, what is the best format to enable smooth playback on a Windows machine?

    I am in the same boat. I need to view AVCHD files that were converted to .mov by iMovie on a PC.
    I think it is mainly because iMovie isn't really compatible with AVCHD so it converts it to .mov.
    But it is not a normal .mov!
    Apple loves to help you go from PC to MAC but when you try to go back again, God help you.
    I refused to pay the price for a new MacBook so bought a core i7 laptop for less than the cheapest MacBook(white)!
    I am starting to believe that Apple suck!
    Don't even get me started on the iPhoto and iTunes issues to change back!

Maybe you are looking for