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.

Similar Messages

  • Flash builder flex app

    Hy,
    I went to create a flex app, I need some help on:
    - How to choose the action of a button
    - How to integrate the RSS
    Thinks a lot
    Thomas

    Hy,
    I already made the main menu:
    But the "ligne n" button does not make any action,whereas I want that when I click on this button , a new page with a RSS feed appears.

  • Can I load a swf into my Flex app that loads other swf's?

    The code below loads an AS2 swf into my Flex mobile for IOS app and it works.  If that AS2 swf has like a circle in it that runs across the stage, it loads and displays properly when run in FlashBuilder.
    <?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"
                                     initialize="init()">
              <fx:Script>
                        <![CDATA[
                                  import mx.core.UIComponent;
                                  private var request:URLRequest = new URLRequest("http://PATH_TO_AS2_SWF");
                                  private var loader:Loader = new Loader();
                                  private var myComponent:UIComponent = new UIComponent; 
                                  private function init():void{
                                            myComponent.percentHeight = 100;
                                            myComponent.percentWidth = 100;
                                            loader.load(request);
                                            myComponent.addChild(loader);
                                            player.addElement(myComponent);
                        ]]>
              </fx:Script>
              <s:Group id="player"
                                   height="100%" width="100%"/>
    </s:Application>
    But if that AS2 swf loads other swf's, they don't load or display.  My FlashBuilder debugger reports no errors or security sand box violations.   I'm using the most elemental code in my AS2 swf so as to not cause problems.  This is it in its entirety:
    this.onLoad = function(){
              _root.loadMovie("http://[PATH_TO_REMOTE_SWF]");
    The paths to the remote content are fine because swf's load and display fine from AS2 swf when run on it's own - not embedded in Flex app.  They also load and run fine if I cut out the AS2 swf and access directly from my Flex code.  So I know there isn't a path issue.  More likely not accessing the right layer in the AS2 swf from Flex or something.  Or maybe security sandbox violation but I don't see anything reported in the FlashBuilder debug console.  When run console just reports:
    [SWF] SwfMobile.swf - 2,639,761 bytes after decompression
    [SWF] assets/swf/AS2.swf - 1,470 bytes after decompression
    Is there something inherently wrong with loading swf's that load other things?  Even if I have the AS2 swf load jpgs they don't load so the format of the target content at the end of the chain doesn't seem to be the issue.  Just the act of embedding a swf that loads other things seems to be the problem.

    Ah, yes. Using an AVM1 SWF could prove difficult...
    I'm going on about 3 hours of sleep at the moment, but let me toss out a few thoughts I have and hopefully something will stick...
    Ok, so my first thought what to try and cast the loaded content as a MovieClip and call methods on that, but the fact they are AVM1 throws that out the window.
    That leaves LocalConnection, as you mentioned. But this would require you to have code on the receiving end to handle the connection... no good either.
    But what if you created a "bridge" in AS2 that holds all the code for the receiving end of LocalConnection (or has the control logic itself, perhaps even eliminating the need for LocalConnection all together!). I think maybe this is what you were trying to do already by loading a SWF into a SWF? Well instead of loading your bridge at runtime, what if you statically linked it into your project as a class?
    *a few moments later*
    Well it looks like you can in fact link in a a symbol created for AVM1, but it will only come in as a SpriteAsset, and will not include any custom code (which makes sense, since they use entirely different class constructs).
    To do the test, I created a symbol exported for actionscript (AS2/Flash8), then linked it in with a CSS style embed. I then instantiated the class and called describeType on it.
    So in summery, it looks like calling custom code on the bridge is out (I did not test this extensively, that was just my first impression with this simple test). However, if you may be able to perform the actions you need by attempting to cast the loaded content into something AVM2 can recognize. Apparently it does this automatically when linked in statically, so maybe there is something there worth looking into... mainly, can you do what you need using only the base class and no custom code?
    Keep me posted!

  • Flash player 10.3.181.14 broke my site, loading multiple swfs into an array

    I load multiple swfs into an array, I add and remove the objects on the stage, this is for a rotating carousel.
    All the items locations are established in xml. If I only have one item loaded into the array it works fine, if I have more then one it will not a) play the swf, or b) show the swf.
    The swfs themselves contain code that fire events in the main container. Which cause other items to play or load.
    Is anyone else having this issue?

    Hi howet,
    EDIT:
    I've opened a flash bug in their bug system as I found I could reproduce the issue: https://bugs.adobe.com/jira/browse/FP-7071
    There are some workarounds I found on there.
    ORIGINAL MESSAGE:
    I was having a similar issue using a loading component which i've been using for several years with no issues. As with you the issue arose when loading multiple swfs (or even one swf and then a jpg) on 10.3 and above. It works fine on 10.2 and below still.
    I found a workaround whilst I look for a proper answer and that is to delay subsequent loads using a hacky setTimeout.
    For example:
    protected function manageLoaded (p_event : Event) : void {
    setTimeout(loadNext, 1);
    // following line breaks the gotoAndStop of loaded swfs.
    // loadNext();
    I hope this helps you too, let me know.
    Cheers,
    Dan.
    Message was edited by: Dan Wilkinson, 01/06/2011 11:37am BST (GMT + 1)

  • Embedding swf into HTML+JS AIR app

    Hi
    I'm trying to embed swf into HTML+JS AIR app with no luck.
    First, I created flash library with this class in default package.
    package
         import mx.controls.Alert;
         public class Utilities
              public function Utilities()
                             //asdfasdf              
                   Alert.show("asdasd","");
    Then I compiled the project with Flash Builder and got library.swc as result. Then I extracted swf file.
    After this is added required code into my html:
    <html>
    <head>
        <script type="text/javascript" src="AIRAliases.js"></script>
        <script type="text/javascript" src="AIRIntrospector.js"></script>
        <script type="text/javascript" src="jquery-1.6.2.js"></script>
        <script src="library.swf" type="application/x-shockwave-flash"></script>
        <script type="text/javascript">
            $(document).ready(function () {
                alert('loaded');
                air.Introspector.logError("aaa");
                var v = new runtime.Utilities();
        </script>
    </head>
    <body>
    </body>
    </html>
    Then after I run application, I get error that result of expression is not constructor, function etc.
    Could you help me please?  Thanks in advance.
    Here is sample code:
    http://depositfiles.com/files/jztpnlb3a

    No. I mean that the Flex framework makes certain assumptions about the environment it is running in -- like having a stage to work with. The Alert function, for example, works by creating a sprite and adding it to the Flash display list. Since your embedded SWF is not on a stage, there's no way for it to work.
    You can can possibly use certain non-visual parts of the framework, such as the rpc package, but I can't guarantee it.

  • Gif to swf...what to do to keep this timing of gif, in swf in Flash Builder(FX)? I converted the gif

    http://forums.adobe.com/message/4005827#4005827
    gif to swf...what to do to keep this timing of gif, in swf in Flash Builder(FX)? I converted the gif with FW... but run too fast what ever I do...

    you convert your gif to a swf and you're not happy with the conversion?
    if yes, either look for different conversion software, check for info on your current conversion software or don't convert and load your gif into your swf:  http://creative-geeks.com/blog/2010/06/30/using-animating-gifs-in-flex-and-flash/

  • How to easily get an Adobe Flash CS5.5 Professional project into Flash Builder 4.5?

    Hey all,
    I am new and trying to do the following, can you please guide/help me do it:
    I have a video chat application that is done on Adobe Flash CS5.5. I had the problem of "echo" so I wanted to use "getEnhancedMicrophone()". When I replaced "getMicrophone()" with "getEnhancedMicrophone()", Adobe Flash CS5.5 Professional didn't recognize it. I knew I need Flex, so I installed Flash Builder. And then got lost. What I simply want is just import my "FLA" file (or if I need to convert it to something else using a specific tool, let me know.. I have Adobe Flash CS5.5 Professional and can install other required applications if needed) done on Adobe CS5.5, into Flash Builder, and then "support Flex" so that I compile with the flash-version argument required.
    I am totally new to MXML and Flash Builder, and even Flex. I don't know how to import a FLA and add "Flex" libraries into it simply to make "getEnhancedMicrophone()" work without the need to recreate the whole thing on Flash Builder. Can you guide me please? The output is for a web SWF file, not a desktop application.
    Thanks!

    I have the same problem here. I'm trying to do a stick animation on cs6, but to be more precise, i need to actually draw with a larger brush size. I suggest using the pen tool with the smooth option on. You can't see exactly where the stroke will be, but its better than nothing, and it more or less acts like the brush anyway.

  • Load AS2 swf into AS3 swf problem

    I have a flash with AS3 and inside this swf i load in a AS2 swf.
    to load swf works just fine, but the problem is when i load this i want to go to
    a specific part of it, for example i want to go to frame 3 in the loaded swf.
    i must control this from the AS3 swf, does someone know if this is possible?
    thanks in advance

    so can i do like this then to go to frame 3 in my loaded swf?
    MovieClip(ldr.content).gotoAndStop(3); ?
    sorry for being such an airhead
    thanks for helping me out =)
    Date: Sun, 7 Jun 2009 10:25:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: load AS2 swf into AS3 swf problem
    no.
    if, in your loaded swf, you have a function f1() on the loaded swf's main timeline and you load that swf using a loader (say ldr), use:
    MovieClip(ldr.content).f1();   // to call f1() in the loaded swf
    >

  • Transition from my firefox extension to a Flash Builder desktop app

    Trying to make a slow transistion from my firefox extension to a Flash Builder desktop app.
    Okay i'm not familiar on how to go about this I have js code that lets my app sync it self with the lates build it looks for a new version number which is in a txt file. Inside the txt file I have 0.0.0 so evertime I change the version number to 0.0.1. The app checks for new updates and sees the txt file has a new version number and start to pull in the zip file and extrudes the zip into the directory.
    I can't get my head around on how to modify this code ["@mozilla.org/extensions/manager;1"].getService
    to look in the root directory of my Flash Builder app.
    function Xcalibur_Sync(){
        document.documentElement.getButton("accept").disabled = true;
        var Cc = Components.classes;
        var Ci = Components.interfaces;
        var url = xcaliburGetUnicharPref("extensions.xcalibur.downloadurl");
        var Step1 = document.getElementById("xcalStep1");
        var Step1done = document.getElementById("xcalStep1Done");
        var Step2 = document.getElementById("xcalStep2");
        var Step2done = document.getElementById("xcalStep2Done");
        var Step3 = document.getElementById("xcalStep3");
        var Step3done = document.getElementById("xcalStep3Done");
        var Step4 = document.getElementById("xcalStep4");
        var Step4done = document.getElementById("xcalStep4Done");
        var xcalSyncDone = document.getElementById("xcalSyncDone");
        var progressMeter = document.getElementById("xcalProgressMeter");
        var progressPct = document.getElementById("xcalProgressPct");
      // Get Xcalibur version and location
        var GUID = "[email protected]"
        var gExtensionManager = Cc["@mozilla.org/extensions/manager;1"].getService(Ci.nsIExtensionManager);
      //var currentVersion = gExtensionManager.getItemForID(GUID).version;
        var currentVersion = xcaliburPrefs.getCharPref("extensions.xcalibur.installedversion");
        var xcaliburdir = gExtensionManager.getInstallLocation(GUID).getItemLocation(GUID);
        var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
        file.initWithPath(xcaliburdir.path);
        //Step 1 - See if an update is available
        Step1.setAttribute("hidden", "false");
        var req = new XMLHttpRequest();
        req.open('GET', url+"CRV.txt", false);
        try{
            req.send(null);
        }catch(e){
            alert("Cannot get update information from "+url+"CRV.txt\n"+e.toString()+"\n\nSync aborted ...");
            window.close();
            return false;
        }//try
        if(req.status == 200){
            var CRV = req.responseText;
    Any Ideas?
    Thanks,
    Ish

    Have you taken a look at the documentation on updating AIR applications?
    http://help.adobe.com/en_US/AIR/1.5/devappsflex/WS5b3ccc516d4fbf351e63e3d118666ade46-7ff2. html
    Or is it something else you wish to do? You can access the directory where your app is installed by looking at File.applicationDirectory and you can hit a URL by using URLRequest.
    -Anirudh

  • Import a video player made in flash cs4 into flash builder 4

    I want to import a video player made in flash cs4 into flash builder 4. Are there any pitfalls that i should be aware of?

    pdf is not a supported file type in flash.

  • Loading php variables into flash 8

    i'm trying to load some vars into flash 8. i tried
    loadvariables, loadvariablesnum, loadvars, google. can't figure it
    out.
    2 years ago when using flash mx trying the same thing, the
    line:
    loadVariablesNum("file",0);
    was enough to do the trick.
    but in flash 8 can't get it to work ;(
    i have the simplest php file, something like this:
    <?
    $town = "where";
    $person = "who";
    $sex = "male";
    print "town=$town&person=$person&sex=$sex";
    ?>
    the use of variables is a must, so the solution
    print "town=where&person=who&sex=male"
    doesn't do me any good. actually this works.
    so what's the correct way of loading this into flash 8?
    thanks guyz.

    you can also use a FlashVars= parameter in your
    <object><embed> code, IF you are using your PHP code to
    also display your flash movie, and if you only need to pass these
    variables once when the movie loads. If this is what you need to
    do, use this....
    <object ...>
    ....// other params .....
    <param name="FlashVars" value="<?
    echo var1name;
    ?>=<?
    echo var1value;
    ?>&<?
    echo var2name;
    ?>=<?
    echo var2value;
    ?>" >
    Though you will have to do that in two places, once in the
    object code, and once in the embed code.
    The embed code would look more like
    <embed ...... FlashVars="<? //php similar to above
    ?>" ..... />
    I have used this successfully to pass in variables when the
    flash movie first loads, to pass in stuff like a URL for a link and
    other info. There are a lot of different ways to pass values in to
    flash. You can also use ExternalInterface.call and use Javascript
    along with PHP to retrieve info at any time, but that is more
    complex.
    This may not be what you need - but you can still use
    LoadVariables with Flash 8, as well.

  • Load external jpeg into flash movie

    Hi, how do i load external jpeg into flash movie?
    Can someone show me the actionscript? Thanks

    hi, i pasted the code on a mc but it didn't work.
    However, when i put in on frame action, it works.
    However, i realised the image flickered (more like refreshed)
    after afew sec...
    Is this normal? Is it the loop problem? how do i get rid of
    that?

  • How to Load an SWF into the Parent SWF

    Hi all,
    I have 3 SWFs.
    X.SWF - Parent application. Contains an empty movie clip for
    loading external swfs using loadClip() method.
    B.SWF - Has some text and pics. Gets loaded into the empty
    movieclip on X.SWF. Also has a button saying 'Load A.SWF'.
    A.SWF - Similar to B.SWF with a button saying 'Load B.SWF'.
    When I start the main application (X.SWF) and load B.SWF into
    it all is fine.
    But would like to click on the 'Load A.SWF' button on B.SWF
    and load A.SWF into X.SWF. And visa-vesa.
    The problem is I'm not able to refer to the parent container
    (X) from these child (A and B) SWFs.
    Is there any way to do this?
    Thanks

    First if you use
    Button.onPress=function(){
    this._parent.loadMovie();
    the movie try to load swf into B.swf because "this" mean the
    button.Try with more ._parent or just if you X.swf is into the one
    MovieClip in 1st stage _level0.SWF.loadMovie();.Also if you want to
    load the A,B.swf into the stage simultaneously just create two
    movieclips into the X.swf mcA and mcB and the path has gone to
    _level0.SWF.mcA.loadMovie("A.swf"); :)

  • Trouble Import Flash Builder 4 project into Flash Builder 4.5

    Hi,
    I have quite a lot of Flash Builder 4 Air project which I would like to convert all of them into Flash Builder 4.5 project. However, after I tried to import it into 4.5, the project got error and saying that "application descriptor not found".
    I am posting it here because I believe it is due to improper import of the air project into 4.5. Flash Builder 4.5 should be intelligent enough to solve the problem when converting the project. Hope there will be a fix for it soon
    Btw, how can I manually solve this problem so that I can get all my previous projects run on 4.5? Thanks.

    Hi Yue,
    I'm sorry you're running into problems with Flash Builder.  Would you mind reposting this over on the Flash Builder forums?  You'll probably have better luck over there.
    Thanks,
    Chris

  • Installing Flex SDK into Flash Builder 4.7 problems

    Hi,
    Im completely new to Flash Builder, today I have installed Flash Builder 4.7 & Flash CS6 from Creative Cloud for my son to start to learn game programming (with my help), I have used simple coding in web design however this terminology is new to me.
    I bought my son the latest 'Foundation Game Design with ActionScript 3.0' book on recommendation but it was written when FB was version 4.5 so im guessing this might be the problem.
    The book is very easy to follow but have hit problems at the beginning of the tutorials, the book talks about Flex SDK but it seems that FB 4.7 uses AIR SDK ?
    So the first project called HelloWorld, we got up to:
    Got an exclamation mark which said
    'The import flash.display.Sprite is not used
    locally'
    Continuing with the rest of the project the exclamation mark disappeared:
    However on selecting run- Debug we got a blank Flash Player window  ('generate HTML wrapper file' was deselected)
    So either we've done something wrong, or the book and FB version are not compatible?
    Any advice would be great!
    Thank you
    Latest ...
    I thought that installing Flex SDK may solve the problem but after following instructions I have the error message, see image below. Really stumped now!

    Sorry, if I went a little overboard. After re-reading your post, perhaps I should back up a little.
    First, there are little things that Flash Builder (FB) will complain about. Having extra import statements in your code doesn't hurt anything. If I'm trying different solutions and then commenting out the code, the import statements will hang around, FB will complain, but just ignore it. If you see a little icon on the left edge of your code editor and its a red circle with an X in it, then that is something that will have to be fixed.
    When you create an app in FB or Flash you can choose to create a web app which means it will run in a browser window. The project can optionally create an HTML wrapper, or web page that will load your app. In Flash Pro you can choose File->Publish Settings and there will be a checkbox on the left to publish a HTML wrapper. In FB, you can right click your project in the Package Explorer, select Properties at the bottom, select the ActionScript Compiler, and down at the bottom there will be a checkbox to create a HTML wrapper.
    If you're just learning Flash Builder, then the FlexSDK 4.6 and the AIR SDK 3.1 that comes with it should be fine. You mentioned Apache SDK and I'd recently been working with that so I ended up getting side-tracked.
    Getting an AIRSDK to work with when build ActionScript projects is easy. Just go to the adobe site, type AIR SDK in the search box, and you should find a page that will let you downloaded the latest version. There's also a page to let you download the latest AIR runtime, and if you were just going to run AIR apps and not build them, then that's all you would need. As a developer you'll want to install the runtime from the downloaded .exe file. With the SDK, after downloading it, installing it is easy. Just create a new folder an unzip the SDK into it, then place it somewhere easy to find. I put all my SDK's in their own directory right off the c: drive. So I have c:\AIRSDK_3.5.0.880 and c:\AIRSDK_3.7.0.1530. I use very descriptive folder names so I always know which SDK's I have to work from.
    To use the SDK in Flash Pro select Help -> Manage AIR SDK, hit the plus button and add the folder you created. Now when you've opened a Flash project, you go to File->Publish Settings and select the combo box at the top, you'll see options like 'AIR 3.7.0.1530 for Android' in the list that reflect the SDK's you've added.
    Generally with FB you'll be using a FlexSDK, or perhaps a FlexSDK overlaid with a newer version of AIRSDK. Overlaid basically means you copied the contents of the AIR SDK into the Flex Folder. The article I mentioned above will give you all the details on creating those. For instance, I downloaded the Apache Flex installer, installed it, then created an empty folder called c:\ApacheFlexSDK_4.9.1, launched the Apache installer, gave it the new empty folder I'd created, selected all the download options, and let it all download. If it launches a popup box or a security warning, you can allow it, and it will continue. Once you have the SDK and you want to use it with a project in FB, just right click the project, select Properties, selected that Compiler tab again, and up in the right corner you'll see 'Manage SDK's...'. Hit that link, add your new SDK to the list and give it a descriptive name, then selected the checkbox beside it to set it up as your default. If you do this, then all your projects set to use the default will automatically switch to it and rebuild. So if you want a project to stay with a specific SDK then select that option in your Compiler tab, and then you could use the combo box to select your new added SDK.
    When I started with FB I think I spent the first 2 days going round and round with project settings and options until I got them all figured out.
    When I develop, I usually have my browser open and I have bookmarks and favorites to let me quickly get to all the pages I use most often. Here are a few of them:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/index.html  <---- The API reference. In the packages window check out 'Top Level' at the top and Language Elements near the bottom. I think I have this page open in one or more tabs almost every day.
    http://www.adobe.com/devnet.html
    http://www.adobe.com/devnet/actionscript/learning.html
    http://help.adobe.com/en_US/as3/learn/index.html
    http://helpx.adobe.com/flash.html
    http://help.adobe.com/en_US/flashbuilder/using/index.html
    Free videos to help you learn Flash Pro:
    http://tv.adobe.com/show/learn-flash-professional-cs6-/
    http://tv.adobe.com/show/learn-flash-professional-cs5/
    And you've already found the forums! But if you don't find an answer here, many times you can find your question already answered on www.stackoverflow.com forums.
    Ok, I think I went a little overboard again.

Maybe you are looking for

  • Restoring multiple iPhones, updates prompt with wrong credentials?

    Good morning all, At my job I am responsible for deploying new iPhones to our users. We recently upgraded all iPhone 4 devices and are giving users iPhone 5c. I connect their old devices to my computer to back them up as a new device, and when I conn

  • Is there any substitute for book publication?

    We are currently running BPC Microsoft version and considering migrating to the Netweaver platform.  I understand the Book Publication Wizard is not available in Netweaver.  We use this feature to generate lengthy reports and losing it would make rep

  • Is Digital Asset management module is part of Webcenter content

    Is Digital Asset management module is part of Webcenter content? Then, WebCenter sites is the latest version of fatwire. Is digital asset management module included in it?

  • Outgoing messages fail

    All of the sudden I can not send email from my Iphone.   I can receive email from my comcast account but when I send I get Cannot Send Mail, The user name or password for SMTP.... is incorrect. How is that possible?  I have not changed it and I can r

  • CSConfigDotMacCert in 10.7.2

    I searched here and on Google and haven't been able to cure this issue. 2011 MacBook Air 10.7.2 three user accounts; two standard, one admin (I use MobileMe on only one of the standard accounts) When I login to the account that uses MobileMe, I get a