Fx{r} is trying to start the Fx{r} Community! Please join our group on Adobe Groups following this link: http://groups.adobe.com/groups/ab29539ab9.
Fx{r} is now on Twitter too. Follow us @ twitter.com/fx_r!
«
»

ActionScript, Flash, Flex Builder 3, How to, MXML

Very First Flex Preloader Customization For Flex Builder 3/Flex SDK 3.2

Andrei Ionescu | 22.01.09 | 2 Comments

Table of contents

  1. Very First Flex Preloader Customization
  2. Very First Flex Preloader Customization For Flex Builder 3/Flex SDK 3.2
Google Buzz

In a previous article I explained how to create a custom preloader that will replace the very first flex preloader (the one that appears when starting application). That article was created using Flex Builder 2 and now needs an update because Flex Builder is at version 3 since a good time and Gumbo is on its way.

If you would try to implement that example in Flex Builder 3 you would notice a runtime error that sounds like this:

TypeError: Error #1034: Type Coercion failed: cannot convert dwd::CustomPreloader_WelcomeScreenGraphic@2a86781 to flash.display.MovieClip.
        at dwd::CustomPreloader()[CustomPreloader.as:22]

Not so good… :(

To make it work you need to use DisplayObject instead of MovieClip. So change those lines like bellow:
from

public var wcs:MovieClip;

to

public var wcs:DisplayObject;

and from

wcs = new WelcomeScreenGraphic();

to

wcs = DisplayObject(new WelcomeScreenGraphic());

This should do it. If you found another way please tell us.

Share and Enjoy:
  • Twitter
  • Google Buzz
  • LinkedIn
  • Google Bookmarks
  • del.icio.us
  • Digg
  • Sphinn
  • blogmarks
  • Reddit
  • StumbleUpon
  • Facebook
  • DZone
  • FriendFeed
  • Yahoo! Buzz
  • Yahoo! Bookmarks
  • Slashdot
  • MySpace
  • Add to favorites




Tags: , , ,

This post was written by Andrei Ionescu

Views: 15734

related

2 Comments

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

:

:


«
»