Tuesday, February 24, 2009

Using a Flash Component in Flex

There's not a lot of documentation on creating components for Flex in Flash, but it's fairly simple to do.

Prerequisites: CS3, Flex Component Kit for CS3 installed
Basic Steps: Create Flash movieclip (put the movieclip on frame 1 of your main timeline) then click on Commands/Convert Symbol to Flex Component and publish.
Flash will publish a swc file.
Your new Flex component will have the name of your movieclip and will be part of the mx.flash.IUMovieClip base class

In Flex, copy the swc into your libs folder
Then you can reference your new component from within Flex by it's class name (name of MovieClip)
note: new component must have x and y set and be in an absolute container.

With that, you can now control the timeline - play(); stop(); gotoAndPlay();
var myFlashComp:myFlashComp = new myFlashComp();
myFlashComp.x = 0;
myFlashComp.y = 0;
addChild(myFlashComp);
myFlashComp.gotoAndPlay(50);

If you want to reference other things in your movieclip, like maybe a dynamic text field, you need to create an actionscript class by the same name as the movieclip and import the flash.text.TextField

Wednesday, February 18, 2009

Procrastination Surfing

Okay, someone needs to come up with a clever name for this syndrome.
It happens to me all the time. I have tons of work I need to be doing, but instead of tackling it, I will start procrastination surfing.
It always happens when I have something that I dread doing. It's almost a sickness... like I can't help myself. I must surf the web, instead of doing my work.

I could even argue that I'm posting to this blog to procrastinate. Hmmm... I wonder if this is like AA and if I admit I have a problem, it is the beginning of the recovery?

Tuesday, February 10, 2009

ColdFusion Dreamweaver Sharing Violation

Okay, this has frustrated me too many times. Too often I forget what to do and have to google FOREVER to find the answer again, so I thought I'd post it where I can't miss it.

I have CF8 developer edition, Windows XP and have the full suite of Adobe CS3 installed. Often in Dreamweaver, I'll get a "sharing violation" error has occurred which prevents me from saving the file.

The solution: open the ColdFusion Administrator and set the Server Settings/Caching/Maximum number of cached queries to 0. Viola - now you can save!

Update! I recently switched to Windows Vista Home Premium and was having the same issue. I was clearing the cache, unchecking save class files in the CF8 administrator and it still wasn't working. I was only having this problem when trying to save .html files in a Dreamweaver site set up with a Coldfusion server. Once I saved the file with a .cfm extension the problem went away.