July 25th, 2008 by Kyle
Tags: , , , ,
Posted in: Flash Player, Flex

A while back I posted this entry showing off my first Google Gadget that embedded a swf for Flash Player version detection.

http://blog.flexmonkeypatches.com/2008/01/25/google-gadget-flash-player-version-checker/

Recently someone posted a comment asking how I did that. I figured I might as well post the code. So here it is:

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="Flash Version Checker" height="295" width="760" scrolling="false"
description="Uses the swf from Adobe Support Technote: http://www.adobe.com/go/tn_15507 to detect version of Flash Player used in your browser."
author="Kyle Quevillon"
author_email="turdontherun+flashversionchecker@yahoo.com"
author_photo="http://739saintlouis.com/images/me.jpg"
screenshot="http://739saintlouis.com/images/flashversionchecker_screenshot.PNG"
thumbnail="http://739saintlouis.com/images/flashversionchecker_thumbnail.png"
author_aboutme="I work for Adobe Systems Inc. as a Senior Support Engineer for the Flex product line. I have sort of followed an odd career path in what would typically be a reverse order, having started as a Software Developer/Engineer, moving on to become a Software Quality(Assurance/Control) Engineer and now ending up a Software Support Engineer. I think I have found a good fit as I have always been good at discovering problems, understanding other peoples issues and proposing new (or tried and true) methods for solving them."
>

<Require feature="flash" />
</ModulePrefs>
<Content type="html">
<![CDATA[
<div id="flashcontainer" style="text-align: center; vertical-align:center"></div>

<script type="text/javascript">

// Display SWF
function showSWF() {
// The URL for the .swf
var url = "http://www.adobe.com/support/flash/ts/documents/test_version/version.swf";

// Play .swf file.
_IG_EmbedFlash(url, "flashcontainer", {
swf_version: 6,
id: "flashid",
width: 350,
height: 250
})
}

// When gadget first loads, display still photo.
_IG_RegisterOnloadHandler(showSWF);
</script>
<!--
<br/>
<center>
<a href="http://fusion.google.com/add?source=atgs&moduleurl=http%3A//hosting.gmodules.com/ig/gadgets/file/117092112381789410143/detect-flash-player-version.xml">
<img src="http://gmodules.com/ig/images/plus_google.gif" border="0" alt="Add to Google">
</a>
</center>
-->
]]>
</Content>
</Module>

 


No Comments »

July 23rd, 2008 by Kyle
Tags: , , ,
Posted in: Air

Launching external applications from AIR is not supported.
Here are a few non-Adobe resources that are looking into bridging that gap:

http://www.merapiproject.net/
http://aperture.fluorinefx.com/
http://www.mikechambers.com/blog/2008/01/22/commandproxy-its-cool-but-is-it-a-good-idea/
http://www.jeffryhouser.com/index.cfm/2008/4/22/Using-AIR-to-launch-other-applications


No Comments »

July 21st, 2008 by Kyle
Tags: , , , ,
Posted in: Flash Player, Flex

I have answered questions for a few customers regarding the policy files changes in the recent releases of the Flash Player and have referenced the following documents:

This change in behavior is noted in the following kb article:
Sockets do not function in Flash Player versions later than 9.0.115.0

A good reference on the security changes in the new Flash Player is located here:
Policy file changes in Flash Player 9

The page that is probably of most interest to you is here:
http://www.adobe.com/devnet/flashplayer/articles/fplayer9_security_04.html

This is an article describing how to set up a socket policy file server and provides some samples:
http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html

In addition to these articles, I have found 2 more that I personally found useful:

This one shows how to make and use a simple java socket server to act as a policy file server:
AS3 + Java: Socket connections to ports below 1024

This blog post shows how to create a simple java app that tests your socket server:
Flash Player 9 Update 3 and the Socket Policy File

Now if only I could figure out how to easily start the socket server when I start my TOMCAT server up?? Anyone?


No Comments »

July 8th, 2008 by Kyle
Tags: , , ,
Posted in: Flex, Flex Builder

A useful compiler switch to help with this is the -dump-config switch.

If you add -dump-config=c:\mycfg.xml to the compiler, it will generate a config file that represents all the compiler (either for mxmlc or compc) settings used for compilation in a Flex Builder compile and then you can use that config file in a commandline compile to do an equivalent compile.

A few notes on the generated configfile.

1. The file is not perfect. I found that the tag that was generated only had a relative path generated. It is much better if that were absolute, so before I used the config file, I changed the value for that tag to something like:

<manifest>C:\FlexBuilder2.0.1\Flex SDK 2\frameworks\mxml-manifest.xml</manifest>
 

2. For some reason the generated file has a token ${flexlib} which didn’t get resolved and filled in. I found that I could just comment out the 2 properties in the config file as they aren’t relevant to most compilations.

3. I found the easiest way to use mxmlc/compc was to copy the generated config file to the bin dir of the SDK under Flex Builder install. Then I could invoke mxmlc against the app like so:

./mxmlc -load-config+=mycfg.xml C:/myapp/src/app.mxml -output myswf.swf

4. For compc, the classes to actually compile to include in the generated swc aren’t actually output to the generated config file, so you have to add them manually (or on the commandline). I found the easiest way to do this was to add tags like below in the generated configfile

   <include-classes>
    <class>fooClass</class>
    <class>barClass</class>
  </include-classes>
 

The content for those tags comes from the project file - .flexLibProperties which looks something like this:

<?xml version="1.0" encoding="UTF-8"?>
<flexLibProperties version="1">
  <includeClasses>
    <classEntry path="fooClass"/>
    <classEntry path="barClass"/>
  </includeClasses>
  <includeResources/>
  <namespaceManifests/>
</flexLibProperties>
 

The classEntry paths translate into the class tag values.
After doing this you can run compc like this:

./compc -load-config+=mycfg.xml -output myswc.swc

HTH

-Kyle


No Comments »

June 19th, 2008 by Kyle
Tags: , , , ,
Posted in: Flex

Ya…you heard me. Flipping Flex Chart Axis! And I mean it too. :) Wouldn’t it be nice if you could easily swap x and y axis? And change the “corner” where the origin is. This functionality isn’t built in to the charts. You can change the side (left or right) where the y-axis is and the position of the x-axis (top or bottom), but that doesn’t change where the origin is. It merely changes where the axis labels appear. Well, this sample shows that through the combination of sorting, dataFunctions and labelFunctions, you can flip the chart axis and change where the origin appears in your chart.

This movie requires Flash Player 9

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»


No Comments »

April 8th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

The flex docs show how to use a DateField component as a Datagrid itemEditor. But what if your date data is actually a string instead of a date object? The sample below shows how to code a custom itemEditor extending the DateField component that allows you to do this. (I have also show how to use the drop in DateField as an editor for Dates.)

This movie requires Flash Player 9

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»


1 Comment »

March 24th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

Here is a sample that demonstrates what to do if you have an itemRenderer that has scrollbars and the outer control has drag and drop enabled. If you just try and scroll the scrollbar of the itemRenderer, the dragging mouse movement activates the drag functionality. That’s not what you want! You want to be able to drag the scroll thumb to scroll the inner renderer.

The sample shows how to use stopImmediatePropagation() to halt the dragging and allow the scrolling:

This movie requires Flash Player 9

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»


No Comments »

March 11th, 2008 by Kyle
Tags: , , ,
Posted in: Flash Player

I thought this was a very important notice that I should bring more attention to:

Preparing for the Flash Player 9 April 2008 Security Update

“Adobe is planning to release a security update for Flash Player 9 in April 2008 to strengthen the security of Adobe Flash Player for our customers and end users, and to provide further mitigations for previously disclosed vulnerabilities. The Flash Player security update provides further mitigations for issues listed in the December 2007 Security Bulletin ABSP07-20 for DNS rebinding and cross-domain policy file vulnerabilities, and Security Advisory APSA07-06 for cross-site scripting vulnerabilities in SWFs. Due to the possibility that these security enhancements and changes may impact existing content, Adobe is providing relevant information in advance to allow customers to better prepare for the pending release.

Customers are advised to review the upcoming Flash Player updates to determine if their content will be impacted, and to begin implementing necessary changes immediately to help ensure a seamless transition. This document provides an overview of the upcoming Flash Player changes, links to TechNotes, and relevant documentation to help you better prepare.”

Please read the full document and pay attention! This may affect you.

-Kyle


No Comments »

March 10th, 2008 by Kyle
Tags: , , ,
Posted in: Flex

This sample basically builds upon another sample I posted a while back.
It is pretty self explanatory - if you have multiple series in a chart, you may not want the clutter of viewing all the series, so this app demonstrates how you can extend the legend to toggle series on/off.

If you turn off all series in the app below (with the button at the bottom of the app), you can then toggle on/off the (multiple) series you desire to view by clicking on the legend item for the series you are interested in.

This movie requires Flash Player 9

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 »

February 28th, 2008 by Kyle
Tags: , , , , , ,
Posted in: Flex

Flex 3 has been out since Monday of this week and there are a lot of new learning resources available through the adobe website.

This is my favorite starting point:
http://learn.adobe.com/wiki/display/Flex/Getting+Started

Within that page is a “download projects” link that has some great Flex Builder example projects for various things:

http://learn.adobe.com/wiki/display/Flex/Download+Projects

* Building a simple RIA
* Exchanging data with a server
o PHP version
o JSP version
o ColdFusion version
o ASP.NET version
* Working with data
o PHP
o JSP
o ColdFusion
o ASP.NET
* Handling events
* UI layout
* Displaying lists
* Customizing components
* Multi-page apps
* Debugging

Also, slightly buried within the Getting Started guide is a list of compatibility issues:

http://learn.adobe.com/wiki/display/Flex/Backwards+Compatibility+Issues


No Comments »

« Previous Entries