SecurityError Loading Local Files AND Accessing Internet ResourcesHow to avoid the dreaded Security Sandbox Violation: Security Error: Error #2148 when importing, moving or renaming a project.

When you create a new Flex or ActionScript project in Flex Builder you are immediately able to access local files (config XML, etc) and internet resources at the same time.

But if you decide to import a project, or move or rename your current project suddenly you’re prompted with the dreaded Security Sandbox Violation: Security Error: Error #2148.

I’ve had this happen in the past, but often I was just loading a local XML file and I would just add -use-network=false as a compiler argument and all would be happy.

This however will then prevent you from accessing resources from the internet presenting you with yet another Security Sandbox Violation: Security Error: Error #2028. Not a great solution.

Lo and behold, Jesse Warden has the fix.

But to quickly recap, when Flex Builder creates a new project, it adds a new line item to two files giving permission to the new project’s bin directory to access both local and internet resources.

Here is the location of the two files (flexbuilder.cfg and flexbuilder.fbr):

PC:
C:\Documents and Settings\[username]\Application Data\Macromedia\Flash Player\#Security\FlashPlayerTrust

Mac:
[user]:Library:Preferences:Macromedia:Flash Player:#Security:FlashPlayerTrust

Now just add a new line item to each file (copying the one above if necessary) and change the paths to match your project’s bin or bin-debug directory.

Done.

Posted in Flex | 5 Comments
Color Name Class (SVG 1.0 – X11 and VGA)Here's a class for you that defines the names and hexadecimal values of all the colors in SVG 1.0, including the X11 colors and the HTML4 colors, based on the VGA colors.
UPDATE (2009-05-17):
  1. Renamed class from Color to ColorName
  2. Changed package to yourpalmark
  3. hexValue property has been renamed to color
  4. Added a toString method to trace out the properties of the ColorName object
  5. Changed license from New BSD to MIT

One small thing I’ve always found a bit handy with CSS in XHTML is the ability to type familiar names for colors rather than the hex value.

Unfortunately, Flash’s StyleSheet does not support color names at all and Flex’s StyleManager only supports the 16 basic VGA color names.

I decided to write a class that adds static properties for all of the color names defined by SVG 1.0 (The colors in SVG 1.0 include the X11 colors with the addition of gray/grey variants. X11 includes the 16 basic VGA, or HTML4, colors as well). This class also adds two static convenience methods for returning a ColorName object by passing in the color name or hexadecimal color value.

While this class does not extend the CSS parsing capabilities of Flash, it could be used by an advanced StyleSheet class that overwrites the parseCSS method using this class as a lookup.
This class could also be extended to add (or overwrite) color values specific to a project you are working on. By setting up static properties for a project color set, the project team could be assured that the colors being used are consistent between team members.

Description:
The ColorName class defines the names and hexadecimal values of the colors defined in SVG 1.0.

Documentation:
ColorName Class Documentation

Download ColorName Class

Posted in Flash | 10 Comments
Reposition ScrollBars in Flex ComponentsAn easy-to-follow explanation on how to move the ScrollBars from the right side of Flex components to the left.

I was under the assumption that someone had already figured this out, but I searched forever last night trying to find out how to move the VScrollBar to the left-hand side of a TextArea component and came up with nothing. (If I’ve overlooked something, forgive me… but at least this will help others when trying to find the answer).

After digging through the source code for a bit, I came up with the solution.
Now this has only been tested with the TextArea component and vertical scrollbar, but should work with any component that extends ScrollControlBase and should work with the horizontal scrollbar as well.
The other thing to keep in mind is that this might (and probably does) mess up the size calculations of the component… I didn’t look into that.

So without further ado, create a class that extends the TextArea component and override the protected updateDisplayList method like so:

protected override function updateDisplayList( unscaledWidth:Number, unscaledHeight:Number ):void
{
	super.updateDisplayList( unscaledWidth, unscaledHeight );

	if( verticalScrollBar && verticalScrollBar.visible )
	{
		verticalScrollBar.x = -verticalScrollBar.width;
	}
}

Dead simple.

This sets the vertical scrollbar of the TextArea component to the far left side of the component. You can change the verticalScrollBar.x value to whatever you like to position the scrollbar elsewhere. Also, you should be able to do the same check for horizontalScrollBar and change its position within the if statement to move it. Like I said, I haven’t checked that out, but it should work.

Let me know.

Posted in Flex | 11 Comments
Adobe Edge Article: Geocoding with Papervision3DA link to my article on Adobe Edge about using Flex and Papervision3D to geocode.

The latest issue of Adobe Edge, with my article on using Flex and Papervision3D to geocode, just went live.

Check it out here.

Posted in Flex | 24 Comments
Woopra… wowJust started checking out Woopra... seems like a very nice real-time web tracking application.

What a great app!

Woopra is a real-time web tracking application that’s currently in beta.
I’ve only been playing with it for a few minutes (since I received my confirmation) and am already loving it.
Its basically Google Analytics except with the incredible addition of being live. On top of all of this, it has a great design and is extremely user friendly.

Woopra allows you to sit and watch people log on and off of your site. Track them in real-time as they switch pages and interact with your site. What’s even crazier is you can even initiate a conversation with any visitor. For all you know, I’m watching you right now. Rockwell was right in being paranoid.

Like I said, I’m just getting into it, but so far I’m leaning towards this being my web analysis app of choice.

Posted in General | 1 Comment
FLVPlayback directly in FlexA quick tutorial on how to incorporate Flash's FLVPlayback component directly in Flex.

I remember trying this a while back with Flex Builder 2 after reading Stefan Richter’s article and never being able to get it working properly. You couldn’t use the FLVPlayback swc directly, you had to compile out of Flash first with a wrapper MovieClip and you still had issues with the skin scaling properly.

I decided to try it again a couple of weeks ago with Flex Builder 3 and having complete success. You can use the FLVPlayback swc directly in Flex Builder now. I’m not sure if Flex Builder 3 or an update to the FLVPlayback component made a difference or if I’ve just gotten better at Flex. Either way, I wanted to document it for everyone.

Its actually rather simple and requires just a few steps:

  1. Create a new Flex project.
  2. Copy the FLVPlaybackAS3.swc from your Flash CS3 directory (under Configuration/Components/Video) and add it to your libs directory in your Flex project.
  3. In your main application mxml file, create a UIComponent and give it an id of “container”. This id can be anything you want, just remember it for below.
  4. Add a Script tag and listen for the creationComplete event on the application. Within the Script tag, add the following:
    			import fl.video.VideoScaleMode;
    			import fl.video.FLVPlayback;
    
    			private function creationCompleteHandler():void
    			{
    				var playback:FLVPlayback = new FLVPlayback();
    				playback.width = 320;
    				playback.height = 240;
    
    				container.addChild( playback );
    
    				playback.play( "assets/video/video.flv" );
    				playback.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;
    				playback.skin = "assets/skin/SkinOverAllNoCaption.swf";
    				playback.skinAutoHide = true;
    			}
    			

    Make sure you change the references to the video and skin to the correct directories and files in your project.

That’s it!
Yep… it really is easy now. This is great. Especially since there still isn’t a good video component in Flex.
You can use the FLVPlayback swc directly, you don’t need to create a wrapper in Flash first, and no skinning issues when resizing. I’ve also tested and fullscreen works perfectly too.

As a note, you can also use the source code for the FLVPlayback directly as well. You just have to make a few tweaks to the code directly to handle references to Flash’s live preview for the component. Because of the tweaks, I would highly suggest copying the files into your project and editing them there rather than editing the originals in your Flash application directory.

Follow the steps above, but replace step 2 with the following.

  1. Copy the fl package from your Flash CS3 directory (under Configuration/Component Source/ActionScript 3.0/FLVPlayback) and add it to your src directory in your Flex project.
  2. Create a new class in the fl.video directory called Icon. The class is fine with an empty constructor, its just used to stop a compile error.
  3. Open fl.video.FLVPlayback and add an if statement around lines 874 – 876:
    			if( boundingBox_mc )
    			{
    				boundingBox_mc.visible = false;
    				removeChild(boundingBox_mc);
    				boundingBox_mc = null;
    			}
    			
  4. For good measure, add a void return to the set skinScaleMaximum method. This will stop a compiler warning.

There you have it. You are now able to compile and use the FLVPlayback component from Flex Builder directly with either the swc or the component source.

Posted in Flex | 13 Comments
AS3ScribdLib Update 0.90 – Complete API SupportThis update of my AS3 Scribd library completes the full API support including docs.upload() and user.signup().

AS3ScribdLib has been updated to version 0.90.
With this release, the API is completely supported.

Changelog:
* Fixed docs.upload() functionality.
* Fixed user.signup() functionality.
* Fixed request signing to follow API signature guidelines.
* Fixed success and error responses.

Links:
* Main Page
* Download
* Source
* Docs

Dependencies:
* as3corelib
* as3flexunitlib (Only necessary for running unit tests for the library)

Posted in Flash | 4 Comments
AS3ScribdLib Update 0.85An update for my AS3 Scribd library that fixes docs.uploadFromURL() and adds documentation.

AS3ScribdLib has been updated to version 0.85.

Changelog:
* Fixed docs.uploadFromUrl().
* Added documentation.
* Added a download link (includes docs, src, and swc).

Links:
* Main Page
* Download
* Source
* Docs

Dependencies:
* as3corelib
* as3flexunitlib (Only necessary for running unit tests for the library)

TODO:
* docs.upload()
* user.signup()

Posted in Flash | Leave a comment
Language Reference UpdatesLanguage References updated for the release of Flex 3 and AIR.

I’ve updated my Language References post with the latest and greatest since Flex 3 and AIR were officially released.

I’ve also added a subheading for Flash library language references.
If you’ve created a library with public facing docs let me know.

I’ll continue to try and update the post.

Posted in Flash | Leave a comment
AS3ScribdLib ReleasedThe official release of AS3ScribdLib... an AS3 library for handling document upload, document management and user registration for Scribd.

I just finished AS3ScribdLib, the AS3 API for Scribd.

The source code can be found on Google Code: http://code.google.com/p/as3scribdlib

The project has the following dependencies:

* http://code.google.com/p/as3corelib
* http://code.google.com/p/as3flexunitlib (Only necessary for running unit tests for the library)

The project has the following known issues:

* docs.upload() and docs.uploadFromUrl() not functioning properly
* user.signup() not functioning properly

After committing to creating the API I quickly realized that it is not the API for iPaper, but the actual API for handling document upload and management and user registration for the overall Scribd service.
Once I get upload and signup functioning 100%, I’ll move onto iPaper to see what API might be available for it.

Posted in Flash | 1 Comment
  • Pages

  • Categories

  • Archives