Category 'Flash'
For completeness, in relation to Painting Flash CS3: Matrix effects with matrices I want to emphasize that the Matrix is not necessary for the behavior indicated in previous post. In fact we see in the example below:
The code is slightly different from the previous one, is as follows:
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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| / * ** Actionscript 2.0 code * / . MouseEvent ; import flash.events. MouseEvent ; . Matrix ; flash.geom imports. Matrix ; / / Flag to detect the mousedown Boolean = false ; md var: Boolean = false; / / Create a blackboard front Sprite = new Sprite ( ) ; var lvg1: Sprite = new Sprite (); . lineStyle ( 0 , 0xffffff ) ; lvg1. graphics. lineStyle (0, 0xffffff); . beginFill ( 0x666666 ) ; lvg1. graphics. beginFill (0x666666); . drawRect ( 0 , 0 , 199 , 199 ) ; lvg1. graphics. drawRect (0, 0, 199, 199); . endFill ( ) ; lvg1. graphics. endFill (); lvg1 ) ; addChild (lvg1); = lvg1 . y = 30 ; lvg1. lvg1 x =. y = 30; / / Create the board tilted Sprite = new Sprite ( ) ; var lvg2: Sprite = new Sprite (); . lineStyle ( 0 , 0xffffff ) ; lvg2. graphics. lineStyle (0, 0xffffff); . beginFill ( 0x666666 ) ; lvg2. graphics. beginFill (0x666666); . drawRect ( 0 , 0 , 199 , 199 ) ; lvg2. graphics. drawRect (0, 0, 199, 199); . endFill ( ) ; lvg2. graphics. endFill (); = 400 ; lvg2. x = 400; = lvg1 . y ; lvg2. y = lvg1. y; = 45 ; lvg2. rotation = 45; = lvg2 . scaleY = . 6 ; lvg2. scaleX = lvg2. scaleY =. 6; lvg2 ) ; addChild (lvg2); / / / / Paint event ( MouseEvent . MOUSE_DOWN , _onMouseDown ) ; lvg1. addEventListener ( MouseEvent . MOUSE_DOWN, _onMouseDown); ( MouseEvent . MOUSE_MOVE , _onMouseMove ) ; lvg1. addEventListener ( MouseEvent . MOUSE_MOVE, _onMouseMove); ( MouseEvent . MOUSE_UP , _onMouseUp ) ; lvg1. addEventListener ( MouseEvent . MOUSE_UP, _onMouseUp); / / e : MouseEvent ) : void { _onMouseDown function (e: MouseEvent ): void { "_onMouseDown" ) ; trace ("_onMouseDown"); : uint = 0xffffff ; var c: uint = 0xffffff; . graphics . lineStyle ( 10 , c , 1 ) ; and. target. graphics. lineStyle (10, c, 1); . lineStyle ( 10 , c , 1 ) ; lvg2. graphics. lineStyle (10, c, 1); . graphics . moveTo ( e . localX , e . localY ) ; and. target. graphics. moveTo (and. localX, and. localY); . moveTo ( e . localX , e . localY ) ; lvg2. graphics. moveTo (and. localX, and. localY); md = true; } / / e : MouseEvent ) : void { md = false ; } _onMouseUp function (e: MouseEvent ): void {md = false;} / / e : MouseEvent ) : void { _onMouseMove function (e: MouseEvent ): void { "_onMouseMove" ) ; trace ("_onMouseMove"); md ) { if (md) { . graphics . lineTo ( e . localX , e . localY ) ; and. target. graphics. lineTo (and. localX, and. localY); . lineTo ( e . localX , e . localY ) ; lvg2. graphics. lineTo (and. localX, and. localY); } } |
In this case, lines 22 through 25 show that even with simple rotation and displacement effect is repeated.
Continued ...
Playing around with the powerful and versatile object Matrix (matrix), linked to the changes, you can do bizarre things. These tools are used to apply special transformations to a visual object, such as a Sprite. You can, for example, scale, rotate, or twist (skew) a Sprite. e rotation ), per l'effetto Skew bisogna ricorrere direttamente alle matrici. While the first two functions (scale and rotation) Sprite objects (not just) make available directly to the properties ( scaleX / scaleY , and rotation ), the skew effect should appeal directly to the matrices. What I would like to emphasize here is that when we modify a graphic object all its internal coordinates are moved:
Continued ...
Some, quite rightly, argue about the Adobe AIR, Adobe Integrated Runtime (formerly Apollo) offered by Adobe. What are we talking about? After all AIR is still a beta ( the latest release is 12/12/2007 - Beta 3 ) and its success, we'll see whether including or not depends on many factors.
Continued ...
I state it now: you do not win anything! Apart from pride - if anything - to have solved the problem.
QUEST - APPLICATION
How to create a tool to erase, delete, clear, a "portion" of the graphics API designed with Actionscript 3.0?
, espongono la proprietà graphics , un puntatore ad un altro oggetto che “serve” tutte le funzioni grafiche di disegno runtime. With Actionscript 3.0 Some visual objects, such as MovieClip or Shape , exhibit the property graphics , a pointer to another object that "serves" all graphic design runtime functions. For example, you can develop a simple drawing application. , in modo semplice e rapido. This object graphics can draw whatever you want, for example, an object of Shape , easily and quickly. The problem is that once something is drawn can clean out all but a single part.
Draw a line is easy:
1 2 3 4 5 6
| Shape = new Shape ( ) ; var myShape: Shape = new Shape (); myShape ) ; addChild (myShape); / / . lineStyle ( 2 , 0xff0000 , 1 ) ; myShape. graphics. lineStyle (2, 0xFF0000, 1); . moveTo ( 0 , 0 ) ; myShape. graphics. moveTo (0, 0); . lineTo ( 100 , 100 ) ; myShape. graphics. lineTo (100, 100); |
Drawn something you can clean everything with the simple call to clear() :
1
| . clear ( ) ; myShape. graphics. clear (); |
But if I want to "delete" only one point? Or coordinates from 50.50 to 100.100?
Searching the Internet I found several examples of "design applications" and, in fact, offers no support or tool "delete".
Do you have any solution?
Continued ...
Yahoo! has just released ASTRA , a suite of components for Adobe Flash and Flex . I must say that, at least for the components for Flash, I had half a disappointment (if not total). Most interesting, perhaps, is the TabBar ... the rest leaves much to be desired. They look for some components developed their project - internal - and now released as open product! Perhaps, at Yahoo!, we are already aligned to the policies ... Microsoft saw that today the software company founded by Bill has offered 44.6 billion dollars to buy Yahoo!! 44.6 billion, I have not misspelled!
But take a trip on the website where you can find several useful resources. We trust in the near future.
Continued ...
. Again in the "uniform", as happened with the events (see the new event handling of Flash CS3 and Flash CS3: The new event management ), one of the many new features in ActionScript 3.0 is the disappearance of all those ad hoc methods dedicated to the creation of special items, such as: createEmptyMovieClip() or the famous attachMovie() . With Actionscript 3.0 the operator new is sufficient to perform all the operations building. A new MovieClip, for example, is created (runtime) with the following code:
But let's go! If I want a symbol in the library and add it as a runtime happens if attachMovie() is gone? The solution is not very dissimilar from what happened in Actionscript 2.0. First you need to go into the library, select the symbol and open the Properties window. At this point, check the Export for ActionScript box chaining - as they did in Flash 8. A symbol library as a base class has always flash.display.MovieClip , but this does not interest us much. The interesting thing, however, is the parameter class that is set by default (when you check Export for ActionScript) with the symbol name. What is important to emphasize is that this is a new mode of Flash CS3 (and ActionScript 3.0). The symbol to be exported must have a Class reference. The curiosity is that we are not necessarily forced to create our own class (extended from flash.display.MovieClip ), even if we could do it.
Continued ...
I noticed often confusion when it comes to classes, objects and instances. Those who are not very educated on the object-oriented programming often confuses the true meaning of these terms. I knew, however, that there are two schools of thought regarding the definition of classes and objects. I like the "school" that indicates the class definition as a possible subject, and therefore, as an instance of the object.
It seems trivial, but I've - talking with others - to be in "conflict" (so to speak) and then fall into confusion, when using these terms, starting from the assumption that if anything the "other" just as we intend them .
I see it in this way, a class is a definition! It is precisely defines a class of possible objects. The class is the set of methods and properties (if you want we can also add events - what else ... not only that special methods) that will own the object.
For example, when we write in Actionscript, or any other object-oriented language:
1 2 3 4
| class MyClass { MiaClass function () {} function myMethod () {} } |
We have defined a class and not an object. In the limit we have "defined" a "possible" object. We could even argue, and rightly so, that the object exists at runtime while the Class not (in truth there are dynamic classes that can be defined - and then used to create objects - even at runtime). Exclude static classes, of course, that - eventually - are nothing more than sub-instances (or instances hidden) and then real objects.
But when we have:
1
| MiaClasse = new MiaClasse ( ) ; var MyObject: MyClass = new MyClass (); |
! Here mioOggetto is an instance of MiaClasse() ! . That mioOggetto is a subject - in fact - of type MiaClasse() .
. As a result, their philosophy to objects, objects of type MiaClasse() I can have as many as I want, which can not be - the very definition - of MiaClasse() . For example, if the report is true and it makes sense:
1 2 3 4 5
| MiaClasse = new MiaClasse ( ) ; var mioOggetto_1: MyClass = new MyClass (); MiaClasse = new MiaClasse ( ) ; var mioOggetto_2: MyClass = new MyClass (); MiaClasse = new MiaClasse ( ) ; var mioOggetto_3: MyClass = new MyClass (); ... MiaClasse = new MiaClasse ( ) ; var mioOggetto_n: MyClass = new MyClass (); |
It makes no sense:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| class MyClass { MiaClass function () {} MioMetodo_2 function () {} }
class MyClass { MiaClass function () {} MioMetodo_2 function () {} }
class MyClass { MiaClass function () {} MioMetodo_3 function () {} } |
Object Instance and, therefore, coincide and are used alternately for the same meaning in different contexts.
Probably not much anyone cares ... the question of completeness of requirements ... 
Continued ...
I had already spoken in Flash CS3: The new event handling . I'll be back on the issue sublists for the difference of this new approach compared to previous versions of ActionScript. Schematically we have a general situation of this type:

Any object that supports events, ultimately exposing itself the addEventListener (). In the documentation, among other things, we read:
What's new for event listeners in ActionScript 3.0
[...] To add event listeners in ActionScript 2.0 is sometimes uses addListener () and sometimes addEventListener (), whereas in ActionScript 3.0 using addEventListener () in all situations.
[..]
Event management, then, is standardized at the level of real listeners. All the "features" of listening, in fact, have the following structure:
1 2 3
| eventObject : EventType ) : void { eventResponse function (eventObject: EventType,): void { / / The actions in response to the events are defined here. } |
o una sua sottoclasse. EvenType is always an object of class Event or a subclass. . This allows for more informations specific to the particular event in addition to handling standard properties such as target or currentTarget .
An important difference with previous versions of ActionScript, with respect to the listener, is that:
In ActionScript 2.0, event listeners can be either functions, methods or objects, whereas in ActionScript 3.0, event listeners can be only functions or methods.
In short, having used for some 'time to event structure from earlier versions of Flash, I must say that this new approach is really nice. It's a bit 'that development with Actionscript 3.0 and, after a small initial loss (just to regain what was taken for granted) now I can not understand how could I bear the "old" method of the events of the previous versions.
Continued ...
Google has APIs - Javascript - to put its maps in any web site . vied how to accomplish the same thing with Flash!
We start from a free component, UMAP (Universal ActionScript 3.0 Mapping API - Integrated with Google Maps), developed by AFComponents , a vertically organized companies of components for Flash / Flex really interesting and affordable. On the site, where you need to register to take advantage of free downloads, there are also versions of UMAP for ActionScript 2.0: MAP G Ver.2.6.1 . In this case we will analyze the version 0.4 Beta UMAP for ActionScript 3.0 (inside the package there is also a Flex component). That we're going to see is - obviously - a beta version and lacks, therefore, some features in version for Actionscript 2.0 ( G Ver.2.6.1 MAP ). However, watchman at the future, it seems more interesting to focus attention on this release, I tried both and, despite the release of more complete for Actionscript 2.0, Actionscript 3.0 beta version is considerably more powerful.
Continued ...
Santa Dear Adobe,
although it has already received two patches for Flash CS3 (version 9.0.2), some troubles in its use have appeared as all the software in the world, especially in this release that has undergone very many changes.
- The 'ActionScript editor, for example, is slow and jerky! Consider, dear Father Adobe, my car has 8Gbyte of RAM and an Intel quad core duo!
- During the automatic formatting, lines of code like this one below, are "misunderstood" and reformatted evil:
1
| ( MouseEvent . CLICK , function ( e ) { myfunc ( ) ; } ) ; mybtn. addEventListener ( MouseEvent . CLICK, function (e) {myfunc ();}); |
Adding braces where it should be:
1 2
| ( MouseEvent . CLICK , function ( e ) { myfunc ( ) ; } ) ; mybtn. addEventListener ( MouseEvent . CLICK, function (e) {myfunc ();}); // < -- chi te l'ha detto?! } / / <- Who told you?! |
So better use the syntax:
- The windows docket, at least in the implementation of Windows Vista, every now and then disappear under other panels ... The Help window, the guidance in short, creates a problem when you try a project. The latter, in fact, disappears behind the other panels ... mystery! However, this defect, like others, is not always reproducible.
- The components have strange behavior: sometimes are shown, in design-time, as white rectangles ... while continuing to operate at runtime!

- The 'anterprima scale9Grid, as indicated in the new documentation and be able to show the objects correctly resized at design-time, continues to be plagued by the same problems as the previous version! Too bad!

However, Christmas is all better ... so dear Santa Adobe, we look forward to future updates.
Continued ...
Latest Comments
Robert : I rispsoto your questions with pleasure. The idea is really great. I am looking for a solution ...
Sting : @ Darius - you can see an example here: http://www.fight4fun.it/ clicking on: MAPS I hope ...
vik : Giustappunto I'm working on a project and the client asked me to show all the news (which are CPT) in ...
Giovambattista Fazioli : @ paso: absolutely. Simply identifying the field [cci] input [/ cci] you want to ...
paso : Hello I would like to request a service, you can use the datepicker with cform7 I spiegp best I can implement ...