Archive for Articles Submits

AS 3 : HitTest Checks on ActionScript 3.0

This is an example on how one should do a hittest in ActionScript 3.0.

This is an example of plain simple flash mode, where MovieClipA(red) and MovieClipB(blue) – Red being draggable and blue square listens to the a HitTest condition.

Some criteria needed for this task :-

  • Two movieclips – Red and Blue
  • EventListener assigned to Red to have it drag and drop able.
  • EventListener for EnterFrame for Blue to constantly checks for HitTest condition

For those new in EventListener in ActionScript 3.0 here’s a good tutorial for it.

See sample below :-


Download sample source code here.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//Task to accomplish for HitTest
//1. Two movieclips - Red and Blue (Given instance name MovieClipRed and MovieClipBlue
//2. EventListener assigned to Red to have it drag and drop able.
//3. EventListener for EnterFrame for Blue to constantly checks for HitTest condition
 
 
//Task 1. is done in the stage itself.
//Task 2. Place an Eventlistener on Red have it drag nad drop able.
MovieClipRed.addEventListener(MouseEvent.MOUSE_DOWN,startDragme);
MovieClipRed.addEventListener(MouseEvent.MOUSE_UP,stopDragme);
 
// Below is the trigger function for EventListener Task 2.
function startDragme(event:Event):void{
	MovieClipRed.startDrag(true);
	StatusTxt.text = "Dragging Red";
}
 
function stopDragme(event:Event):void{
	MovieClipRed.stopDrag();
	StatusTxt.text = "Dropping Red";
}
 
MovieClipBlue.addEventListener(Event.ENTER_FRAME,checkHitTest);
 
function checkHitTest(event:Event){
		if(MovieClipRed.hitTestObject(MovieClipBlue))
		{
			StatusTxt.text = "Bingo - Blue has detected Red";
		}
}

12 Subtle Things You Should Know about IPOD Touch

For those thinking of buying IPOD Touch, here 12 cool subtle things you should know when you get this fantastic device. I call it subtle because – it is a kind of user experience thingy.

Read the rest of this entry »

Hardware: RM Media HDD Player (REPOST)

Ever wonder would it be nice to just have rmvb, avi, mp4, and other format video files to be played in one device and it’s connected to TV? No, it’s not a lappy it’s the new RM Media HDD Player.

For some reason, these RM Media HDD Player is rare and only exist in countries like China, Taiwan and Japan. Recently, I been to Taiwan and decided to take a cab to their tech and gadget hub called, Ba De Lu. Finding this device was indeed kinda rare, I have to ask around to get it. Finally, a lady inside a PSP shop was selling it.

Each hdd player comes without hard drive, but even without hard drive, you can still plugin a usb flash drive with files to use it.

Read the rest of this entry »

AS3: Scripting OnClick GetURL? (Where’s GetURL)

Another big suprise for AS3 is the missing GetURL where we used to script it on buttons to open up url. However that was replaced in ActionScript 3.0. We use navigateToURL instead.

Just follow the example when scripting your button. Remember like in previous tutorials, you need to add an eventlistener to your button to attached a function to it.

1
2
3
4
5
6
this.YourButton.addEventListener(MouseEvent.CLICK,openURL);
function openURL(event: MouseEvent)
{
	var request:URLRequest = new URLRequest("http://www.isgoodstuff.com");
	navigateToURL(request);
}

Having Nightmares of MS Vista Wireless Disconnect?

disconnect Oh yeah an epic nightmare..at first you thought is was your ISP doing frequent maintenance then, you suspect it was your router giving problem and you exchange and upgrade the firmware…yet, the problem haunts you.

Every time you connect to your wifi router, and after an few minutes or sometimes an hour if you are lucky disconnect and the router resets by itself.

Fine, SP1 is here upgraded…still the same problem; as for my case my pc just ain’t good enough for a SP1 upgrade (I got BSOD right after that) so, I stopped the automatic update upon reaching SP1. So, who’s the culprit?

Read the rest of this entry »

Page 10 of 13« First...89101112...Last »