adobe – DanDev.com http://www.dandev.com Tidbits about software development Sat, 26 Oct 2013 00:24:13 +0000 en-US hourly 1 Displaying the version number in Adobe AIR http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/ http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/#respond Wed, 12 Oct 2011 04:00:55 +0000 http://www.dandev.com/?p=220 In the Adobe AIR application descriptor file there are many options you can set. One of which is the tag(or in Flex SDK v4.1 and below), which lets you differentiate […]

The post Displaying the version number in Adobe AIR appeared first on DanDev.com.

]]>
In the Adobe AIR application descriptor file there are many options you can set. One of which is the tag(or in Flex SDK v4.1 and below), which lets you differentiate your release as well as utilize the Adobe AIR updater library.

It can be useful to display your version number inside of your app to inform the user as well as help with bug reports among other reasons. In order to prevent you from having to update the version number in multiple places you can use AS3 to grab it from the application descriptor and update your text for your app on the fly, as it loads. Here is an example of how to do that:


		

Flex Builder Project

The post Displaying the version number in Adobe AIR appeared first on DanDev.com.

]]> http://www.dandev.com/2011/10/displaying-the-version-number-in-adobe-air/feed/ 0 Add a click event to a BitmapImage in Adobe Flex/AIR http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/ http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/#respond Wed, 05 Oct 2011 04:00:29 +0000 http://www.dandev.com/?p=215 You may have noticed MouseEvent.Click is not an event available to be set on the BitmapImage Spark primitive(in the current Flex SDK). But, there is a simple workaround for this. […]

The post Add a click event to a BitmapImage in Adobe Flex/AIR appeared first on DanDev.com.

]]>
You may have noticed MouseEvent.Click is not an event available to be set on the BitmapImage Spark primitive(in the current Flex SDK). But, there is a simple workaround for this. All you have to do is place it inside of a Graphic primitive wrapper. In MXML it would look like this:



	
	
		
	
	
		
	
	
	
		
			
		
	
	

Flex Builder Project

In AS3 it looks like this:



	
	
		
	
	
		
	
	
	
	
	

Flex Builder Project

The post Add a click event to a BitmapImage in Adobe Flex/AIR appeared first on DanDev.com.

]]>
http://www.dandev.com/2011/10/add-a-click-event-to-a-bitmapimage-in-adobe-flexair/feed/ 0
Optimizing the SWF filesize for your Flex App http://www.dandev.com/2009/03/optimizing-the-swf-filesize-for-your-flex-app/ http://www.dandev.com/2009/03/optimizing-the-swf-filesize-for-your-flex-app/#comments Sun, 08 Mar 2009 14:32:20 +0000 http://www.dandev.com/?p=118 While wandering through the ginormous forest that is Flex I’ve noticed how the filesize grows exponentially when you start to add a lot of content, or some external libraries. This […]

The post Optimizing the SWF filesize for your Flex App appeared first on DanDev.com.

]]>
While wandering through the ginormous forest that is Flex I’ve noticed how the filesize grows exponentially when you start to add a lot of content, or some external libraries. This is annoying, especially when the app I’m making is supposed to be used by a large group of people at the company I work for. So, I went looking for ways to slim it down, and I have found a couple of gems that work really well. First of all there is an excellent video posted by Serge Jespers of the Adobe Platform Evangelism – European team that gives some detailed tips with an example of how to make your application smaller with Flex Builder.

Namely:

  1. Use “Release” build — by default the SWF is built with Debug mode and has debug & profiler code in it that your application doesn’t need.
  2. Move your panels into modules(see movie)
  3. Use the RSLs instead of compiling the Flex framework into your SWF

Using these suggestions has removed over 500K from my app.

The video shows you how to do all of these in Flex Builder.


Here is how you can perform the same optimizations in FlashDevelop:

Number 1 is fairly easy: Just find the only drop-down menu in the main interface, and change it from “Debug” to “Release”.

tip1

With number 2 you follow the same instructions, but you can get to the menu to add an item by right-clicking on your project in the “Project” pane of the right column, or by going to “File”->”New”.

tip2

Number 3 is slightly more complicated. First you need to get to your project’s properties menu, which you can do one of several ways. Here is a screenshot of going through the “Project” menu:

tip3-1

Then, click on the “Compiler Options” tab, and select the “Advanced Compiler Options” by clicking on it and clicking the “…” button. Then add the line “-static-rsls=false” to it as shown(or append it on a new line if you have other options set already).

tip3-3

Now, you have to copy the “framework_3.2.*.swf” and “framework_3.2.*.swz” files to the “bin” directory in your project, and upload them to your site when you upload your app. These contain the Flex framework that will be cached by the Flash Player when you run your app. They are located in “flex_sdk_3\frameworks\rsls” in the Flex 3 SDK folder. Note that whatever version of the SDK you compiled your app with is the version you have to use the RSLs from. If you compile your app on on build, and then try to use the RSLs from another one(ie. you switched machines/reinstalled the sdk/use another ide that uses a different sdk version, etc.) you will get a message when your app loads about RSL 1 loading(but it never will). So, if you reinstall the SDK, or any of the things I mentioned recompile your app with the new version. *phew*

I hope these tips are helpful to you!

The post Optimizing the SWF filesize for your Flex App appeared first on DanDev.com.

]]>
http://www.dandev.com/2009/03/optimizing-the-swf-filesize-for-your-flex-app/feed/ 2