Papervision3D 1.5 official release
check it out here
betaruce.com
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 |
In previous versions of AS, just a few lines of simple codes will allow you to click on a button and go to another website. In AS3, however, getURL() is replaced. You have to do the following:
btn is a movie clip on stage. When someone click on it, it will trigger the onClick() function and bring the user to adobe web.
Then, you have to declare the url with the URLRequest object. Last but not the least, we have to code the onClick() function.
getURL() is replaced by navigateToURL(), which belongs to flash.net. The syntax is:
public function navigateToURL(request:URLRequest, window:String = null):void
The 1st parameter is the URLRequest object that contains the target url. The 2nd parameter defines whether a new window will pop up or open the website in the current window.
If there is "\" in a String variable, it will be "deleted" automatically and immediately (since "\" is usually used to represent something e.g. "\n" means a line break), and you won't be able to replace it e.g. with regular expression. To overcome this, you may use "\\".
However, if the value is taken from a textfield (either dynamic or input textfield), the "\" will still remain.
In AS3, if you want to type a link to a website or load in something, make sure you use "/" but not "\". For example:
http://......
C:/program files/....
This is because if you use Windows, the links shown in the file browers will use "\", and if you simply copy that into your AS, you will fail to load in that thing and then you will keep searching for bugs without a clue.
If you are from HK and you have a blog about stuff like Flash, Flex, AS, etc, please join the following blogline
I was typing some AS3 one day and was a bit lazy. I did the following:
The EnterFrame work, but not the Mouse event. This is because the mouse event does not respond to the timeline ("this" refers to the timeline).
Therefore, to make the mouse respond to the movement, I add the event to some object e.g. stage in my case.
This is also true for Keyboard events.
Stage is only the class name i.e. flash.display.Stage, whereas stage is the thing referring to the real stage.
This can create lots of confusion, esp in the Flash 9 Alpha Stage is highlighted in blue but not stage.
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:
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...)
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
Grant Skinner has some good analysis on the backend garbage management of AS. Unlike the previous AS versions, AS 3 is more like a "traditional" OOP programming language e.g. Java or C. Thus there's more resources problem for programmer to think when they program in AS 3.
Read the article here:
http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html
http://www.gskinner.com/blog/archives/2006/07/as3_resource_ma_1.html
Visit his blog for some other related articles.