Filed under: AIR, Flex | Tags: dragmanager bug, flex 3 bug, flex bug, flex module, jira adobe, jira flex, module flex bug, modules
In my last RIA project based on Flex 3, I find a bug working with modules that I’d like to sharing in this blog.
I create a dashboard where 4 custom components, that extend Panel component, load in a ModuleLoader differents sections.
In those sections there are components based on List component and when I run my project I’ve this kind of error:
TypeError: Error #1034: Type Coercion failed: cannot convert mx.managers::DragManagerImpl@21ef6df9 to mx.managers.IDragManager.
Surfing on web I don’t find anything about this kind of problem, finally on JIRA Adobe Flex bugs, I find it!
You can find workaround on JIRA ticket, it’s so easy to solve it, you only create a new instance of DragManager in your Default Application and everything works well.
This bug is created because you have more instance of DragManager in this sample, but DragManager in Flex framework is used like a Singleton so only one instance per time.
Each module has a List component that use DragManager when you have in the same application 2 or more modules you must put in Default Application file a DragManager instance and that’s it!
I think could be useful for anybody in the same situation.
Filed under: AIR, flash catalyst | Tags: adobe air, AIR, Arrivano i guru, flash catalyst, Flash Catalyst Public Beta, Flash Catalyst session
Next week in Rome, starts a new Italian event called Arrivano i guru, where 6 speakers from designers to developers, talking about Adobe technologies and others arguments.
I’ll be speaker there and I choose to talk about Adobe AIR and Flash Catalyst Public Beta, because I think could be so interesting for people that comes to this event understand how to approach this new world and start to work with those technologies.
In fact I think in Italy there are few companies that approach AIR to create real desktop application and an overview about Flash Catalyst give me opportunity to introduce a new way to skinning your RIA or desktop applications and how to save lots of times in a real workflow.
In the same event you can find others session about Digital Imaging, Advanced technique with Indesign or Photoshop and SEO also.
I think could be very interesting for a lots of Italian people, so feel free to leave a comment here if you’d like to receive more information about this event.
For more information or registration take a look at official site event.
See you there guys.
Filed under: AIR, Adobe, Flash Builder, flash catalyst | Tags: adobe beta, Flash Builder, flash catalyst, Flex, flex 4, flex 4 framework, Gumbo, Gumbonents, labs.adobe.com
Finally is OUT! New Flash Builder version is out in labs.adobe.com
I spent all the evening to try new features, so I think that could be useful talking about that in my blog.
The new features that I like so much are:
- States / Library / Modules: States are totally changed in a new version that make easier write in MXML, I love so much includeIn and excludeFrom attribute to decide in which state you can put or remove a particular component.
If you want you can work also with group and add in the same group N states.
Library is a new object that works like Flash library, so you can create a Definition (like a Symbol) and reuse it during your application, make attention because you are working with Element and not Child!
States and Library increase a lots application KB so I prefer work with Modules that load in runtime mode. They have a new particular argument when you try to load it that is ByteArray (more information on Migration Guide on labs). - Automatic getter / setter / event handler: YESSS! I switch to FDT in last month because I increase my productivity to write AS3 code, now with Flash Builder you’ve a couple of actions to create getter, setter and event handler, that’s so cool!
- New Drawing API: we have a lots of new interesting MXML tag to define a shape like a square or a rectangle, but the most interesting is Paths that allow you to create particular lines and shape with bezier curve via code
- Advanced CSS selectors: another interesting feature is the new way to refer a component via CSS, in fact you can interact with MXML structure (all buttons in an hbox must be red and all buttons in a vbox must be black).
Very easy and cool! - Flex Theme: that’s one of my favorite features, in fact with Flash Builder you can create custom Flex Theme and skin your application in a second! You can find more information about Theme in Ted Patrick blog.
- DateGroup: Instead of using Repeater to repeat a particular object, now we have DataGroup that defines a dataprovider and how to render it via an ItemRender or an ItemRenderFunction.
- Switch a Flex project to AIR: finally if your client doesn’t know what he wants, you can swtich a Flex app into an AIR desktop application directly from context menu of Package Explorer (new name of Flex Navigator panel).
Remember to read Migration guide, it’s so interesting! Stay tuned for next Flash Builder and Catalyst tests!
Another great resource that is now live to see Flex 4 features is Tour de Flex that you can view directly from Adobe web site.
Bye bye
Filed under: AIR, Flash, Flash Builder, Flex, flash catalyst | Tags: AIR evangelist, FB, FC, Flash Builder, flash catalyst, Flex, From A to Web, Gumbo, modules, mxml, Serge Jepsers, states
Yesterday I was in Milan at From A to Web and I saw Serge Jespers session about RIA workflow with Flash Catalyst and Flash Builder.
In 30 minutes he made a real Flex application that interact with Coldfusion to retrieve data from a database and he started from a normal and static AI file… that’s totally AMAZING!
Flash Catalyst will be a great software that will help us to create desktop applications and rich internet application, in particular could be very interesting to create animations and user interaction on own GUI.
When Serge showed Flash Builder he interacted with a CF script (you can work with WS, XML and other back end tecnologies also) trough a panel and in few steps he was connected to data source… COOL!
I’m so excited, Flash Catalyst will change RIA and desktop apps workflow definitely! I’m sure about that… BUT…
I’d like to investigate more about Flash Catalyst when Adobe decides to release public BETA on Labs, but I asked a couple of questions to Serge during his session to understand better the power of this new software.
For me the first problem is that FC doesn’t work with Flex Modules but only with States and in big projects it could be a problem.
Yes, you can copy MXML code and paste on a Module, but it could be more easy to choose if you want to work with states or modules or better, export your GUI like module and not only custom component.
Another thing that I’m scared is that FC is very easy to use, open new way of business and make your daily work more fast, so designers and developers that approach for first time RIA and Desktop apps could start to release tons and tons of “bad apps” like Flash in 90s… I hope that Adobe will teach around the world with free training courses, not only with one day events, or will begin a new HORROR ERA for RIA and Desktop apps.
That’s my 2 cents, if you’d like to talk about FC on this blog, feel free to leave a comment.
Filed under: AIR, Adobe, Events, Flex | Tags: Adobe and Python, PyCon, PyCon 3, Python, Python Adobe AIR, Python AIR, Python event, Python flex
Here we are! My first conference of the year is PyCon 3 in Florence from 8th to 10th May.
This is THE PYTHON conference in Italy, there will be very cool and strong developers of the Python world from all over the world.
In this edition I propose a session about Python, Flex and AIR on how to integrate those technologies all together.
I think could be very interesting for Pyhton developers approach this RIA world and find a new way to create an amazing GUI with Flex and AIR.
It will be my first time there and I start to study Python only on January, so I’m very happy to take part on this event.
If you’d like to come, please feel free to tell me and add a comment on this post!
See you there guys.
UPDATE
I make a post about PyCon 3, in few days I’ll put conference photos on my Flickr account, stay tuned!
Filed under: AIR, Flash, Flex, Resource, Tips & Tricks | Tags: Adobe, AIR, create pdf with air, create pdf with flash, Flash, Flash CS4, Flex, Multidmedia Zinc, pdf actionscript, Zinc, Zinc 3, zinc samples, zinc tutorial
This morning I’ve a new target, create PDF in runtime with Actionscript 3.
Very cool project to accomplished this mission is AlivePDF, an opensource AS3 library that you can download from Google Code.
AlivePDF allow you to generate PDF in runtime with Actionscript 3 and you can add pages, draw in each pages or add images, it’s very powerful library.
In this sample I use Actionscript 3 (with FDT) and Multidmedia Zinc 3, but you can use Flex or Flash and AIR to make this sample.
So first of all I create a simple class that allow you to create a PDF file with multiple pages and to add content in each pages.
This is the code:
package org.mart3.pdfGeneration { import flash.events.Event; import flash.utils.ByteArray; import org.alivepdf.images.ImageFormat; import org.alivepdf.saving.Method; import flash.display.Loader; import flash.events.IEventDispatcher; import flash.events.EventDispatcher; import org.alivepdf.pdf.PDF; import org.alivepdf.layout.Orientation; import org.alivepdf.layout.Size; import org.alivepdf.layout.Unit; import org.alivepdf.display.Display; /** * @author lm */ public class CreatePDF extends EventDispatcher { private var pdf:PDF; public var pdfBA:ByteArray; public function CreatePDF(target : IEventDispatcher = null) { super(target); pdf = new PDF(Orientation.LANDSCAPE, Unit.MM, Size.A4); pdf.setDisplayMode(Display.FULL_PAGE); } public function set totalPages(num:int):void{ for(var i:int = 0; i < num; i++){ pdf.addPage(); } } public function setData(_l : Loader, _numPage:int) : void { pdf.gotoPage(_numPage); pdf.addImage(_l, 15, 15, 0, 0, ImageFormat.JPG, 100); } public function savePDF():void{ pdfBA = new ByteArray(); pdfBA = pdf.save(Method.LOCAL); var evt : Event = new Event("baReadyEvent"); dispatchEvent(evt); } } }
Obviously if you want, you can create a custom event that pass to the document class the ByteArray but this is a quick sample to show how you can create PDF in runtime!
One of the amazing things that you should do with AlivePDF, it’s that you can decide to save PDF locally or on web! Read documentation because it’s very interesting what you can do with this library!
Ok now, go to document class where we use MDM swc that you can find when install Zinc on your computer (you can find 2 differents SWC, one for Flash and the other one for Flex. Remeber also that Flash SWC works with Flash CS4 also, not only with Flash CS3!).
In this class we do those simple steps:
- create a PDF object using CreatePDF object
- set our PDF document
- pass an external image loaded with Loader object
- save PDF bytearray with Zinc FileSystem class
package org.mart3.pdfGeneration { import flash.display.MovieClip; import flash.net.URLRequest; import flash.display.Loader; import flash.display.Sprite; import flash.events.Event; import flash.events.MouseEvent; import mdm.*; import org.mart3.pdfGeneration.*; /** * @author lm */ public class Main extends Sprite { private var pdfObj:CreatePDF; private var l : Loader; public function Main() { mdm.Application.init(this); pdfObj = new CreatePDF(); pdfObj.totalPages = 2; pdfObj.addEventListener("baReadyEvent", saveLocalPDF); l = new Loader(); l.name = "myImg"; l.contentLoaderInfo.addEventListener(Event.COMPLETE, showImage); l.load(new URLRequest(mdm.Application.path+"assets/bg.jpg")); } private function saveLocalPDF(e:Event) : void { mdm.FileSystem.BinaryFile.setDataBA(pdfObj.pdfBA); mdm.FileSystem.BinaryFile.writeDataBA(mdm.System.Paths.desktop+"generate.pdf"); } private function showImage(event : Event) : void { l.scaleX = l.scaleY = .4; var mc : MovieClip = new MovieClip(); mc.buttonMode = true; mc.addEventListener(MouseEvent.CLICK, savePDF); mc.addChild(l); this.addChild(mc); } private function savePDF(event : MouseEvent) : void { event.currentTarget.alpha = .5; pdfObj.setData(l, 1); pdfObj.savePDF(); } } }
You can also download source files and test it on your computer.
Feel free to give me any comments about AlivePDF, it’s very interesting to know what you think about this AS3 library
Filed under: Adobe, Events, Flash Lite, Mobile, Resource | Tags: 3gsm, 3gsm world congress, Adobe, adobe event, Flash Lite, Flash Lite 3, flash lite 3.1, flash lite application, m.art3, Mutado
Here we are!
Yesterday I came back from Barcelona (what a wonderful city!), I was there for 3GSM World Congress invited from Adobe to show our latest Flash Lite contents made in collaboration with Mutado, an Italian creative and interactive company.
It was amazing for us and I’d like to thank you Adobe people to give us this opportunity, thank you guys!
Adobe stand was amazing I love it so much and also Adobe announced lots of new stuff from new Flash Lite player delivery to new challenge that allow developers to win $30.000!
Flash Lite challengers is a contest that will finish at the end of May and we’ll know winners in the middle of June.
Main prize is $30.000 for the best Flash Lite application, but there are also categories prizes from games to applications, it’s a great opportunity to show your mobile content and win!
More information about this challenge on Adobe site
Another great news is that now, we have a new way to distribute our Flash Lite contents, in fact if a device goes trough a Flash Lite content on the web browser or download a Flash Lite application, if this device doesn’t have installed Flash Lite 3.1, it will be downloaded from web and installed on the device.
More information about this new way to deliver your content on Labs site.
Also Adobe and Nokia give us a new opportunity to invest in mobile projects with Open Screen Project fund ($10 million), in fact this fund is created to help companies and developers to join in mobile Flash world!
More information about it in open screen project site.
Finally I put a review on mobile.actionscript.it about new Flash Lite devices like Palm Pre or Nokia N97, so feel free to comment it (and take a look about our new mobile website).
If you want to see a quick tour about 3GSM feel free to take a look on my Flickr account.
Filed under: Adobe, Events, Flash Lite | Tags: 3gsm, 3gsm world congress, Adobe, Flash Lite, kddi, nokia, samsung, sony ericsson
Hi All,
it’s long time that I don’t write down a post.
In last months I changed lots of things, new fellows, new tutorials, new customers and big projects to develop with AIR and Flex.
So lots of things to do!
This year I’ll be at 3GSM World Congress for the second time, so if you will be there, please feel free to tell me, maybe you can drop me an email or add a comment under this post!
I’ll arrive at 15th and I’ll come back 20th February, so 5 amazing days in Barcelona.
If you don’t come, don’t worry I’ll post about this great event when I’ll be there and… there is a special surprise for anybody that follow this blog, so stay tuned and take a look at this blog in next few days.
Filed under: Flash | Tags: css flash, css in flash, html css flash, html in flash, styling textfield with css in flash
I know, it’s a very silly stuff, but I think could be useful for anybody that would like to styling textfields with CSS in few moments.
This little sample, show you how to make it via Actionscript 3 in Flash.
First of all we create CSS file called cssStyle.css with a custom color for the text:
.customBold{
color:#FF00CC;
}
Ok now, in the first frame of our Flash file we create a dynamic textfield with t_txt istance name and then we create another layer called “actionscript”. In the first keyframe of Actionscript layer we copy and past this code:
stop();
var loader:URLLoader = new URLLoader();
var req:URLRequest = new URLRequest(”cssStyle.css”);
loader.load(req);
loader.addEventListener(Event.COMPLETE, loaderCompleteHandler);
function loaderCompleteHandler(event:Event):void {
var sheet:StyleSheet = new StyleSheet();
sheet.parseCSS(loader.data);
t_txt.styleSheet = sheet;
t_txt.htmlText = “<span class=’customBold’>This is a silly text with CSS style</span> and without CSS!”;
}
So first of all we load the external CSS file with URLLoader class and when loaded complete we use StyleSheet object to parse CSS and to apply it in our textfield in the stage we only set stylesheet textfield property with StyleSheet object.
You can download sample files from this link





