September 14th, 2010 by Kyle
Tags: , , ,
Posted in: Flex


I was looking for a quick and simple UI device to tie to my application state (or current component) in Flex 4 so that I could easily change states. I was just building a prototype app, so no need to be fancy. Here is a simple mx:togglebuttonbar solution:

  1.  
  2.  
  3. <s:states>
  4.     <s:State name="default"/>
  5.     <s:State name="admin"/>
  6. </s:states>
  7.  
  8. <mx:ToggleButtonBar dataProvider="{this.states}"
  9.     itemClick="this.currentState=event.label" labelField="name"/>
  10.  
  11.  



No Comments »

September 10th, 2010 by Kyle
Tags: , , , ,
Posted in: ActionScript, Flex


You can’t add event listeners to an object that is returned from a method and expect to receive the events that are dispatched within the same method that returns the object to which you are adding event listeners.

This on is perhaps not so obviously stated, but can be made more clear via some code (hopefully):

  1.  
  2.  
  3. myObject:MyObject = new Object(fooParam);
  4. myObject.addEventListener("myEventType", myCallBackFunction);
  5.  
  6. //where MyObject Class looks like this:
  7.  
  8. public class MyObject extends EventDispatcher
  9.         {
  10.                 // constructor
  11.                 public function MyObject (fooParam:String, target:IEventDispatcher=null)
  12.                 {
  13.                         super(target);
  14.                         // do some stuff and then dispatch event
  15.                         dispatchEvent(new MyEvent(MyEvent.MY_EVENT_TYPE));
  16.                 }
  17.  

This just won’t work.

Better to do something like:

  1.  
  2.  
  3. myObject:MyObject = new Object();
  4. myObject.addEventListener("myEventType", myCallBackFunction);
  5. myObject.doStuff(fooParam);
  6.  
  7. //where MyObject Class looks like this:
  8.  
  9. public class MyObject extends EventDispatcher
  10.         {
  11.                 // constructor
  12.                 public function MyObject (target:IEventDispatcher=null)
  13.                 {
  14.                         super(target);
  15.                  }
  16.  
  17.                public function doStuff(fooParam:String):void {
  18.                         // do some stuff and then dispatch event
  19.                         dispatchEvent(new MyEvent(MyEvent.MY_EVENT_TYPE));
  20.                }
  21.  

That should work and not cause you to chase your tail trying to figure out why things are not getting dispatched or not being responded to by an eventListener
:)




2 Comments »

September 8th, 2010 by Kyle
Tags: , , , ,
Posted in: ActionScript, Flex


As a result of being back in the “land of the coding” (see post: http://blog.flexmonkeypatches.com/2010/09/08/back-in-the-land-of-the-coding/), I should begin easily to accumulate content for blog posts. Case in point last week, when I spun my wheels for what was longer than I should have, over dumb assumptions or misconceptions or misrememberings regarding some aspect of Flex/Flash/AS3. I thought I would start a new series of posts meant to capture such dumb assumptions as a reminder to myself ad hopefully as a cache of useful tidbits that others can come across when they are struggling with things that just aren’t working as they thought they should. Here are my first 2 entires in this the inaugural “Note to Self”:

AS3 Event Bubbling is only for objects on the display list!!

There may be reference to this in the docs and if I run across it, I will amend this post to include it. Now it would be nice if you could bubble events up the inheritance hierarchy or from one instance up to the class instance that contains the instance dispatching the event (and so on and so forth), but you can’t. There may be ways of doing this in a more clean manner, but really the underlying mechanism is really through a series of eventListeners that you must attach up through the hierarchy of object through which you want the events to pass. Don’t forget to implement the clone method of any custom events you are dispatching, otherwise you will run into trouble. Just implement clone and you can easily redispatch the event from within the listening function that receives the event.




2 Comments »

December 9th, 2009 by Kyle Posted in: Flash Player, Flex


Here are some tips on troubleshooting from the client side, data request issues via network calls that may be failing for you:

In main the flex application add the TraceTarget component which will log client side networking calls (in and out) to the flashlog.txt

Basically just add this to your flex app anywhere in the main mxml page:

Then when you run the flex app, if you are running in the debug Flash Player (which you can check here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507), you will generate info in the flashlog.txt (which on windows should be located here: C:\Documents and Settings\{username}\Application Data\Macromedia\Flash Player\Logs\)

If you don’t have the debug Flash Player you can get it from here:
http://www.adobe.com/support/flashplayer/downloads.html

(Note you can upgrade to a higher version# of the flash player, but if you are trying to install debug player with the same version number over top of the release player, that won’t work. You’ll have to uninstall the Flash Player first. The uninstaller can be found here:
http://kb2.adobe.com/cps/141/tn_14157.html)

More info on flashlog.txt:
http://livedocs.adobe.com/flex/3/html/logging_04.html
(including where to find the flashlog.txt on other platforms.)
More info on TraceTarget:
http://livedocs.adobe.com/flex/3/html/logging_09.html




No Comments »

February 25th, 2009 by Kyle
Tags: , ,
Posted in: Flex, Flex Builder


I am not sure if this is common knowledge. I googled and didn’t find any other reference to it. (At least not in 10 minutes of googling.)

I wasn’t sure this was possible, but then I decided to look in the Flex bugbase. This is what I found:

https://bugs.adobe.com/jira/browse/SDK-5308

Whaddaya know? An enhancement request that I logged that had actually addressed this issue back in the Flex 2.x days.

Basically if you change the extension of a swc to .zip, you can open the archive with winzip (or similar) and look at the top of the catalog.xml file. You should see something like this:

  1.  
  2. <?xml version="1.0" encoding ="utf-8"?>
  3. <swc xmlns="http://www.adobe.com/flash/swccatalog/9">
  4.   <versions>
  5.     <swc version="1.2" />
  6.     <flex version="3.2.0" build="3958" />
  7.   </versions>
  8.  

Hopefully this will help some folks out.

Incidentally such a thing does not exist for compiled swfs. There is an enhancement request:
https://bugs.adobe.com/jira/browse/SDK-14042

If you think such a thing would be valuable, please vote for the bug.

And one more thing…I actually had an AIR app back in the pre-release of AIR 1.0 days:
http://blog.flexmonkeypatches.com/2007/11/12/flex-sdk-fds-lcds-version-detection-adobe-air-application/

You could point it at a fds/lcds war or sdk directory and it would tell you the version (of LCDS and the SDK).
Maybe this should be resurrected and updated to AIR 1.5.1 and to use this new version info (at least new since I built the original AIR app). It could also be enhanced to read version info from individual swcs as well. Oh and maybe allow users to drag and drop directories, or wars or swcs onto the app to read the info. Hmmm….if only I had the time.




3 Comments »

January 20th, 2009 by Kyle
Tags: , ,
Posted in: Flex


I was looking into how one might implement zooming in on an item in a Tilelist or zooming out to view more of the items in a Tilelist and stumbled upon a “poor man’s solution”. Implementing true zooming with gradual easing in/out would be much more involved and take you into the depths of Listbase (and probably into private methods, etc).
This is based on code from one of my previous blog posts:

TileList with popup that deletes from dataProvider

Here is the sample and code that demonstrates the approach one might take:

This movie requires Flash Player 8

Download a zipfile containing the source to this sample.

Browse the source of this example.

Or continue into the blog entry to see the source:
Read the rest of this post»




4 Comments »

November 19th, 2008 by Kyle
Tags: , , , , ,
Posted in: Air, BlazeDS, Flex, Flex Builder, LCDS


OK…so I guess I kind of passed over these yesterday in my announcements. To me, the fact that there would be new releases timed with MAX was known and to anyone in the community there was probably a strong suspicion that there would at least be a new point release at MAX 2008. But in an effort to correct my oversight, here are links to the announcements by the product managers:

Matt Chotin (PM for Flex SDK) announces Flex Builder 3.0.2 and Flex SDK 3.2 (with support for AIR 1.5 and Flash Player 10).

Anil Channappa (PM for LCDS and BlazeDS) announces LCDS 2.6.1 and BlazeDS 3.2.




1 Comment »

November 17th, 2008 by Kyle
Tags: , , , , ,
Posted in: Flex


There were lots of exciting new things at Adobe MAX 2008 today, plus a lot of new stuff landed on Adobe LABs. Here are the things I think are cool and showcase the innovation of the people at Adobe:

http://labs.adobe.com/technologies/alchemy/

Alchemy is a research project that allows users to compile C and C++ code that is targeted to run on the open source ActionScript Virtual Machine (AVM2). The purpose of this preview is to assess the level of community interest in reusing existing C and C++ libraries in Web applications that run on Adobe® Flash® Player and Adobe AIR®.

http://labs.adobe.com/technologies/flashcatalyst/(formerly Thermo)

“Adobe® Flash® Catalyst is a new professional interaction design tool for rapidly creating application interfaces and interactive content without coding. These can range from interactive Ads, product guides and design portfolios to user interfaces for applications. Flash Catalyst enables designers to start from static compositions created in Adobe Photoshop® CS4, Illustrator® CS4, or Adobe Fireworks® CS4 and convert the artwork into applications and interactive content. The designer does this by visually defining events, transitions and motion. Flash Catalyst can output a finished Flash SWF or AIR application that’s ready to publish on the web. In addition designers can provide the project file to developers who can use Adobe Flex® Builder™ to add additional functionality such as connection to back-end systems.”

http://labs.adobe.com/technologies/cocomo/

Codename “Cocomo” is a Platform as a Service that allows Flex developers to easily add real-time social capabilities into their RIA (rich Internet applications). Comprised of both Flex-based client components and a hosted services infrastructure, Cocomo allows you to build real-time, multi-user applications with Flex in less time than ever before. And because Acrobat.com hosts the service, issues like deployment, maintenance, and scalability are taken care of for you.

Add social features to your existing Flex apps or build totally new ones, such as real-time productivity/collaboration apps, multiplayer games, and audio/video chat.

http://labs.adobe.com/wiki/index.php/Genesis

Genesis is the code-name for a new product initiative at Adobe with the objective of joining business applications, documents and the web on every knowledge workers desktop with integrated collaboration capabilities. Using the very intuitive interface of the Genesis desktop client (built on Adobe AIR) knowledge workers are able to create custom workspaces combining views into business applications, analytics, web sites and documents. Workspaces can be easily and securely shared with other colleagues or business partners outside the company and provide out-of-the-box real time collaboration capabilities like instant messaging, voice and video as well as screen sharing and white boarding.

http://labs.adobe.com/wiki/index.php/Adobe_Wave

Adobe® Wave™ is an Adobe AIR application and Adobe hosted service that work together to enable desktop notifications. It helps publishers stay connected to your customers and lets users avoid the email clutter of dozens of newsletters and social network update messages. Adobe Wave is a single web service call that lets publishers reach users directly on their desktop: there’s no need to make them download a custom application or build it yourself. The Adobe Wave pre-release program is geared towards developers, so if you’re a user who wants to try it out, click here to send us an email. We’ll let you know when Adobe Wave is available for you to try!

http://labs.adobe.com/wiki/index.php/Stratus

Flash Player 10 and Adobe AIR 1.5 introduce a new communications protocol called the Real-Time Media Flow Protocol (RTMFP). The most important features of RTMFP include low latency, end-to-end peering capability, security and scalability. These properties make RTMFP especially well suited for developing real-time collaboration applications by not only providing superior user experience but also reducing cost for operators.

In order to use RTMFP, Flash Player endpoints must connect to an RTMFP-capable server, such as the Adobe Stratus service. Stratus is a Beta hosted rendezvous service that aids establishing communications between Flash Player endpoints. Unlike Flash Media Server, Stratus does not support media relay, shared objects, scripting, etc. So by using Stratus, you can only develop applications where Flash Player endpoints are directly communicating with each other.




2 Comments »

November 17th, 2008 by Kyle
Tags: , , ,
Posted in: Flex


I pointed one of my customers at this app last week. I had no idea it would be all the rage at MAX :)

http://flex.org/tour

“Tour de Flex is a desktop application for exploring Flex capabilities and resources, including the core Flex components, Adobe AIR and data integration, as well as a variety of third-party components, effects, skins, and more.”

I have posted an install badge in my sidebar (below my paypal badge)…check it out.




1 Comment »

November 17th, 2008 by Kyle
Tags: , , ,
Posted in: Flex


Two things really excite me that there will be more info on at MAX NA, 2008.

Cocomo and Genesis.

Cocomo is now on Adobe Labs: http://labs.adobe.com/technologies/cocomo/

Do not miss these sessions:
Real-Time Collaboration Apps with Flex and Cocomo
Explore Cocomo, Adobe’s new Platform-as-a-Service for developing real-time, multiuser Flex applications. Learn how any Flex developer can use Adobe’s services infrastructure to build stunningly rich real-time social apps, including robust data messaging and streaming live video and VoIP. In this session we’ll be showing live coding with the Cocomo Flex SDK and Adobe’s services. Bring a laptop and be ready to join in.

Speakers: Nigel Pegg
Audience: IS/IT, Creative Designer, Business Decision Maker, Architect, Application Developer
Skill: Intermediate
Products: Flex Builder, Flex, Flash Player, Flash Media Server, Connect, AIR, ActionScript, Acrobat
When: Monday, November 17, 3:30 pm – 4:30 pm, Moscone West 2007

Cocomo Deep Dive: Building Social RIAs with Flex + Adobe Hosted Services
Learn to build your first multiuser Adobe AIR application using the new Cocomo Flex SDK. In this session, we’ll walk you through the philosophy and design considerations of this new breed of application, all the way to the nuts and bolts of coding, debugging, and deploying it. Follow along as a real-time collaborative AIR app is built from scratch and deployed on stage. There will be code — bring a laptop!

Speakers: Nigel Pegg
Audience: IS/IT, Creative Designer, Business Decision Maker, Architect, Application Developer
Skill: Intermediate
Products: Flex Builder, Flex, Flash Player, Flash Media Server, Connect, AIR, ActionScript, Acrobat
When: Wednesday, November 19, 3:30 pm – 4:30 pm, Moscone West 2003

The Genesis Blog is here: http://blogs.adobe.com/mashup/

Don’t miss this session either:

Genesis: A Collaborative Mashup Client for Business Users
Learn how Genesis enables knowledge workers to combine web applications, enterprise apps, and documents within one workspace on their desktop and provides sharing as well as real-time collaboration. Genesis is a code name for a new Adobe product in development that includes a desktop client based on Adobe AIR and Flex as well as hosted collaboration services that leverage Adobe Acrobat Connect via Cocomo. We’ll discuss business use cases for Genesis and demonstrate features and functionality. For Flex developers, we’ll explain the architecture and opportunities to create Flex widgets that can be distributed via the Genesis catalog.

Speakers: Mattias Zeller, Steve Yankovich
Audience: Partner Decision Maker, IS/IT, Business Decision Maker, Architect
Skill: General Audience
Products: Flex
When:
Monday, November 17, 2:00 pm – 3:00 pm, Moscone West 2014




No Comments »

« Previous Entries