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



Calendar

August 2007
M T W T F S S
« Jul    
  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 31  

May 16, 2007

French translation of my previous tutorials

Filed under: Tutorials — betaruce @ 11:36 pm

Thanks Patrick from France for translating my beginner’s AS 3 tutorial into French. You can view it here.

He has also translated my Fire tutorial.

• • •

December 4, 2006

Flash 8 Tutorial: Fire effect

Filed under: My Flash Programs, Tutorials — betaruce @ 9:26 pm

I find that many people want to make a fire effect with the new filters in Flash 8.

I have written a tutorial about my way of creating this effect. My way is quite simple and the effect is realistic enough, altho it maybe a bit CPU intensive. Anyway I hope this can be a useful one :) .

Read the tutorial here.

Basically you can use the same principal and write it in AS 3. If people think it is good and the response is good, I will write one in AS 3 later.

• • •

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:

Actionscript:
  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

source

• • •

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?

Syntax:

Actionscript:
  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....

(more...)

• • •

July 27, 2006

AS3: …(rest) parameter

Filed under: Tutorials — betaruce @ 12:01 pm

This may look strange at the first sight. Actually this new keyword allows function to accept any number of arguments.

Actionscript:
  1. function testing(...rest){
  2. trace(rest);
  3. }
  4. testing(1,2,'abc','def') // output: 1,2,abc,def

The arguments need to be separated by comma, and they will be stored into the array named "rest". It is not a must to name it "rest". You can use whatever names, just make sure you do not use other AS keywords.

Actionscript:
  1. function testing2(...student){
  2. trace('There are ' + student.length + ' students'); //
  3. trace('The 1st student is '+ student[0]);
  4. trace('The 3rd student is '+ student[2]);
  5. }
  6. testing2('Peter','Mary','Albert','Joyce');
  7. /*
  8. output:
  9. There are 4 students
  10. The 1st student is Peter
  11. The 3rd student is Albert
  12. */

You can also use with other predefined parameters, and ...rest need to be the last parameter specified.

Actionscript:
  1. function myFriends(myName, ...friends){
  2. trace('My name is ' + myName);
  3. trace('I have ' + friends.length + ' good friends. They are:');
  4. for(var i:int in friends){
  5. trace(friends[i]);
  6. }
  7. }
  8. myFriends('Peter','Mary','Joseph');
  9. /*
  10. output:
  11. My name is Peter
  12. I have 2 good friends. They are:
  13. Mary
  14. Joseph
  15. */

...rest is recommended instead of the arguments object. They are very similar, but the new ...rest do not have functionality like arguments.callee.

• • •

July 24, 2006

Can I use AS3 as a scripting language in the timeline just like before?

Filed under: Tutorials — betaruce @ 1:32 am

This maybe the question in many users mind when they first touch AS 3 and Flash 9 Alpha. Can I code in the old way instead of typing those OOP stuff?

The answer is YES. So when should I use it as a scripting language and when as an OOP project? And is there an example of coding in the scripting-language-style?

You may find the answer here: http://as3.betaruce.com/tut/appendix/app_1/app_1.html

----------------------------------------------
AS 3 tutorial by betaruce
http://as3.betaruce.com/tut/

• • •

July 19, 2006

AS 3 Tutorial (Japanese version)

Filed under: Tutorials — betaruce @ 6:19 pm

I would like to thank Katsunori Nagai (http://www.himco.jp/articles.cfm) from Japan for translating my tutorials into Japanese. I know that there are many Flash user from Japan visiting this site and I hope the translation will help :)

Here is the link to the Japanese version: http://www.himco.jp/articles/pdf/AS3Tut.swf

I have been quite busy recently but I have not stopped writing the tutorials. If you have any suggestions you may leave a message here :)

• • •

July 8, 2006

Tutorial 4: Revision and some new concepts

Filed under: Tutorials — betaruce @ 11:49 pm

http://as3.betaruce.com/tut/tut_4/tut_4.html

I will talk more on events e.g. how to use double click. I will also talk about how to use imported image in Flash when there is no more things like attachMovie.

--------------------------------------------------
Access all the tutorials here:
http://as3.betaruce.com/tut/

• • •

July 3, 2006

Tutorial 3 - Events

Filed under: Tutorials — betaruce @ 11:11 pm

Here comes tutorial 3 - Make things move and interact with Events. This tells you how to make objects respond to events.

http://as3.betaruce.com/tut/tut_3/tut_3.html

I have also grouped my tutorials in a simple website for faster reference.

http://as3.betaruce.com/tut/

I hope my tutorials can help you guys to start coding AS 3. Everyone is new to AS 3 and maybe professionals only have several months more experience in it than you do. Feel free to leave a comment if you have any problems or suggestions and we may discuss together :)

• • •
— Next Page »

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