This is a blog about Flash & AS by betaruce :-)


September 2006
« Aug   Oct »
  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  

September 30, 2006

AS3 Tips: hitTest split into 2

Filed under: Tutorials — betaruce @ 2:17 pm

the original MovieClip.hitTest can detect collisoin of boundary box of 2 objects or collision of a point and an object. These 2 are now split into 2:

  1. //Evaluates the display object to see if it overlaps or intersects with the obj display object
  2. hitTestObject(obj:DisplayObject):Boolean
  3. //Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters
  4. hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean

Click here to read the livedocs

• • •

September 9, 2006

More fun with AS 3 TextField.getCharBoundaries

Filed under: My Flash Programs, Tutorials — betaruce @ 12:49 pm

So this time the string you search will be highlighted by 2 filters. The boundary of the string is found by TextField.getCharBoundaries and then a GlowFilter and a DropShadowFilter are applied to the corresponding bitmap. I am sure there are more possible effects.

here's the example


• • •

September 8, 2006

AS 3: TextField.getCharBoundaries()

Filed under: Using Flash, Tutorials — betaruce @ 10:56 pm

This new feature is definitely one that many users had been looking forward to for ages. It returns a rectangle that is the bounding box of a character.

How to use it?


  1. public function getCharBoundaries(charIndex:int):Rectangle

First you have to get the position of a character in a string. e.g. "FLASH", then "F" corresponds to 0, "L" corresponds to 1, etc. This is the parameter charIndex. You will get back the rectangle that bound the character at the location charIndex.

Read livedocs for more details.

Here's an example. Search for sth and the match will be highlighted. The yellow highlighting patch is drawn by the drawing API. Get the source here.

However there are some limitations or skills in using this new method....


• • •

September 6, 2006

Learn Regular Expression in AS3 now

Filed under: Using Flash — betaruce @ 1:02 pm

A regular expression describes a pattern that is used to find and manipulate matching text in strings. A typical example of its usage is to validate whether a user has typed in an email in the correct format.

Regular expression is new in AS3, although it is included in other languages for a long time. It is very useful and if you haven't come across it, why not learn it now?

Start reading Adobe livedocs on Regular expression :)

• • •

Powered by: WordPress • Template by: Priss

cheap phentermine phentermine site phentermine effects online phentermine phentermine prescription buy phentermine online phentermine alternatives phentermine deit pill cheap generic phentermine order phentermine online Clenbuterol Phentermine online pharmacy phentermine buy phentermine weight loss pill Cialis Comparison Viagra Cheap Viagra Online Prescription generic viagra sale viagra online viagra viagra pill discount sale viagra Generico Impotencia Viagra viagra sildenafil citrate Xanax Online xanax order xanax valium versus xanax