Using Flash 8 Symbols in Flex

Hi,
I am creating some custom controls whose interface is a bit
complicated (and hence would be far too much of an effort to create
using graphics.draw methods). So I tried building the user
interface as Flash 8 symbols. What I do is,
- Create the symbols in Flash 8
- Embed them in my Custom Control class
- Create instances of the embedded class as a SpriteAsset
object
- Add it to the childrens list of my control class so that it
is drawn
So far, so good.
The slight issue is that I also need to allow the user to
modify the custom control interface (line color, fill color etc.)
and I cant figure out how I can modify these properties on the
Flash Symbol through the SpriteAsset class.
Any ideas....

The short answer is you can't do that. Flash 8 is
ActionScript 2 while Flex 2 is ActionScript 3. When ActionScript 2
is loaded into the Flash Player it is put into a separate virtual
machine than the ActionScript 3 code. This is how the Flash Player
maintains backward compatability. There isn't a way for the AS3
code to reach in and tinker with the AS2 code and vice-versa.
But all is not lost. You can use LocalConnection to
communicate between the two virtual machines. Check my blog,
there's an article about doing that:
Using
ActionScript 2 SWFs with Flex 2

Similar Messages

  • Developing Iphone App using Flash Builder and Flex Air Mobile

    I started developing an Iphone app using the trial version of Flash Builder and was pretty impressed with how easy it was, then i hit problems:
    Trying to submit my app, I was getting invalid binary, using google i tracked this down to a change in the Apple App Store meaning that all apps needed to have native iphone 5 support, which meant updating to Air SDK 3.7
    Updating to AIR SDK 3.7 was a nightmare (mainly as a result of my failure to read the small print)
    Once I got SDK 3.7 to  work with flash builder / flex mobile i though i was there.
    However now i can produce a fast build but everytime i try and produce a standard / production build i get strange errors (air 3.8 does the same).
    My Question is - before i actually buy Flash Builder has anybody actually achieved the following:
         Building an Iphone App using:
         Flash Builder 4.7    (running on OSX)
         Flex Mobile 4.6
         Air 3.7
    If so how ?
    cheers
    Toby

    Thanks for your reply, its nice to know its not just me.
    the error i got when submitting to the App store where due to native support for IPHONE 5 which is now mandatory (from May 1st), looking around the internet the common soloution seemed to be upgrading to Air 3.7.
    The strange erorrs on 3.7 revolve around compiling a standard / production build (fast build works fine)
    the error is always the same (snippet shown below):
    Error occurred while packaging the application:
    Undefined symbols for architecture armv7:
      "__ZN7avmplus8Debugger9debugLineEi", referenced from:
          __ZN7avmplus9MethodEnv9debugExitEPNS_13CallStackNodeE in AOTBuildOutput-4.o
          __ZN7avmplus11BaseExecMgr22debugEnterExitWrapperNEPNS_9MethodEnvEiPj in AOTBuildOutput-4.o
    I have completly failed to work out why, but my gut feeling is its something to do with how the mac is compiling the code in standard build and unable to find a library it needs.
    cheers
    Toby

  • Flash symbol in Flex

    Following the instructions, I've been able to take a Flash
    symbol/class, convert it to a Flex component, and import into Flex.
    However, while the following code compiles without errors, nothing
    shows up on the display. I'm sure I'm probably doing something
    dumb, but I've searched and worked on this for several hours now
    without luck. Thanks to anyone who can point me in the right
    direction.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:ApolloApplication xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:bevy="*">
    <bevy:RedCircle id="please"/>
    </mx:ApolloApplication>

    I think so. I think I have that all right. I'm declaring the
    namespace in the original mx:ApolloApplication tag as you can see
    in the code I pasted in my first post - is that sufficient? Flex
    Builder prompted me for RCircle when I typed Bevy, so I'm pretty
    sure it can see it and it compiles it just fine... just doesn't
    show up when I run it.
    Other information: the RCircle symbol was exported to AS and
    associated with the RCircle class before it was exported to Flex.
    The .swc, .swf, and .fla are all named FlComponents and are in the
    same directory as the main project .mxml files. I also explicitly
    imported the .swc into the project using
    project->properties->... I'm using the eval version of
    FlexBuilder upgraded to 2.01 if that matters.
    Also, I can take the Hello World app and plug the bevy line
    right into the middle of it and create a .air that runs fine -
    except that it doesn't show my symbol.

  • Can I use Flash classes in Flex?

    Hello,
    I need to know if all the flash classes can work in Flex,
    since some Actionscript which use flash classes works as expected
    in flash but NOT in Flex, so I need to understand or know which do
    works and which does not?
    ..and thanks for any response :)
    Regards,
    Jamal

    it is possible to import any UIComponent made in FLASH CS3 or
    even previous versions into Actionscript and use them. The process
    is more complex though.
    I'll try to explain:
    First make sure that when you created the UIComponent it
    actually exists as a class with in the flash movie, this is give it
    a LINKAGE NAME.
    Second compile this SWF or SWC and put it in the path of your
    flex Proyect.
    Third use de [EMBED] compiler command to include this class
    into your AS class, the way to do it is this:
    [Embed (source="/assets/UICOMPONENT.swf")]
    [Binddable]
    private var UI:Class;
    Once you do that you can use the class each time you want:
    var tmp:MopvieClip= new UI();
    if You don't want to load the hole movie, you can add
    elements of it, just read the documentation on the EMBED Command.
    One thing I've used though is to clone child element's of the movie
    and use them in my class later.
    Some tips I've found out:
    1.- The object created is a MovieClip whith one Child Element
    that's a Loader class.
    2.- You have to implement a Listener to make sure the Embed
    element is loaded before use it or you'll get an error.
    3.- You'll then be able to access all the elements in the
    movieclip created with Flash CS 3 or 2.
    4.- I've noticed that there are some compiling isues when
    using filters in button frames, I've only used the CS2 Actionscript
    preview and not CS3 so I don't know if this was solved.

  • Use flash container to flex

    size of flash container is not well set on flex

    Hello All,
    for me it's very interesting, 'cause Adobe makes some differences. In the German forum you are allowed to load up files too, see screenshot:
    Allowed are all file types and they are limited to 8.9 MB.
    We could send this thing to the wishform adress.
    Sincerely,
    Hans-Günter
    P.S.
    I so too can't understand why our questioner doesn't want to send a link. We're just nothing than normal users, Glen please don't worry.

  • Importing flash symbols from an external SWF using URLrequest

    Hello.
    I'm trying for several days now to properly import flash symbols into a flex application.
    i can't only @Embed because the swf file that contains the skins will not be available locally so i need to use URLRequest.
    This is what I've got so far.
    1. I created a flash file, lets call it foo.swf that contains several elements in the library and each element has both `Export for ActionScript` and `Export for runtime sharing` on. one of the elements is called 'test' which is a movieclip of an image.
    2. i created a flex project that creates the swf flashSkins.swf that contains the following Wrapper class:
            package
                import flash.display.Sprite;
                    public class Wrapper extends Sprite
                     [Embed(source="foo.swf",symbol="test")]
                        [Bindable]public static var test: Class;
    I tested to make sure that this class properly fetchs symbols from the flash file properly
    using the following code:
        <fx:Script>
            <![CDATA[
                public var wrapper:Wrapper;
            ]]>
        </fx:Script>
            <mx:Image source="{Wrapper.test}"/>
    it loads the image and shows it properly.
    3. I created another swf file that will fetch the flashSkins swf and import the Wrapper class from it. this is where i fail.
            public function loadSkins():void
                    bgLoader = new Loader();
                    var bgURL:URLRequest = new URLRequest('http://files.xpogames.com/flashSkins/flashSkins.swf');
                    bgLoader.contentLoaderInfo.addEventListener(Event.INIT,onLoaded);
                    bgLoader.load(bgURL);
                public function onLoaded(e:Event):void {
                    var clazz:Class = bgLoader.contentLoaderInfo.applicationDomain.getDefinition('Wrapper') as Class;
                    var a:Object = new clazz();
                    theimage.source=a.test;
            ]]>
          </fx:Script>
            <mx:Image id="theimage" />
    I tried using getDefinition with 'wrapper' or 'Wrapper' but on both cases i get an error that the variable is not defined.
    any ideas?

    Did you try using the Event.COMPLETE instead of Event.INIT?

  • Problem with NetConnection in Adobe AIR(Flex) using Flash Media Server.

    Hi
    I am creating a small chat application using Flash Media server. I have already created all my user interface components in Flex(Adobe AIR).In this application rather than sending text messages user can also  send  file to another user in his friend list.
    problem what i am facing is, when i am sending file through FMS most of time it send successfully but for some files while sending  application loss netconnection.
    so i would like to know, rather than closing application what are other condition when FMS loses network connection?
    Any help would be appreciated .
    Thanks.

    Hi. It looks like your code is not finding the mp3. At least,
    I can reproduce your error code by removing the mp3 from the
    directory, or renaming it.
    Btw, if you test with FF instead of IE, you'd see the error:
    Error #2044: Unhandled IOErrorEvent:. text=Error #2032:
    Stream Error.
    at KZFlash_fla::Sound_2/KZFlash_fla::frame1()
    Hope that helps.

  • Any official Update for Flex Builder 3 to use Flash Player 10 Api?

    Any official Update for Flex Builder 3 to use Flash Player 10
    Api?
    How can i use flash player's 10 features in flex builder 3?
    Thanks

    I was able to solve my problem by modifying the solution
    offered in
    this
    technote.
    The technote identifies a permissions problem with the
    components directory of non-Safari browsers. In my case the
    permissions problem appears to have been in the main
    /Library/Internet Plug-Ins directory. What tipped me off to the
    solution was the fact that after manually removing Flash
    Player.plugin and flashplayer.xpt from the /Library/Internet
    Plug-Ins directory, subsequent attempts to install Flash Player
    resulted in the "Creating file: 1008:5, -5000 Access Denied Error"
    I remembered seeing in the technote. Before removing these files,
    the installer would just fail silently, perhaps because it saw
    files it was going to install already living in the right place,
    and furthermore had no permissions to alter the directory.
    In any case, by making the permissions change recommended in
    the technote to the /Library/Internet Plug-Ins directory, I was
    able to install the plug-in, which gave me back access to Flash
    content in all my browsers.
    Hope this is helpful to someone else...
    -Erik

  • Use flash video coponent in flex?

    Hi
    I want to use flash player video player feature.Please let me
    know how to do this.
    I need use the class fl.video.VideoEvent but it is not flex
    libary.do I have to build swc file,what is the steps to do this.
    Thanks
    Mk

    Hi Mk,
    Emanuil Rusev has created an an easy to use, open source Flex
    video player called FX Video. You can find the FX Video home page
    here:
    http://www.fxcomponents.com/?p=29
    And the FX Video source here:
    http://www.fxcomponents.com/src/fxvideo_0.92/
    Thank you Emanuil!!!
    Please take a look at the FX Video video player and see if it
    provides the functionality that you need. If not, please post back
    with detail on what further functionality you require.
    Regarding
    fl.video.VideoEvent,
    Flex does have a similar event
    mx.events.VideoEvent
    The Flex VideoEvent is related to the Flex UI control
    mx.controls.VideoDisplay.
    VideoDisplay is pretty rudimentary. The FX Video video player cited
    above uses both VideoDisplay and VideoEvent. If you are not
    familiar with the Flex VideoDisplay control, you can find a
    runnable example online in the Flex docs here:
    http://livedocs.adobe.com/flex/3/langref/mx/controls/VideoDisplay.html#includeExamplesSumm ary
    Please post back regarding whether the above answers your
    question, and if you find it helpful :-)
    Best regards,
    g

  • How to create a multiplayer game for steam using flash/flex?

    Hi guys,
    We've got a multiplayer game ready to go. Currently it is not multiplayer, but we'd like to get it to a stage where it can be played over the steam network by users of steam and owners of steam games.
    We'd like to if anyone could briefly give us a breakdown of how to get out game up on steam and available for multiplayer?
    Does steam host servers, and can we utilise a steam server to transfer data between players or would we have to run our own server?
    Currently were using flash builder to publish via adobe air to a windows desktop exe. Can anyone briefly explain how - once a player has downloaded the game from steam we can connect two players? Does anyone know how to use actionscript 3 to access steam network?
    Anyone have any experience developing multiplayer turn based game for steam using flash /actionscript 3 /adobe air?
    Thanks for your help in advance,
    i

    You would want to use the SteamWorks API, which is available from Steam as a C++ library, but there is most likely an Adobe Native Extension (ANE) that would allow you to use the library in AS3.
    I've never used SteamWorks but it seems to support peer-2-peer matchmaking (in other words, you wouldn't even need your own server, I think.)
    SteamWorks API:
    https://partner.steamgames.com/documentation/api
    Search results for "SteamWorks AIR ANE":
    https://www.google.com/search?q=steamworks+air+ane
    -Aaron

  • Where is the "done" button in Flash CS4 when using Flash Builder 4's new flash component or container?

    The documentation for Flash Builder 4 beta says that after opening flash from flash builder, I should click a "done" button in flash and flash should close and what I created in flash should be included as a component or container in Flash Builder.  Using the Flash Builder 4 beta on Windows, when I click on the "create in flash" button on the properties panel for either the new flash component or container, Flash CS4 opens, I create something in Flash and no "done" button is present.  Nor is anything present in the menus resembling a "done" option.  Where is it?

    Hi Jeffrey:
    Still no done button.  Now under commands in Flash I can convert symbols to flex components and containers and these show up in the Flash library.
    Thanks:
    Jim
    Date: Wed, 30 Sep 2009 09:58:10 -0600
    From: [email protected]
    To: [email protected]
    Subject: Where is the "done" button in Flash CS4 when using Flash Builder 4's new flash component or container?
    Hi,
    You may need to install FlexComponentKit.mxp to your Flash CS4 beforehand.
    Jeffrey
    Date: Tue, 29 Sep 2009 17:04:36 -0600
    From: mailto:[email protected]
    To: mailto:[email protected]
    Subject: Flex Where is the "done" button in Flash CS4 when using Flash Builder 4's new flash component or container?
    I apparently didn't get one.  I've looked under various workspace configurations.  Another thing that seems odd is that when Flash opens I get the opening panel that allows me to select the type of file and version of AS I want to use.  I select new file with AS3.  Any ideas on why the "done" button wouldn't be present and if the opening panel is what I should expect on opening Flash after clicking the "create in Flash" button?
    >
    >

  • Import Flash components into Flex

    Hy,
    I'm trying to create an AIR application. Until now I've watched and read a lot of tutorials but none had the answer I was looking for. So I have a few animations made in Flash as MovieClip symbols. They should react depending on the user's intentions. How can I import those symbols and control them with "gotoAnd" commands (i know how to use the AS in Flex but not how to import animations)? I'm starting to think Flex can't do this because I only found about skins or images or things not even close to what I want. If you know a way I would really apreciate a nice tutorial or a code sample.
    Many thanks !

    I think that what you're looking for is the Flex Component Kit for Flash CS3.
    By installing this kit you are able to export any movie clip from flash as a flex component.
    Then, you have full access to the objects inside the component by writing code in your Flex application.
    you can find it here : http://www.adobe.com/go/flex3_cs3_swfkit

  • How to create Theme SWC using Flash Builder 4

    I have created a library project in flex which contains spark skin classes for certain controls and a style sheet class. The problem is when I use the SWC generated by thsi project  and import this SWC as Theme and apply it to another test project. the stylings chasnges are not reflected.
    IF I use comand line to generate Theme SWC the changes are reflected.
    Can any one help me use FLash Builder to create and apply theme SWC.

    Connect to PHP in FB4 is used when you have a PHP Class and you want to use that in FB, for example Employee.php and it has a Employee class and various methods in that like create, update, get, delete.
    However, if you have exposed your functionality in PHP as a HTTP URL (i.e. it is not a class), then you should be using HTTPService from the data menu.
    So if your file is login.php and is accessible as a URL, then using the HTTPService and enter the URL.
    Does this help?
    -Sunil

  • Should I use Flash Builder to develop for iOS?

    We have a sizable AIR application built using Flash Builder 4.5 that is deployed on Windows and Mac. We tried to package it for Android and it simply failed to run at all. Apparently there are many namespaces not supported on Android. We've since stopping concerning ourselves with Android because the vast majority of our clients only care about iPad when it comes to tablets.
    So, the question I have that remains very elusive to me is: do I attempt to build an iPad version of our product on our existing AS3/Flex code base using Flash Builder, or should I port over to xcode and go native iOS? All the marketing I see surrounding Flash Builder says that you can build apps for iPad. But just how practical is this for anything more than trivial apps? Adobe AIR is supported on Android and it failed to work, which doesn't give me much confidence in trying to make this work on an iPad. Now that Adobe is moving away from Flex does it make any sense to even attempt this?
    What say you Adobe?
    Thanks
    Kevin

    autoplay can cause a tremendous amount of problems for site visitors. is it possible that adobe might turn off autoplay?

  • Is this a bug in Flash Player or Flex?

    Compile and run this code (it is generated when you select New MXML Application) with FlashBuilder4.5:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
          xmlns:s="library://ns.adobe.com/flex/spark"
          xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
      <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    </s:Application>
    If you are using IE, you will see a blue player control panel. But there should be nothing displayed because there is no
    visual components in the code above.
    If you are using FireFox, there is nothing displayed.
    Same behaves for mx:Application.
    I think it is a bug with Flash Player or Flex. How can Flex behave differently with different browsers?

    This is what I see in IE 9.0.8112.16421, but not in FF.

Maybe you are looking for