A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: How do I import mx.core.* with CS4?

  1. #1
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967

    How do I import mx.core.* with CS4?

    Is mx.core.* something in the flex sdk / framework?

    I am trying to get the unserializer from http://www.sephiroth.it/test/unserializer/ to work with flash CS4, and I am getting the compiler error:

    1004: Namespace was not found or is not a compile-time constant.

    The lines called out in the package are:
    use namespace mx_internal
    and
    mx_internal static var c:uint;

    I don't know the first thing about namespaces, but does anyone know how to get this package/class working in CS4 AS3? It might be something simple I am missing.

    I have attached the .as package file (uploaded as a txt file) if anyone wants a look...

    Any help would be appreciated. I am having to get a lot of lists from a mySQL database and it is becoming a real pain urlencoding them all manually. If I could just urlencode(serialize($result)); in php and send that file to AS3 to be decode it would be so much simpler.
    Attached Files Attached Files

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    Get the flex sdk http://www.adobe.com/products/flex/

    I think the mx stuff is in either flex.swc or framework.swc. But you might be better off trying to compile with the flex compiler.

  3. #3
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    I can't really go back and compile with the flex compiler, I have a lot of layout and UI elements created in the flash API. I much prefer doing UI's visually than in flex.

    Is there no easy way to change that .as file to compile properly with Flash? It seems like a horrible idea to make things as simple as classes not transportable between flex and flash.

  4. #4
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You can try using one of the swcs as a library. I don't know if that would work.

    Flex is a whole framework, so even if it does work, you might drag in a lot of extra code.

  5. #5
    Senior Member Alluvian's Avatar
    Join Date
    Jun 2006
    Posts
    967
    I figured it out for this case.

    They weren't actually using any flex code at all. All they were using was a namespace that was not even required. I just removed the include and deleted all references to the mx_internal namespace and now the class works great!

    Very cool! Now I can send full objects from php to flash with extremely little effort. Whole database results just urlencoded and serialized to be sent back as text and then be re-created in flash with one line of code as a native flash object. Wonderful!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center