AS3 – Actionscript 3 – globalToLocal & localToGlobal

I’m hacking to pieces the Open Flash Charts in a project I am working on.

One bit required me to put a Sprite to the same position as another Sprite but under a different Parent DisplayObject. I was using the globalToLocal and localToGlobal methods but couldn’t get it to work. There wasn’t much on the net about how to use this except from basic programming principles.

What cracked it for me was you call the method localToGlobal on the PARENT of the Sprite you want to copy. As follows.

var clone:AxisLabel = g.x_axis.labels.getChildAt(index) as AxisLabel;
var position:Point = label.parent.globalToLocal(clone.parent.localToGlobal(new Point(clone.x,clone.y)));
label.x = position.x;
label.y = position.y;

So I wanted to put my label in the same absolute position as the ‘clone’. So I called localToGlobal on it’s PARENT.

Hope this helps!

Posted on November 18, 2009 at 8:00 pm by Jordan Carter · Permalink · One Comment
In: Actionscript 3 · Tagged with: , ,

Cuda AI controlling 4000 Planes simultaneously

Here is a quick video showing how CUDA on NVidia graphics cards can run AI (Artificial Intelligence), very impressive.

Posted on November 2, 2009 at 8:51 am by Jordan Carter · Permalink · Leave a comment
In: Artifical Intelligence, Gaming, Video · Tagged with: ,

Failed to parse existing X config file ‘/etc/X11/xorg.conf’

If you are trying to save your xorg.conf file after changing settings in the nvidia-settings app you may need to first replace it with

sudo nvidia-xconfig

This will back it up and then recreate it.  Seems a fresh install of Karmic Koala 9.10 doesn’t create a valid xorg.conf or it can’t parse it.  Whatever the case, that’s the fix.

Then you can

sudo nvidia-settings

To change and save your settings.

Posted on October 31, 2009 at 1:38 pm by Jordan Carter · Permalink · 15 Comments
In: Ubuntu Tricks · Tagged with: 

Get Your Karmic Koala, Round Up Round Up

ubuntu karmic koalaGo over and get the new Ubuntu release Karmic Koala 9.10

Torrents
Karmic Koala Desktop 64
Karmic Koala Desktop 32

I am currently organising the partition on my new hard drive so I can fresh install.  Oh this is taking too long!

Posted on October 30, 2009 at 10:11 am by Jordan Carter · Permalink · Leave a comment
In: News · Tagged with: ,

ATI Radeon HD 5800 Eyefinity with 24 Monitors

Wanting more than 2 screens up until late has been the realm of the hard core enthusiasts.  Now it is the realm of the enthusiasts.  Check out 4 Radeon HD 5800 in one machine!  This demo is running Ubuntu 9.04 with X-Plane.  Impressive!

I think it is not too practical due to the grid lines which separate all the screens but soon we will be seeing displays with much smaller bezels to fix the issue. Read the rest of this post »

Posted on October 22, 2009 at 12:15 am by Jordan Carter · Permalink · Leave a comment
In: Gaming · Tagged with: , ,