Flex 4.6.1: Fzip + SWFLoader, Loader or ModuleLoader = ZipLoader??

Hey Folks,
i have big problem with resized container.
I have tested before without compressed swf files ( only *.swf goes SWFLoader = It works fine... SWFLoader works resized and scalabled mode. GOOD!
I have got an awesome idea with zip file - if i pack any swfs into zip file.
I have written:
MainApp.mxml:
<?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"
                           creationComplete="initApp()">
        <fx:Script>
                <![CDATA[
                        import deng.fzip.FZip;
                        import deng.fzip.FZipFile;
                        import mdm.Application;
                        import flash.system.LoaderContext;
                        private var zip:FZip = new FZip();
                        private var zipfile:URLRequest;
                        private function initApp():void {
                                //mdm.Application.init();
                                zipfile = new URLRequest(/*mdm.Application.path+*/"module.zip");
                                zip.addEventListener(Event.COMPLETE, onComplete);
                                zip.load(zipfile);
                        private function onComplete(e:Event):void
                                try
                                        var file:FZipFile = zip.getFileAt(0);
                                        file.filename = "SubApp.swf";
                                        var myLoader:Loader = new Loader();
                                        myLoader.loadBytes(file.content);
                                        var context:LoaderContext = new LoaderContext();
                                        context.allowCodeImport = true;
                                        contentLoader.loaderContext = context;                
                                        contentLoader.addChild(myLoader);
                                }catch (error:Error){
                                        /*      Error Message  */
                ]]>
        </fx:Script>
        <mx:SWFLoader id="contentLoader" left="0" top="0" width="100%" height="100%" autoLoad="true"/>            
</s:Application>
And SubApp.mxml:
<?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">
        <s:layout>
                <s:VerticalLayout paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10" verticalAlign="middle" horizontalAlign="left"/>
        </s:layout>
        <s:Label text="label one"/>
        <s:TextInput width="100%"/>
        <s:Label text="label two"/>
        <s:TextArea width="100%" height="100%"/>
</s:Application>
Compiled and pack into module.zip!
Look more pictures:
Flash Player loads swf from zip.
It works fine....
But i am shying because swfLoader won't resize and rescale? Oh no...
Why does it happen? Container was happen...
How do i fix with resizing and scaling mode
Thanks,
regards,
Jens-Peter

It is in a separate folder.  Should be under C:\Adobe\Adobe Flash Builder 4.5\sdks\4.5.1\frameworks\projects\mx\src\mx\controls

Similar Messages

  • 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

  • SWFloader loads SWF movie within Flex but not when compiled

    When I run my app in Flex, SWFLoader loads the SWF okay as a movie clip but as soon as I Export/Release Build, the new app SWF that is generated won't show the movie clip anymore.  If I take another SWF that is an app (not a movie clip) and give it the movie swf name, my compiled app will show the sub app in a frame.  Why would running something within Flex be any different than running a compiled version?
    Here is some of the code:
    button1 loads the swf.
    button2 loads a sound and when the sound is loaded, the sound is played and the swf is played in onSoundLoaded();
    public  function onSoundLoaded(event:Event):void{
    var localSound:Sound = event.target as Sound;localSound.play();
    var clip:MovieClip = MovieClip(swflodr.content);
    clip.play();
    private  
    function button1Handler(event:Event):void {Alert.show("test 1");swflodr.load(
    "dog.swf");Alert.show(
    "test 2");}
    private  
    function button2Handler(event:Event):void
    var s:Sound = new
    Sound();s.addEventListener(Event.COMPLETE, onSoundLoaded);
    var  
    req:URLRequest = new URLRequest("test.mp3");
    s.load(req);
     private function SwfLodrEventHandler(event:Event):void { 
    var clip:MovieClip = MovieClip(swflodr.content);clip.gotoAndStop(1);
    Alert.show(
    "The event loader is ready");}
    thanks, Mike

    Maybe timing?  The child SWF may not be fully loaded.  Sounds and SWFs are asynchronously loaded.
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Air Flex with work problem in swfLoader...

    Hello,
    I have a problem with swfLoader in Air Flex. I create a swf flash that must be loaded into Air application. When I run it insde of Flex Builder, all is ok. But when I install it, the embed flash dont work in component "InputText" and the TextField (in mode "InputText")... Simply I cant click in this and keyboarding... The problem dont is in SandBox...
    Thanks,
    Jonathan

    Due to some reason  the text input fields used inside the flash presentation are not editable only  when the application is running on installed AIR.
    When the flash  presentation is loaded in Flex it is not allowing the user click inside or edit  the text input, to over come this we are setting the focus to text input field  when ever the user clicks on it so that the cursor focus is set inside the text  input field and user will be able to enter data.
    Below is the code  change implemented in flash.
    inputText.addEventListener(MouseEvent.MOUSE_DOWN,  setFoucusToTextInput);
    function  setFoucusToTextInput (e:MouseEvent)
                stage.focus  = inputText;

  • Flex Builder 3 Error: Unable to load SWC

    Hi,
    I am trying to use the YahooMaps component (YahooMaps.swc) in
    my application. I have included it in the build path of my
    application.
    Steps followed:
    1. Right-click on the project and choose Properties or open
    the Project menu and choose Properties.
    2. In the project properties dialog, choose Flex Build Path.
    3. Select the Library path tab, and press the Add SWC...
    button.
    4. Selected the YahooMap.swc
    I still get "Unable to load SWC: YahooMap.swc". It is an AS
    3.0 component. Any help will be appreciated.
    Thanks
    Sumit

    Hi Peter,
    Thank you for your reply.
    I have followed the documentation on the site you provided.
    All I have done so far is:
    1. Create a new flex project in Flex Builder 3
    2. Once the project is created, I try to add the YahooMap.swc
    to my Flex build path.
    3. Once I add the YahooMap.swc, it fails with the error
    "Unable to load YahooMap.swc" in Flex Builder 3.
    4. FB3 does not recognize YahooMap when I try to import it in
    AS3.
    import com.yahoo.maps.api.YahooMap;
    I am not sure what I am doing wrong. Does it have to do
    something with the version Y! has used to build the YahooMap.swc
    and Flex Builder 3?
    Thanks
    Sumit

  • Help me!!! SWFLoader loads black screen in front of Flashpaper2

    if(printVB.getChildByName("fpSendfax")){printVB.re  moveChild(printVB.getChildByName("fpSendfax"));}
    var ldr:SWFLoader = new  SWFLoader();
    ldr.name = "fpSendfax";
    var url:String =  "flash/flashpaperloader.swf";
    ldr.load(url);
    ldr.addEventListener(Event.COMPLETE,  function(event:Event):void {printVB.addChild(ldr)});
    I use the above code to load a flashpaper which is generated by coldfusion cfc.  When I load the movie for the first time it works great.
    If i reload another movie I get a black screen and the flashpaper loads in the  background.
    why???
    It there anything we can do?

    I'm having the exact same problem... did you find a solution????

  • Flex 4 - is it possible to load xml data into the preloader and pass it to the application?

    or is there a similar method to load XML data while the preloader is active, so the XML data will be ready when the main application loads?

    i'm having great difficulty finding any relevant info from the forum and the web about accessing preloader variables from the application.
    is there a way to access the preloader itself from the application?
    It seems logical that the systemManager garbage collects it. If that's the case, how can i access the systemManager from the preloader and possible pass variables to it, then later access them from the application? this seems to be the best direction to tackle this problem. but maybe i'm overlooking another way?

  • Tour de Flex Sample - Managing Associations and Lazy Loading - 13800

    comments

    For that number of sections, you may want to consider leveraging an MVC framework like Mate ( http://mate.asfusion.com/ ). Mate (and, in general, most MVC frameworks) is more about application structure than application layout, but it provides some really useful guidelines for organizing your code for maintainability and testability. Mate even has a Google Code project of example applications: http://code.google.com/p/mate-examples/ .

  • How to resize swf module loaded by ModuleLoader according to parnet container?

    Hi,
    I have an Application MXML which contains ModuleLoader which loads external flex movie.
    I want that the loaded module should adjust its size atomatically based on its parent container.
    Can anybody help on this issue?
    Thanks,
    Prithvi Zankat.

    Hi,
    I have an Application MXML which contains ModuleLoader which loads external flex movie.
    I want that the loaded module should adjust its size atomatically based on its parent container.
    Can anybody help on this issue?
    Thanks,
    Prithvi Zankat.

  • Loading purchased swf into Flash Builder 4 Flex app

    I have purchased a Flash "fundraising thermometer" from an online Flash components site. It takes input from an xml file and displays a thermometer with the goal at the top and the current amount raised indicated. It came with the following files:
    thermometer.swf
    thermometer01.fla
    thermometer01.html (A sample that works.)
    xml/thermometer.xml (The source file: goal amount, current amount, mark interval, etc.)
    caurina/transitions (Mostly .as files.)
    Since the test html (thermometer01.html) works fine, I thought this would be a no-brainer.
    I first unzipped the files into a "thermometer" folder in my current project. I then went into Flash Builder and created a SWFLoader object as follows:
    <mx:SWFLoader 
    id="myLoader" source="../thermometer/thermometer.swf" complete="initThermometer();" autoLoad="true" scaleContent="false"/>\
     private function initThermometer():void { 
         Alert.show('Thermometer loaded');
    The Design view looks fine. I can see the thermometer default image (see below).
    When I run the app, I get no errors, just a broken image link in a box (see below). The alert box also never shows up.
    I'm new to Flex, so I may be doing something stupid that keeps this from working. I contacted the author of the thermometer widget but he doesn't know anything about Flex.
    Any help figuring out how to get this to work in a flex app would be appreciated.

    You should probably add more event handlers to see what's going on.  Especially "ioError". The complete list is below.  For coverage, add a handler for each event. You can also use in MXML
         complete="initThermometer(event)
    and add an argument to your Actionscript method, to find out details about the event.
    private function initThermometer(event:Event):void { 
         Alert.show('Thermometer loaded ' + event.type);}
    Events
        complete="No default"
        httpStatus="No default"
        init="No default"
        ioError="No default"
        open="No default"
        progress="No default"
        securityError="No default"
        unload="No default
    General info here:
         http://livedocs.adobe.com/flex/3/langref/mx/controls/SWFLoader.html
    I did not test my code suggestions, but it's probably close.

  • Load flex swf as a child swf

    Is there anyway to load a flex (or any swf with AIR capabilties) into a parent swf?

    I just found out you can load the flex SWF directly into the swfLoader... I feel very stupid now. Should have tried that a longggg time ago.

  • Flex 2 SWF not loading on the web browser when Flash Player 8 is running

    I got a Flex 2 application that is not loading on the web
    browser when the users workstations got Macromedia Flash Player 8
    installed. Please advice on what could be the issue, i got security
    calls included i.e. securty.allowInsucureDomain, crossdomain.xml,
    etc.
    The application shows no issues on web browsers with Flash
    Player 9 installed.

    if you have read developersGuide it says that there somewhere
    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part2_DevAp ps_048_1.html
    here is workaround
    http://kb.adobe.com/selfservice/viewContent.do?externalId=749eaa47&sliceId=1
    flex 9 is complete rewrite (almost) and its lot mor fast and
    effecient) you should't want to use flash 8 if you can anyways, but
    somethimes I guess there is not other way out..

  • Flex query on URLLoader.load()

    Hello all,
    I just started to learn flex/actionscript. I developed a simple flex project for experimenting with URLLoader.load() and used trace() to get the order in which methods are being called. I could not understand the order in which trace outputs are displayed. My code is :
    package LoadPack
        import flash.events.Event;
        import flash.events.IOErrorEvent;
        import flash.net.URLLoader;
        import flash.net.URLRequest;
        import mx.controls.Alert;
        public class ApplInfo
            private static var instance:ApplInfo = null;
            private var applInfoXML:XML = new XML();
            private var serverForAppl:String = "DataAccessLocalApplServer";
            private var applContextRoot:String = "DataAccessLocalApplContextRoot";
            private var selectedServer:String="";
            private var selectedServerContextRoot:String="";
            private var selectedServerLabel:String="";
            private var selectedServerContextRootLabel:String="";
            public static function getInstance():ApplInfo {
                if(instance == null){
                    trace("ApplInfo instance is null");
                    instance = new ApplInfo();
                    trace("ApplInfo instance created");               
                return instance;
            public function ApplInfo()
                trace("inside ApplInfo constructor");
                getApplProperties();
                trace("selectedServer..getApplProperties -> "+this.selectedServer);
                trace("selectedServerContextRoot..getApplProperties ->"+this.selectedServerContextRoot);
            private function getApplProperties():void{           
                trace("inside getApplProperties");           
                var applXML:String = "assets/ApplInfo.xml";
                var urlReq:URLRequest= new URLRequest(applXML);
                var urlLdr:URLLoader= new URLLoader();
                urlLdr.addEventListener(Event.COMPLETE, doOnComplete);
                urlLdr.addEventListener(IOErrorEvent.IO_ERROR,doOnError);
                trace("before load");
                urlLdr.load(urlReq);
                trace("after load");
            private function doOnError(evt:Event):void{
                Alert.show(evt.toString());
            private function doOnComplete(evt:Event):void {
                trace("inside doOnComplete");           
                var urlLdr : URLLoader = evt.currentTarget as URLLoader;               
                applInfoXML = new XML(urlLdr.data);           
                for each(var serverXML:XML in applInfoXML.application.servers.server){
                    if(serverXML.@type == serverForAppl){
                        this.selectedServer = serverXML.text();
                        this.selectedServerLabel = serverXML.@label;
                for each(var contextRootXML:XML in applInfoXML.application.contextroots.contextroot){
                    if(contextRootXML.@type == applContextRoot){
                        this.selectedServerContextRoot = contextRootXML.text();
                        this.selectedServerContextRootLabel = contextRootXML.@label;
                trace("selectedServer..doOnComplete -> "+this.selectedServer);
                trace("selectedServerContextRoot..doOnComplete -> "+this.selectedServerContextRoot);
            public function getApplURL():String{
                trace("selectedServer..getApplURL -> "+this.selectedServer);
                trace("selectedServerContextRoot..getApplURL -> "+this.selectedServerContextRoot);           
                return this.selectedServer + this.selectedServerContextRoot;           
    I am calling this AS class from another class as
    ApplInfo.getInstance().getApplURL();
    and I am getting the following trace output.
    ApplInfo instance is null
    inside ApplInfo constructor
    inside getApplProperties
    before load
    after load
    selectedServer..getApplProperties ->
    selectedServerContextRoot..getApplProperties ->
    ApplInfo instance created
    selectedServer..getApplURL ->
    selectedServerContextRoot..getApplURL ->
    inside doOnComplete
    selectedServer..doOnComplete -> http://localhost:8090
    selectedServerContextRoot..doOnComplete -> /DataAccessProj
    My understanding is that once load completes its operation, the event handler for Event.complete will be executed and in my case the method doOnComplete(evt:Event) should be executed. After that only, the code proceed to subsequent statements. But trace output does not look that way.  I will be missing something seriously but could not find out.   I already spent one day on this. I am also attaching the project. Please help..

    Load() is asynchronous and does not block so the line right after it runs right away while we wait for the network to respond
    Alex Harui
    Flex SDK Developer
    Adobe Systems Inc.
    Blog: http://blogs.adobe.com/aharui

  • Flex Load Balancer Environment URL Redirect

    Hi,
    Our Flex application is running on a load balancer environment, where SSL is terminated.  From the browser to load balancer, the connection is using https and from the load balancer to the server, it is http. What we are noticing is, when the https url is invoked on the browser, it immediately redirects the url from https to http. This breaks the connection and an error message unable to connect is shown on the browser.  We traced the network traffic using the Live HTTP headers, it showed the same redirect in the url with the message HTTP/1.1 302 Moved Temporarily.
    Please let me know, how i can resolve this issue. Also let me know, if you need any other information from me.
    Thanks for your help.
    Murugan.

    I'm kind of a newbie on the netscaler. What od you mean by stick? We keep persistence by a cookie insert.
    I did find out what the issue was, our E1 installation sits on port 8086, so from the netscaler we would reroute the port 80 calls from jdesso.xxx.local to the E1 server, but for some reason when the handoff came back from OID to E1 the load balancer somehow realized the app server was running from port 8086 and it mixed the whole process up (instead of keeping all traffic to and from the client on port 80). To workaround this I created a new virtual server to listen on port 8086, then I redirected the port 80 calls to new 8086 VS, and then from the 8086VS to the app server and it worked correctly.

  • Flex Generated Swf Donot load in Flash On Publishing.

    Hello!
    I am facing one problem,I made a calendar.swf in flex.
    and I am trying to load that calendar.swf file in flash file get-calendar using Loader Class.
    calendar.swf is coming fine when I press cntrl+Enter
    i mean during compiling swf.
    But when I publish that using F12 then that flex swf donot load.
    What is the reason,,I dont understand it.
    Pls help!
    Thanks

    calendar.swf is compiled to run in the local-with-networking sandbox, while get-calendar.swf runs in local-with-filesystem. Loading one into the other causes a security error. Simplest solution is to change get-calendar.fla to local-with-networking:
    Publish Settings (Flash tab). Select Access network only in Local playback security.

Maybe you are looking for

  • Class not found in jar

    I have a servlet that is using request.forward() to invoke a class in a jar file. This class is in the class path, as below. However, when that class runs, it cannot find other classes in that same jar file. In my resin.conf file I have: <web-app id=

  • Using Dynamic Tabs in 11gR2 doesn't seem to work.

    Hi there, I'm trying to use the Dynamic Tabs Template in an ADF 11.1.2.3 application using JHeadstart 11.1.2.1.28. According to the developerguide section 9.3.1. (Enabling Dynamic Tabs) it should be rather easy to do this. Set PageTemplate to : /comm

  • Exporting an InDesign book of documents into InCopy

    I work with a lot of books, and I frequently get the request to suddenly provide an entire book of documents in InCopy to an editor (on or offsite).  I'm just curious if anyone knows of a plugin or script that does all the manual work of opening each

  • How to display MANDT field in ALV Grid display?

    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING    I_CALLBACK_PROGRAM                = LV_REPID    I_STRUCTURE_NAME                  = 'ZSTR_TRAIL'    I_SAVE                            = 'A'   TABLES     T_OUTTAB                          = it_output

  • In systems preferences display there is no arrangement tab, in systems preferences display there is no arrangement tab

    in systems preferences display there is no arrangement tab i had it in OSX 10.8 but not in mavricks