Loading flex in to a flash

Hi,
Can i load the output of flex in to a movieclip using as3, like swf loading in to a movieclip?  Can anybody help me?
Thnks and regards,
Sreelash

You could try using SWFLoader, you may just need to import the class in your Flash app first.
http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex / AIR Development, Training, and Support Services

Similar Messages

  • How to embed Flex swf into existing Flash?

    Hello,
    I am brand new to Flex, so I desperately need your help!
    I have an existing Flash file, written in Flash 8. When I
    open this file, it plays in Flash Player 9, the latest player I
    have installed on my machine.
    This Flash file tries to dynamically load about.swf, a stub
    file created by the designer. It works.
    I am a programmer, so I want to create my own about.swf in
    Flex 2 and then substitue the existing about.swf written in Flash
    with my about.swf written in Flex. The problem is that the existing
    Flash file just displays a blank when I try loading about.swf
    written in Flex.
    Is there any way to load SWF file written in Flex 2 into an
    Flash file written in Flash 8?
    Thank you for your help!!!
    Evgueni

    I think no.
    Flash 8 uses Actionscript 2.0, but Flex 2.0 uses AS3. I think
    these will be incompatible, as they use different VMs.
    If the two swf's exist individually, in their res[pective VM,
    you can communicate between them using LocalConnection.
    Tracy

  • Reloading CSS in SWFLoader loaded Flex app.

    Hello,
    I am having the following problem:
    I have a Main application with a SWFLoader that loads a child Flex application. When a button is pressed, SWFLoader loads a new child Flex application. Currently LoaderContext for SWFLoader is created as follows:
    var context:LoaderContext = new flash.system.LoaderContext(false, ApplicationDomain.currentDomain);
    Everything seems to work okay except that CSS style sheets definded in the first child application cannot be overwritten by the CSS style sheets in the second.
    After much research I see the following two options: 1. load style sheets externally using StyleManager.loadStyleDeclaration() method or 2. specify a different ApplicationDomain for the child Flex application.
    The problem with solution #1 is I would like to keep all style sheets embedded in either the main application or each child application. So, my question is, how do load/reset CSS styles while keeping the CSS (or CSS compiled to SWF) embedded when StyleManager.loadStyleDeclaration() only takes a URL as a parameter?
    The problem with solution #2 is as follows: when I change the ApplicationDomain property in the LoaderContext declaration to this:
    var context:LoaderContext = new flash.system.LoaderContext(false, new ApplicationDomain(ApplicationDomain.currentDomain));
    I get the following error when I load a second child application into the SWFLoader:
    TypeError: Error #1034: Type Coercion failed: cannot convert spark.components::VScrollBar@64d6851 to spark.components.VScrollBar.
    (See attached txt for full trace stack.)
    I'm using Flex 4.0 beta 2 and Flash Builder beta 2.
    Also, I found this article on per Module StyleManager which does not look like it has been implemented and is basically exactly what I'm trying to accomplish but with a SWFLoader instead ofModule.
    If someone could please explain or point me in the right direction on how to either 1. load Flex 4 beta 2 application as a sub application domain app without generating VScollBar error (and if that will even solve overwriting CSS styles issue). or 2. how to load StyleManager.loadStyleDeclaration() from an embedded css or swf, I would greatly appreciate it.
    Thank you in advance,
    Ilya Voloshin

    Alex, thank you for the quick reply -- I'll give it a shot. Where would I find the nightly builds? I found the source code repository, but if there's a nightly build I can check out, that would be much easier.
    Thanks,
    Ilya

  • Is It possible to load Html page inside Adobe Flash Professional..?

    Hi Everyone,
         Is It possible to load Html page inside Adobe Flash Professional or Adobe Flex. Thanks in Advance.
    -Vijay

    probably not the way you are thinking.
    flash textfields and their extensions have a limited number of html tags they can parse so, in general, html from most web pages will not display, as expected in flash.

  • Loading external swf using Loader.load() method is delayed with flash player 10.1 and next versions.

    I am trying to load an external swf file of size 300 kb using Loader.load() method and trying to access some objects in it and i am getting some delay in loading the external file with flash players 10.1 and next versions.
    The action script code used to load:
    var strUrl:String="toLoad.swf";
    var urlReq:URLRequest=new URLRequest(strUrl);
    var ldrLoader:Loader = new Loader();
    var ldrLoaderContext:LoaderContext = new LoaderContext();
    ldrLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, externakSwfLoaded);
    ldrLoader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, errorInLoadingSwf);
    ldrLoader.contentLoaderInfo.addEventListener(SecurityErrorEvent.SECURITY_ERROR, errorInLoadingSwf);
    ldrLoaderContext.applicationDomain = ApplicationDomain.currentDomain;
    ldrLoader.load(urlReq, ldrLoaderContext);
    addChild(ldrLoader);
    System specifications:
    O.S. Windows XP sp2 (32 bit)
    Browser IE 6.0 (128 bit)
    Flash Player version WIN 10,2,152,32

    I think you are lost. This forum is for ROME. It sounds like you want one of the Flash or Flex forums...
    Good luck!
    Harbs

  • Use cs4 make loader load flex swf width/height problem

    hi,all:
      i use cs4 make as3 loader from SharedObject.getLocal, load flex make swf file, so width/height is not Ok
    load cs4 make swf file is Ok,
    why?
    as3code:
    // copy right china summer xiatian qq 11602011
    package{
      import flash.net.SharedObject;
      import flash.utils.ByteArray;
      import flash.display.*;
      import fl.controls.*;
      import flash.net.URLRequest;
      import flash.net.URLRequestMethod;
      import flash.system.ApplicationDomain;
      import flash.system.LoaderContext;
      import flash.net.*;
      import flash.utils.*;
      import flash.external.ExternalInterface;
      import flash.system.*;
      // http://as3corelib.googlecode.com/svn/trunk/src/com/adobe/crypto/MD5.as
      import com.adobe.crypto.MD5;
      import flash.events.*;
          public class MyCacheLoader extends Sprite
              public function MyCacheLoader()
                  Security.allowDomain("*");
                  Security.exactSettings = true;
                  function getStr(s:String):String
                     return ExternalInterface.call("(function(){return window['" + s + "'];})")  || '';
                  function MyLog(s:String):void
                      // ExternalInterface.call("(function(){var o = document.getElementById('myLog');o.value += '" + s + "' + '\n\n';})");
                      ExternalInterface.call("(function(){top.alert('" + s + "');})");
                      // myTestTxt.text = myTestTxt.text + s + "\n\n";
                  var bLoadSwf:Boolean = true;
                  var parm:Object = loaderInfo.parameters;
                  // parm["u"] = "/xuicore/test/myTest.swf";
                  // parm["v"] = "4.4";
                  var szUrl:String = parm['c'] + "/CMHS?jsessionid=" + parm['s'] + "&CMHS=GetOutSpFile&rmpath=rs/&rmf=" + parm["u"] + ".swf",
                      szVer:String = parm["v"], szName:String = parm["u"];// "X" + MD5.hash(parm["u"]);
                  var loader:Loader = new Loader();
                  var so:SharedObject = SharedObject.getLocal(szName);
                  loader.x = loader.y = 0;
                  addChild(loader);
                  function showSwf(byteArray:ByteArray):void
                    // MyLog("开始显示处理: " + byteArray.length);
                    if(0 >= byteArray.length)return;
                    bLoadSwf = false;
                    // loader.visible = false;
                    configureListeners(loader.contentLoaderInfo);
                    var context:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);
                    // context.allowLoadBytesCodeExecution = true;
                    loader.loadBytes(byteArray, context);
                  function displaySwf():void
                     var oData:Object = so.data;
                     // MyLog([szVer, oData.version].join(" = "));
                     if(szVer == oData.version)
                       showSwf(so.data.swf as ByteArray);
                     else downloadSwf();
                  var ldr:URLStream = new URLStream();
                  function downloadSwf():void
                      bLoadSwf = true;
                      // MyLog(szUrl);
                      var ur:URLRequest = new URLRequest(szUrl);
                      ur.data = new Date().getTime();
                      ur.method = URLRequestMethod.POST;
                      configureListeners(ldr);
                      ldr.load(ur);   
                  function configureListeners(dispatcher:IEventDispatcher):void {
                      dispatcher.addEventListener(Event.COMPLETE, completeHandler);
                      dispatcher.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
                      dispatcher.addEventListener(Event.INIT, initHandler);
                      dispatcher.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                      dispatcher.addEventListener(Event.OPEN, openHandler);
                      dispatcher.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                      dispatcher.addEventListener(Event.UNLOAD, unLoadHandler);
                      if(!bLoadSwf)dispatcher.addEventListener(Event.INIT,loaded);
                  function removeListeners(dispatcher:IEventDispatcher):void {
                      dispatcher.removeEventListener(Event.COMPLETE, completeHandler);
                      dispatcher.removeEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);
                      dispatcher.removeEventListener(Event.INIT, initHandler);
                      dispatcher.removeEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
                      dispatcher.removeEventListener(Event.OPEN, openHandler);
                      dispatcher.removeEventListener(ProgressEvent.PROGRESS, progressHandler);
                      dispatcher.removeEventListener(Event.UNLOAD, unLoadHandler);
                      if(!bLoadSwf)dispatcher.removeEventListener(Event.INIT,loaded);
                  function loaded(e:Event):void{
                          loader.x = loader.y = 0;
                          loader.content.y = loader.content.x = 0;
                          var s:String = "", k:String, obj:Object = loader.content;
                          // for(k in obj)s += k + " = " + obj[k] + ";";
                          // obj.width = "100%", obj.height = "100%";
                          // MyLog([obj.width, obj.height].join(", "));
                          loader.x = -180;
                          loader.scaleX = 1.83;
                          loader.scaleY = 1.05;
                          // loader.content.height = stage.stageHeight;
                          // loader.scaleContent = true;
                          // loader.content.width = stage.width,loader.content.height = stage.height;
                          // loader.content.stage.stageWidth = stage.stageWidth,loader.content.stage.stageHeight = stage.height;
                          // loader.content.stage.scaleMode = "exactFit";
                          setTimeout(function(){
                            // loader.x = loader.content.x = 0;
                            var fullWidth:Number = loader.content.width;
    var fullHeight:Number = loader.content.height;
    var stageWidth:Number = loader.content.loaderInfo.width;
    var stageHeight:Number = loader.content.loaderInfo.height;
    var fixOffStageScaleX = fullWidth / stageWidth;
    var fixOffStageScaleY = fullHeight / stageHeight;
                            loader.content.scaleX = fixOffStageScaleX,loader.content.scaleY = fixOffStageScaleY;
    // loader.content.width = stage.width * 1.59;loader.content.height = stage.height * 1.15;
                            // loader.content.width = stage.stageWidth,loader.content.height= stage.height;
                            // loader.width = stage.stageWidth,loader.height= stage.height;
                            // loader.content.stage.scaleMode = "exactFit";                       
                          }, 3000);
                  var _byteArray:ByteArray = new ByteArray();
                  function completeHandler(event:Event):void {
                      if(bLoadSwf)
                          if(0 < _byteArray.length)
                             so.data.swf = _byteArray;
                             so.data.version = szVer;
                             try{so.flush();}catch (e:Error){}
                             removeListeners(ldr);
                             showSwf(_byteArray);
                          else removeListeners(ldr);
                          bLoadSwf = false;
                          ldr = null;
                      else
                          removeListeners(loader.contentLoaderInfo);
                          // loader.visible = true;
                          // loader.content.width = (height / loader.content.height) * loader.content.width;
                          // loader.content.height = (width / loader.content.width) * loader.content.height;
                          if(isNaN(loader.content.width) || 0 >= loader.content.width)
                            setTimeout(function(){
                             loader.content.width = stage.stageWidth;
                             loader.content.height = stage.stageHeight;
                          }, 4000);
                          // width=loader.content.width;  height=loader.content.height;
                          // MyLog("显示处理完毕");
                  function httpStatusHandler(event:HTTPStatusEvent):void {
                      // MyLog("httpStatusHandler: " + event);
                  function initHandler(event:Event):void {
                      // MyLog("initHandler: " + event);
                  function ioErrorHandler(event:IOErrorEvent):void {
                      // MyLog("ioErrorHandler: " + event);
                  function openHandler(event:Event):void {
                      // MyLog("openHandler: " + event);
                  function progressHandler(event:ProgressEvent):void {
                      // MyLog(bLoadSwf + ": progressHandler: bytesLoaded=" + event.bytesLoaded + " bytesTotal=" + event.bytesTotal);
                      if(bLoadSwf)
                        var urlStream:URLStream = event.currentTarget as URLStream;
                        while (urlStream.bytesAvailable)
                           urlStream.readBytes(_byteArray, _byteArray.length);
                  function unLoadHandler(event:Event):void {
                      // MyLog("unLoadHandler: " + event);
                  displaySwf();
    flex code:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" horizontalAlign="left" layout="absolute"
    paddingLeft="2"
        paddingTop="2"
        paddingBottom="2"
        paddingRight="2"
        autoLayout="true"
        width="100%"
        height="100%"
    backgroundGradientColors="[0x000000,0xBAD3F9]"
    ">
    </mx:Application>
    must:
    width="100%"
    height="100%"

    loader from SharedObject.getLocal, use SharedObject.getLocal cache bytearray swf data is ok,
    so, Can be seen as not with urlstream
    loader.loadBytes(byteArray, context);
    as3 cs4
    flex sdk 3.3.0.4852

  • Any tutorials on how to use the daily build of the Flex SDK to create Flash Player 10 content?

    Is there a tutorial on Adobe on how to use the daily build of
    the Flex SDK to create Flash Player 10 content?

    The approach you take might depend on a few things, but it boils down to using mouse interactive coding to trigger whatever effect you eventually realize.  The code you use will depend on the version of Actionscript you plan to use.
    You could make this as a movieclip that is normally stopped at its first frame and when you mouseover or click the movieclip, it animates along its own timeline to its enlarged state.  If the thumbnail is very small and the larger version is substantially larger, and both need to be clear images, this might be the better approach.
    If this only involves enlarging something, you could also probably realize it just using Actionscript Tween coding rather than timeline animation.

  • Flex Builder 3 vs Flash Builder 4

    Is there much difference between Flex Builder 3 and Flash Builder 4? Just that I got them both through the student online form but since FB4 is newer, should I still keep Flex in my laptop?

    I found FB3 rock solid and I loved only having one name space.
    FB4 is quirky to say the least.
    Only reason I don't switch back to FB3 is because FB4 changed the way states are done, and that alone has saved countless hours.  I love the way STATES are being handled in FB4!
    CrazyMerlin, you got a url for the FB4 skin site.  wow that sounded x-rated...

  • How to speed up the loading of live data into flash file.

    How to speed up the loading of live data into flash file if the swf file size is 1.5 MB. Flash file is using 20 web service connections to load the live data.

    Hello,
    I am also facing a similar problem wherein the SWF file takes time to load the refreshed data in Infoview i.e. after exporting the xlf file to Business Objects platform. Currently I am using Xcelcius Engage/Enterprise 2008 SP3 Windows (file name: 51038212.ZIP) version 5.3.0.0 build number 12,3,0,670. Also the SWF file is approximately 2MB in size  and it uses 42 live office connections.
    Please suggest solution as to how to decrease the time it takes to refresh the live office connections.

  • Loading a webpage within a flash document

    Hi, is it possible to load a webpage withing a flash document,
    this is what i want to happen, i want the flash to stop animating/looping (i already have that done)
    and then instead of opening a seperate page to load a website i want it to load within the swf.
    CS4 ActionScript 3
    Please help, thanks

    yes, you can display html text in an html-enabled textfield but, the html page will probably not display as you expect because of flash textfields support for a limited number of html tags.

  • Comunication and events: Flex Builder 2 with Flash CS3

    Hey hello...well, my question is: how can i comunicate Flex
    Builder 2 with Flash CS3?
    this is my code on Flex Builder 2:
    <mx:Script>
    <![CDATA[
    import mx.controls.*;
    import mx.events.*;
    public function CargaCompleta(e:Event):void
    try
    e.target.content.objeto_salida.addEventListener(Event.COMPLETE,uno);
    catch(er:Error) { Alert.show(er.message,"Error"); }
    public function uno(e:Event):void
    try
    s1.content["objeto_salida"].removeEventListener(MouseEvent.CLICK,s1.content["Finaliza"]);
    s1.source = null;
    s1.source = "recursos/reactivos/208M-1R.swf";
    catch(er:Error) { Alert.show(er.message,"Error"); }
    ]]>
    </mx:Script>
    <mx:SWFLoader id="s1" width="278" height="251"
    complete="CargaCompleta(event)"
    source="recursos/interactivos/208M-1I.swf">
    </mx:SWFLoader>
    and when it change from one file to another, on the event
    "Complete" for the SWFLodar, an error happend
    TypeError: Error #1009: No se puede acceder a una propiedad o
    a un método de una referencia a un objeto nulo.
    at 208M_fla::MainTimeline/frame1()
    Hope somebody can help me...for your time thanks...

    "Jorge EdOardo" <[email protected]> wrote in
    message
    news:gfcfcr$9s2$[email protected]..
    > Hey hello...well, my question is: how can i comunicate
    Flex Builder 2 with
    > Flash CS3?
    >
    > this is my code on Flex Builder 2:
    > <mx:Script>
    > <![CDATA[
    > import mx.controls.*;
    > import mx.events.*;
    > public function CargaCompleta(e:Event):void
    > {
    > try
    > {
    >
    e.target.content.objeto_salida.addEventListener(Event.COMPLETE,uno);
    > }
    > catch(er:Error) { Alert.show(er.message,"Error"); }
    > }
    > public function uno(e:Event):void
    > {
    > try
    > {
    >
    >
    s1.content["objeto_salida"].removeEventListener(MouseEvent.CLICK,s1.content["Fin
    > aliza"]);
    > s1.source = null;
    > s1.source = "recursos/reactivos/208M-1R.swf";
    > }
    > catch(er:Error) { Alert.show(er.message,"Error"); }
    > }
    > ]]>
    > </mx:Script>
    > <mx:SWFLoader id="s1" width="278" height="251"
    > complete="CargaCompleta(event)"
    > source="recursos/interactivos/208M-1I.swf">
    > </mx:SWFLoader>
    >
    > and when it change from one file to another, on the
    event "Complete" for
    > the
    > SWFLodar, an error happend
    >
    > TypeError: Error #1009: No se puede acceder a una
    propiedad o a un m?todo
    > de
    > una referencia a un objeto nulo.
    > at 208M_fla::MainTimeline/frame1()
    >
    > Hope somebody can help me...for your time thanks...
    http://weblogs.macromedia.com/pent/archives/2007/04/using_actionscr_1.html

  • Is It possible to load Html page inside Adobe Flash...?

    Hi Everyone!
    Is It possible to load Html page Inside Adobe Flash CS5.
    Any help would be a great help...!
    Originally, i wanted to bring in through <IFRAME> but i don't see that flash understands that.
    Thanks in advance!
    -yajiv

    Not exactly sure how you where planning to display that HTML content in relation to the overall page, but given the limitations of Flash... that may just not be possible...
    But, it would be a simple matter to display an HTML iframe over the top of or behind a Flash .swf... So while the iframe would not be a part of the .swf, it certainly could be designed to make it look as though it were.
    Controling the stacking order or layering of content on a Web page is accomplished through z-indexing. Correctly positioned and z-indexed, the iframe could apear over the top of the .swf... the .swf in effect being the background... OR the iframe could appear behind the .swf and with a transparent section in the .swf, the iframe would appear through that hole. If there is navigation or links in the iframe, they will be blocked by the .swf though.
    http://www.w3schools.com/cssref/pr_pos_z-index.asp
    But this may be an option....
    Best wishes,
    Adninjastrator

  • Flex Component Kit for Flash CS4

    Is there a Flex Component Kit for Flash CS4? All I have found
    is a download for Flash CS3.

    There isn't. But the CS3 kit works for CS4 too.

  • Flex Component Kit for Flash Professional - still available?

    Is the Flex Component Kit for Flash Professional still available for download somewhere?
    We are currently trying to get some old stuff done in Flash to port over to flex and convert a MovieClip made in Flash to an SWC/Flex component.
    The link stated here at the bottom Flex Component Kit for Flash Professional (Adobe - Flex Downloads) does not work.

    There isn't. But the CS3 kit works for CS4 too.

  • When will Adobe release Flex Component Kit for Flash CS4?

    Any idea when will Adobe release Flex Component Kit for Flash CS4?

    There isn't. But the CS3 kit works for CS4 too.

Maybe you are looking for

  • Capturing video straight from a switcher to hard drive???

    I am shooting a seminar this weekend and want to go "tapeless". I will be using a Datavideo SE500 switcher withthese outputs: Video Out: Composite Video x2, 1 Vpp @ 75 ohms, on BNC connectors S-Video, on 4-Pin Connectors Component Video, derived from

  • Loading XML Document from JFileChooser

    My initial version of this app I hardcoded the XML filename. Now, I would like to load an xml file via a JFileChooser. The problem I'm having is that I create the DOM Document in the constructor because of dependencies on the JTree. Well, I don't cal

  • RMI or sockets

    I was asking for help on the design of a network-aware application. Let me give a description of the program i need. I want an application that does stock or inventory management in a warehouse. It should be developed in Java and use JDBC connection

  • Display Report Output in Email Body (EBS).

    Hi, I was wondering if it is possible to display the output of a BIP report within the body of an email using bursting instead of having the report in an attachment. Thanks in advance Carl

  • Material type for stationary items

    Hi, We want  to maintain stock of stationary items, and these items are procured externally. Which material type and valuation class to be used for it? Regards,