Embedded container swf loading swf with xml

I'd call myself an intermediate AS3 newbe. I have a series of slideshows that is called by a 'container' Flash file.
These slideshow swf files are now rather large (230 kb) so as a test, I redid one of them as a  Flash file that uses xml rather than the images called within the file itself (file size 68 kb), which is my first exploration into xml & AS3.
All the non-xml files load and play fine locally (well, sort of, since there's some weird glitchs which show up in different ways at different times in the container loading too many files one after another at times - and sometimes there's no problem at all) but that's not my current problem here.
Basic URL structure:  document relative
1. container file (container.fla/container.swf) will be embedded in a html file. --> /Flash.container.swf The contain file has a series of links to other .swf files.
2. The container file other .swf files (selection of 10) from a  subfolder called /sbrds i.e. --> UILoader loads "Flash/sbrds/albert.swf"
3.  The albert.fla/albert.swf loads an xml slideshow from a subfolder of sbrds  called /AlBert  --> /Flash/sbrds/Albert code "loader.load(new URLRequest("AlBert/AlBertXX.xml"));"  (quotes in message only)
4. Inside the /Albert folder I have the xml file and all the images. xml file  is AlBertXX.xml  (attached)  
5. local structure --> desktop/workingFiles/storyboards (container.fla) /Flash /sbrds (albert.fla) /Albert (Albertxx.xml & image.jpgs)
would equal on the server as  root html/Flash/sbrds/Albert
Locally... The albert.fla (in the /Flash/sbrds folder) itself works fine with no errors when calling the xml file.  But when I test that file from the container.fla/swf  I get a 2044/2032 error "Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: file:///.../myLocalDesktopFolder/storyboards/AlBert/AlBertXX.xml      at albert_fla::MainTimeline/albert_fla::frame1()"
I've check and rechecked for any typos in the xml slideshow test and don't find any.  Any ideas?
Could it be that I'm calling a xml driven file from a non-xml driven file?
I have all the files including my buggy htm file at http://www.danwelter.com/susanTest_static.htm
All the pertinent fla and image files are in the /flash folder (too many to attach).
-- Thanks --- Susan

Hi Jan
Apparently the update went into place on my personal laptop
overnight last night. I awoke this morning to discover it had
rebooted itself and it was patiently waiting for me to enter my
bootup password. Anyhoo, I happened to notice that today when I
hovered the mouse over my Captivate movie, I saw the dreaded
“click to activate and use this control” message that
popped up in a tooltip. What to do?
Well, I did notice that it seemed to require a mouse click to
"activate" the control, but simply running the movie seemed to be
fine. I then wondered what would be disabled. When my movie got to
the first button, the initial click was used to enable the control.
Then the second click was accepted and progressed the movie.
I hopped out on the web and found a page at the following
URL:
http://www.amarasoftware.com/flash-problem.htm
After following the instructions there, my files seemed fine.
Here are the steps I followed:
1. Copied the code on the page and pasted into an empty
Notepad.
theObjects = document.getElementsByTagName("object");
for (var i = 0; i < theObjects.length; i++) {
theObjects
.outerHTML = theObjects.outerHTML;
2. Saved as file name ieupdate.js.
3. Copied the link code and pasted between the closing object
and center tags.
Before:
</object>
</center>
After:
</object>
<script type="text/javascript"
src="ieupdate.js"></script>
</center>
It occurs to me that one could easily modify the "seed" HTML
page Captivate uses when it creates the HTML page. This page is
named standard.htm and is found in the following location:
C:\Program Files\Macromedia\Captivate\Templates\Publish
This would save tweaking the HTM each time you publish. Then
you would only need to worry about making sure you copied the
associated ieupdate.js file to the same folder.
You gotta love lawsuits. I really hope those that "won" are
happy that we all now have to jump through all the hoops to make
things work. Sheesh
Hopefully this helps... Rick

Similar Messages

  • Using embeded fonts in loaded swf.

    I have a .Swf, which has 3 fonts embedded in it, they are all exported in frame 1 for AS.  This swf loads any number of external .swfs which have dynamically generated textfields inside of them.  This text must be embedded text because effects may be applied to them.  I do not want to embed the three fonts into every external swf, and do not think I should have to.  The font exists in the Loading swf and I have registered the fonts to the global font list.  If I print this list from the loaded swf, all three fonts are present, but when I try to use any of them, my textfiels are empty.
    My question is how do I utilize a font which is embedded in a swf, from a swf which has been loaded into that swf?
    From my external swf, this code:
    [PHP]var embeddedFonts:Array = Font.enumerateFonts(false);
    embeddedFonts.sortOn("fontName", Array.CASEINSENSITIVE);
    trace(embeddedFonts);[/PHP]
    produces the following:
    [PHP][object CenturyBook],[object MyriadProRegular],[object MyriadProItalic][/PHP]
    which are the three fonts that are embedded in the loading swf, So I assume the LOADED swf has access to these fonts.
    When I apply this code to the externally loaded swf:
    [PHP]var FontClass:Class = getDefinitionByName("MyriadProRegular") as Class;
    trace("FontClassInstance -> " + FontClass.toString());
    var linkedFont: Font = new FontClass();
    trace("Font name: " + linkedFont.fontName);
    var textFormat: TextFormat = new TextFormat(linkedFont.fontName, 14);
    //... The next lines set up the text box and apply the format.  I am sure this is done correctly.
    [/PHP]
    I get the following output:
    [PHP]FontClassInstance -> [class MyriadProRegular]
    Font name: Myriad Pro[/PHP]
    which is exactly what I would expect.  Yet, my text box is still blank.  I have embedText = true on the text box, and have applied a string to the "text" property, so it's nothing silly liek that.
    Any help would be appreciated...

    You may also want to look at the various embedded font format issues. Many of the Flex 4 components use a newer embedded font fortmat, which is not the same as the one generally used in Flash. So even if ther Flash font gets registered properly, it still may not work with some of the spark components.
    You should be able to create a swf using Flex that contains fonts embedded in either format, which can then be used in the way you describe, though, since Flex 4 suports both font formats.
    Hopefully, someone else will jump in here if I got some of this wrong.
    -JM

  • Problem when load more swf files work with xml files into my movie

    hi ;
    I have one flash file & more of swf files which work with xml files .
    when I load one swf file into my flash file  and remove it and load anther one on the same movieclip in my flash file it load the old swf file.
    when i load one on movieclip and remove it and load anther swf  on anther movieclip the file doesn`t work  and stoped.
    when test my flash file to load and remove swf files without xml file it work fine but when repleaced the swf files with other work with xml files the problem hapend.
    thanks;

    YOu should trace the names of the files that are being targeted for loading to see if they agree with what you expect.  If you want help with the coding you will need to show the code that is relevant to your problem (not all of it)

  • Oraclexe and loading file with .xml suffix

    Using the Oraclexe utility to load an xml file it errors with xml error load, and that is all. I created a table (create table xmload of xmltype). Here is a snippet of the xml content. What needs to be done to "get there from here".
    <Response RequestID="1000000080000" Client="PERMS" RequestStatus="Passed" SessionAuthToken="sessionAuthToken" TimeSlot="09:20:00 18:00:00">
    <Soldier Status="Passed" NumberOfDocuments="53">
    <SSN>123456789</SSN>
    <SoldierName>Doe Jonnie</SoldierName>
    <Site>M</Site>
    <Document DocStatus="Passed" Pages="1">
    <DocType>CRS RES/NR</DocType>
    <DocDescription>COURSE COMPLETION CERTIFICATE (RESIDENT OR NONRESIDENT)</DocDescription>
    <SID>G</SID>
    <EffDate>2002/03/15</EffDate>
    <AcceptDate>2002/04/29</AcceptDate>
    <DocumentID>
    <ScanSite>S</ScanSite>
    <DocID>202804760</DocID>
    </DocumentID>
    </Document>
    <Document DocStatus="Passed" Pages="2">
    <DocType>679DA</DocType>
    <DocDescription>US ARMY OFFICER EVALUATION REPORT</DocDescription>
    <SID>A</SID>
    <EffDate>2002/04/30</EffDate>
    <AcceptDate>2002/09/14</AcceptDate>
    <DocumentID>
    <ScanSite>S</ScanSite>
    <DocID>202932534</DocID>
    </DocumentID>
    </Document>
    <Document DocStatus="Passed" Pages="1">
    <DocType>CRS RES/NR</DocType>
    <DocDescription>COURSE COMPLETION CERTIFICATE (RESIDENT OR NONRESIDENT)</DocDescription>
    <SID>G</SID>
    <EffDate>2000/04/14</EffDate>
    <AcceptDate>2000/07/01</AcceptDate>
    <DocumentID>
    <ScanSite>S</ScanSite>
    <DocID>202074950</DocID>
    </DocumentID>
    </Document>
    </Document>
    <Document DocStatus="Passed" Pages="2">
    <DocType>679DA</DocType>
    <DocDescription>US ARMY OFFICER EVALUATION REPORT</DocDescription>
    <SID>A</SID>
    <EffDate>1999/04/04</EffDate>
    <AcceptDate>1999/07/26</AcceptDate>
    <DocumentID>
    <ScanSite>S</ScanSite>
    <DocID>201773383</DocID>
    </DocumentID>
    </Document>
    </Soldier>
    </Response>

    For those who are interested, the problem come from the differents drivers used for files :
    In Sunopsis, by default :
    -     driver :     com.sunopsis.jdbc.driver.FileDriver
    -     url jdbc :      jdbc:snps:file
    In ODI
    -     driver :      com.sunopsis.jdbc.driver.file.FileDriver
    -     url jdbc :      jdbc:snps:dbfile
    Problem solved.

  • AS3: embeded audio in loaded SWF

    i'm trying to update an AS2 swf/audio player to AS3 and
    running into trouble. i'm exporting an embedded mp3 as a Sound
    object, then loading that SWF into a player engine that is
    skinnable... is there anyway to treat the SWF as a streaming sound?
    Having to wait until the Loader INIT event fires isn't really gonna
    work...
    i had attempted encoding the audio as FLV, which was working
    great with FLVPlayback - until you do anything to the browser
    window (like resizing) which causes erratic sound playback. not
    cool...
    thanks!!!!!

    to stop all movieclips use:
    var imageReq:URLRequest = new URLRequest("square.swf");
    var imageLoader:Loader = new Loader();
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadHandler);
    imageLoader.load(imageReq);
    function loadHandler (event:Event)
        var myClip:MovieClip = event.currentTarget.loader.content
        addChild(myClip);
        stopAllF(myClip);
    function stopAllF(mc:MovieClip):void{
    mc.stop();
    for(var i:int=0;i<mc.numChildren;i++){
    if(mc.getChildAt(i) is MovieClip){
    MovieClip(mc.getChildAt(i));

  • Loading Datagrams with XML SQL Ulitility

    I am trying to exercise the following command from Steve's book Chapter 12.
    java OracleXML putXML -user xmlbook/xmlbook -filename out.xml newsstory
    I get a class not found error.
    Can you tell me where I can find the OracleXML in the PATH assuming I have installed everything correctly ?

    Hi Frank,
    Frank, make sure that the two "select xmlgen....." are
    returning a valid XML document. If these aren't working let me
    know, otherwise add a:
    set serveroutput on
    after the commit.
    Also, before you do this, restore oraclexmlsqltest.sql to its
    original state ... the exception section was masking exceptions
    which we are aware we generate. If you look closely you will see
    that we do a very rough job outputing the lob containing the XML
    document (we print out past the length of the LOB, which raises
    an exception).
    Let me know what happens.
    Frank Hubeny (guest) wrote:
    : I have been unable to get the sample code to run successfully
    : after installing the XML SQL Utility on Oracle 8.1.5.0.0 on
    : Windows NT4 Service Pack 4.
    : To make sure I was doing nothing wrong, I reinstalled Oracle 8i
    : and loaded all the java into scott/tiger. Also the PLXMLPARSER
    : codes does appear to run correctly. At least the samples seem
    to
    : work.
    : I tried to use the oraclexmlsqlload.bat script, but the script
    : stopped after after loading oraclexmlsql.jar. So I ran each of
    : the loadjava scripts on the command line. They exited without
    : errors. Even the xmlgen package installed without errors. But
    : when I ran oraclexmlsqltest.sql, I got a message that said the
    : procedure completed successfully, but there was not output.
    : I put a dbms_output.put_line(SQLCODE) with each of the two
    : exceptions and got the following error. The procedure actually
    : failed on "when others" with error -29531. According to the
    : Error Manual this is
    : ORA-29531 no method string in class string
    : Cause: An attempt was made to execute a non-existent method in
    a
    : Java class.
    : Action: Adjust the call or create the specified method.
    : At this point I am not sure what to do.
    Oracle Technology Network
    http://technet.oracle.com
    null

  • Best practice? Loading text with XML or AS?

    I am developing some instructional material that will include
    some practice questions. I know of 2 ways to handle the dynamic
    text, but am not sure what is considered best practice in the Flash
    community. Is XML the best, fastest or more efficient than
    embedding the text into actionscript?
    Thanks!
    Brad

    If the questions will ever need to be changed, updated, or
    edited, then XML would be the best.
    If you just need the quickest way to build your Flash and not
    have to worry about loading external files and what to do if the
    file isn't available, then put them into the body of the
    FLA.

  • LOAD FILE with xml

    HI
    I want to load an xml file into a RDBMS table, using sunopsis xml driver.
    I try to use an other xml file than the initial that is defined in the driver url.
    I cannot run this instruction in a XML treatment before the interface :
    LOAD FILE "C:/AXYUS/SURSAUD/entree/sosmed1.xml" WITH DTD "C:/AXYUS/SURSAUD/entree/sosmed.dtd" REPLACE READONLY AUTO_UNLOCK
    the file doesn't change at alll and I always load the initial file ( sosmed.xml )
    any idea ?

    Make sure that you issue your LOAD FILE command
    - on the SAME Transaction (0, 1, 2, etc...) than the one used in the LKM,
    - with the SAME logical schema as the source table logical schema
    - and with the SAME Context (if you use the execution context - leave it unset).
    This should do the trick, and the connection created in the procedure will be reused in the interface, provided that you chain both in a package.
    Regards,
    -FX

  • Problem using swf loader

    When i try to run the mxml individually, It run correctly. As soon as i include it in another mxml using SWFLoader , the components stop working properly. It reflects the data sometime while sometime it doesnt. If i press browser refresh button , the components starts working
    again.
    here is the code snippet for the mxml where i load another swf file using swf loader.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:views="com.views.*" viewSourceURL="srcview/index.html" styleName="AppBack" height="100%" width="100%" initialize="init()" layout="vertical">
    <mx:Style source="assets/css/Main.css" />
         <mx:TabNavigator id="tn" height="100%" width="100%" top="-1" right="0" left="0" paddingTop="0" >
         <mx:Canvas label="Home" paddingTop="0" paddingLeft="0" paddingRight="0" paddingBottom="0">
             <mx:SWFLoader id="loader0" source="AddDeleteAccess.swf" height="100%" width="100%" x="0" y="-15"/>
         </mx:Canvas>
         </mx:TabNavigator>
    </mx:Application>
    The Home.swf contains a conbo box and a datagrid.
    The combo box stops working sometime and after the browser refresh is click it starts working.
    if required i can also paste the code of the file which is being loaded.

    scale your loader so it fits the way you want.  ie, if your loaded swf is 800x600 (with nothing on the back-stage) and you're loading into a 350x375 swf, after loading is complete, use:
    loader.width *= 350/800;
    loader.height *= 375/600;

  • Problems loading images dynamically with XML

    Hi Everyone,
    I am working with a project that was build by another
    developer and I have been asked to modify it several ways. This is
    an interactive map for a hotel brand where when you click on the
    USA, you get a list of all the states, click a state and a list of
    all the hotels in that state comes up, click a hotel, the hotel's
    information is displayed. I understand the structure of the files,
    how they make them work, though I couldn't build it myself.
    The problem I am having is this. can't make the hotels'
    photos load into the flash through the XML. I created a target
    movie file that the image could load into but something is not
    happening as far as loading the images. I don't know if the movie
    clip that I created is the right way to go (it was made as an
    object in the library that is exported via AS), or if I should
    create one in the action script file that loads the XML data.
    I looked at some tutorials about how to load images with XML
    but those didn't get into the level of detail that I need for this
    project.
    I've attached some partial code to see if anyone can help me
    work through this.
    Any and all suggestions are welcome.
    Thanks for the help in advance.
    Jeremiah

    I'm a noob at AS3 and trying to learn this XML stuff myself,
    but i have been able to load pictures to the stage...this might
    help you...my xml file photo section is similar to yours, only I
    have it labeled as "href" instead of "source"...
    var imageLoader:Loader;
    var xml:XML;
    var xmlList:XMLList;
    var xmlLoader:URLLoader = new URLLoader();
    xmlLoader.load(new URLRequest("xmldata/images.xml"));
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    function xmlLoaded(event:Event) :void {
    xml = XML(event.target.data);
    xmlList = xml.children();
    for (var i:int = 0; i<xmlList.length(); i++) {
    imageLoader = new Loader();
    imageLoader.load(new URLRequest(xmlList
    .attribute("href")));
    imageLoader.x = 0;
    imageLoader.y = 0;
    addChild(imageLoader);

  • Trouble figuring out pathname for embedded swf loading external swfs & xml

    I have a swf that loads content from an XML file. This works fine when everything is in the same directory, but I want this swf to appear in several different HTML pages, which are in several different directories and I don't want to have to put 8 different copies of my swf online just so that they load properly. The directory structure is like this:
    main_dir:
    mod_dirmod01_dirmodcontent_dirmyembeddedswf.html
    myflash_dirsub1
    sub2:
    myflash.swf
    myflash.fla (not uploaded to the server)
    xml_dir:myxml.xml
    I created "sub1" and "sub2" just so that my swf would be the same number of directories downwards as the html has to link upwards, so that when I test the source file, it works. For the HTML, it's embedded like this (using swfobject):
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="800" height="500" id="../../../myflash_dir/sub1/sub2/myflash">
              <param name="movie" value="../../../myflash_dir/sub1/sub2/myflash.swf" />
                    <!--[if !IE]>-->
                    <object type="application/x-shockwave-flash" data="../../../myflash_dir/sub1/sub2/myflash.swf" width="800" height="500">
                    <!--<![endif]-->
                    <div>
                        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                    </div>
                    <!--[if !IE]>-->
                    </object>
                    <!--<![endif]-->
                </object>
    And inside the Actionscript, I have a URL like this to load the XML:
    ../../../myflash_dir/sub1/sub2/xml_dir/myxml.xml
    Testing the .fla works. But the swf does not work in the HTML. myflash.swf loads, but the loading animation spins and spins, so presumably myxml.xml is not loading. Can anyone see what I'm doing wrong?

    Durrr, this is not the first time I've answered my own question. Maybe something about trying to explain it to someone else lets my brain make the critical connection.
    Anyway, yes it was everything to do with the external SWFs being loaded. My main swf actually loads an xml containing URLs from which to load all of the other SWFs and so I had to update the URLs inside of that, and that fixed the problem.
    Sorry for wasting forum space, but maybe this will help someone else out!

  • How to unload externally loaded swf which contains 3D Carousel?

    Hello to all
    I am learning AS3 and have been taking on various tutorials found on the net. While learning about AS3 I came across a lesson on http://tutorials.flashmymind.com/2009/05/vertical-3d-carousel-with-actionscript-3-and-xml/ titled "Vertical 3D Carousel with AS3 and XML".
    I completed the tutorial and all worked fine so I then wanted to load the swf into a existing project. The loading of the swf goes fine and when I unload my loader it is removed but only visually as in my output panel in flash CS5 I get an error as follows
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at carousel_c_fla::MainTimeline/moveCarousel()
    this error repeats over and over again slowing my swf movie.
    So does this mean my main flash movie trying to still play / find my unloaded 3D Carousel?
    If so how do I unload remove all the AS3 that is trying to run from the 3D Carousel?
    I have included the AS3 below from the tutorial page and I understand that this is what I have to remove to "break free" from the 3D Carousel swf when it is unloaded. This is where I am stuck as my knowledge of AS3 is limited - Can you guys / girls help?
    //Import TweenMax
    import com.greensock.*;
    //The path to the XML file (use your own here)
    // old var from tutorial - var xmlPath:String = "http://tutorials.flashmymind.com/XML/carousel-menu.xml";
    var xmlPath:String = "carousel-menu.xml";
    //We'll store the loaded XML to this variable
    var xml:XML;
    //Create a loader and load the XML. Call the function "xmlLoaded" when done.
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    //This function is called when the XML file is loaded
    function xmlLoaded(e:Event):void {
         //Make sure that we are not working with a null variable
         if ((e.target as URLLoader) != null ) {
              //Create a new XML object with the loaded XML data
              xml = new XML(loader.data);
              //Call the function that creates the menu
              createMenu();
    //We need to know how many items we have on the stage
    var numberOfItems:uint = 0;
    //This array will contain all the menu items
    var menuItems:Array = new Array();
    //Set the focal length
    var focalLength:Number = 350;
    //Set the vanishing point
    var vanishingPointX:Number = stage.stageWidth / 2;
    var vanishingPointY:Number = stage.stageHeight / 2;
    //We calculate the angleSpeed in the ENTER_FRAME listener
    var angleSpeed:Number = 0;
    //Radius of the circle
    var radius:Number = 128;
    //This function creates the menu
    function createMenu():void {
         //Get the number of menu items we will have
         numberOfItems = xml.items.item.length();
         //Calculate the angle difference between the menu items (in radians)
         var angleDifference:Number = Math.PI * (360 / numberOfItems) / 180;
         //We use a counter so we know how many menu items have been created
         var count:uint = 0;
         //Loop through all the <button></button> nodes in the XML
         for each (var item:XML in xml.items.item) {
              //Create a new menu item
              var menuItem:MenuItem = new MenuItem();
              //Calculate the starting angle for the menu item
              var startingAngle:Number = angleDifference * count;
              //Set a "currentAngle" attribute for the menu item
              menuItem.currentAngle = startingAngle;
              //Position the menu item
              menuItem.xpos3D = 0;
              menuItem.ypos3D = radius * Math.sin(startingAngle);
              menuItem.zpos3D = radius * Math.cos(startingAngle);
              //Calculate the scale ratio for the menu item (the further the item -> the smaller the scale ratio)
              var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
              //Scale the menu item according to the scale ratio
              menuItem.scaleX = menuItem.scaleY = scaleRatio;
              //Position the menu item to the stage (from 3D to 2D coordinates)
              menuItem.x = vanishingPointX + menuItem.xpos3D * scaleRatio;
              menuItem.y = vanishingPointY + menuItem.ypos3D * scaleRatio;
              //Add a text to the menu item
              menuItem.menuText.text = item.label;
              //Add a "linkTo" variable for the URL
              menuItem.linkTo = item.linkTo;
              //We don't want the text field to catch mouse events
              menuItem.mouseChildren = false;
              //Assign MOUSE_OVER, MOUSE_OUT and CLICK listeners for the menu item
              menuItem.addEventListener(MouseEvent.MOUSE_OVER, mouseOverItem);
              menuItem.addEventListener(MouseEvent.MOUSE_OUT, mouseOutItem);
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              //Add the menu item to the menu items array
              menuItems.push(menuItem);
              //Add the menu item to the stage
              addChild(menuItem);
              //Assign an initial alpha
              menuItem.alpha = 0.3;
              //Add some blur to the item
              TweenMax.to(menuItem,0, {blurFilter:{blurX:1, blurY:1}});
              //Update the count
              count++;
    //Add an ENTER_FRAME listener for the animation
    addEventListener(Event.ENTER_FRAME, moveCarousel);
    //This function is called in each frame
    function moveCarousel(e:Event):void {
         //Calculate the angle speed according to mouseY position
         angleSpeed = (mouseY - stage.stageHeight / 2) * 0.0002;
         //Loop through the menu items
         for (var i:uint = 0; i < menuItems.length; i++) {
              //Store the menu item to a local variable
              var menuItem:MenuItem = menuItems[i] as MenuItem;
              //Update the current angle of the item
              menuItem.currentAngle += angleSpeed;
              //Calculate a scale ratio
              var scaleRatio = focalLength/(focalLength + menuItem.zpos3D);
              //Scale the item according to the scale ratio
              menuItem.scaleX=menuItem.scaleY=scaleRatio;
              //Set new 3D coordinates
              menuItem.xpos3D=0;
              menuItem.ypos3D=radius*Math.sin(menuItem.currentAngle);
              menuItem.zpos3D=radius*Math.cos(menuItem.currentAngle);
              //Update the item's coordinates.
              menuItem.x=vanishingPointX+menuItem.xpos3D*scaleRatio;
              menuItem.y=vanishingPointY+menuItem.ypos3D*scaleRatio;
         //Call the function that sorts the items so they overlap each other correctly
         sortZ();
    //This function sorts the items so they overlap each other correctly
    function sortZ():void {
         //Sort the array so that the item which has the highest
         //z position (= furthest away) is first in the array
         menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         //Set new child indexes for the item
         for (var i:uint = 0; i < menuItems.length; i++) {
              setChildIndex(menuItems[i], i);
    //This function is called when a mouse is over an item
    function mouseOverItem(e:Event):void {
         //Tween the item's properties
         TweenMax.to(e.target, 0.1, {alpha: 1, glowFilter:{color:0xffffff, alpha:1, blurX:60, blurY:60},blurFilter:{blurX:0, blurY:0}});
    //This function is called when a mouse is out of an item
    function mouseOutItem(e:Event):void {
         //Tween the item's properties
         TweenMax.to(e.target, 1, {alpha: 0.3, glowFilter:{color:0xffffff, alpha:1, blurX:0, blurY:0},blurFilter:{blurX:1, blurY:1}});
    //This function is called when an item is clicked
    function itemClicked(e:Event):void {
         //Navigate to the URL that's assigned to the menu item
         var urlRequest:URLRequest=new URLRequest(e.target.linkTo);
         navigateToURL(urlRequest);

    Hi Ned thanks for the reply,
    Ok so I have a button in my main movie that loads the external swf
    stop();
    var my_loader:Loader = new Loader();
    var my_btn:Button = new Button();
    var my_pb:ProgressBar = new ProgressBar();
    my_pb.source = my_loader.contentLoaderInfo;
    my_btn.addEventListener(MouseEvent.CLICK,startLoading);
    function startLoading(e:MouseEvent):void{
    my_loader.load(new URLRequest("carousel.swf"));
    addChild(my_pb);
    my_loader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishloading);
    function finishloading(e:Event):void{
    addChild(my_loader);
    my_loader.addEventListener("killMe",
    killLoadedClip);
    removeChild(my_pb);
    function killLoadedClip(e:Event):void {
    my_loader.removeEventListener("killMe",
    killLoadedClip);
    my_loader.unloadAndStop();
    removeChild(my_loader);
    Then I have a button in my loaded swf that closes the loader
    This is spread over 2 frames
    Frame1
    function closeIt(e:MouseEvent):void {
    parent.dispatchEvent(newEvent("killMe"));
    Frame 2
    back_btn.addEventListener(MouseEvent.CLICK, closeIt);
    Frame 2 also holds all the code for the carousel
    Thanks for your time and help in advance people ; )

  • (MX04) Pausing a loaded swf with sound objects within it

    Hi,
    I'm working on a PowerPoint-esque presentation where a user
    watches and listens to a loaded swf in the main movie, clicks the
    next button (which unloads the swf, advances to the next frame and
    loads the next swf), and watches the next one. Lather, rinse,
    repeat. Some of the sections are rather long, and I'd like to give
    the user the ability to pause and play by button click.
    I know how to stop and start the container MC, but that
    doesn't stop the sound object (and the embedded MCs). I also know
    how to pause and start a sound object using the object's instance
    name. Is there a way to pause everything from the main timeline,
    and keep the AS general enough so that any sound object pauses when
    clicked?
    Any help is most appreciated! MX04 and AS2.0.
    Thanks!

    Kglad,
    I tried your code and ran into some problems with stopping
    the mc's, as the embedded mc's within the loaded swf need to stop
    as well. I found the attached code to stop the mc's, but now am
    having trouble with the sound objects.
    Here's the issue, I used this:
    this.soundPosition = currentMovie.loop1.position/1000;
    this.currentMovie.loop1.stop();
    ... for the sound object stop commands and listed a new one
    for each loop I was using. On the play button I started them back
    up again. This all works, but when I start them up again they all
    play, not just the one that is currently paused. Do you mind giving
    me some guidance with the for (obj in mc) loop? My loop experience
    is nil. What I want to do is have the code cycle through all of the
    loops to see which one is playing, then store that information in a
    variable, then pause and play the variable. Does that sound right?
    Thanks again for the help!
    -Sandy

  • Loading external swf fonts created with fontswf, loaded with a Loader, compatible with iOS

    Let me immediately start out by saying that I do in fact have a current working solution for using embedded fonts, generated by fontswf and working in an AIR ActionScript mobile application, and also currently working fine with iOS.
    My current app needs CFF fonts, so I currently use the fontswf tool to pre-generate the .swfs using:
    fontswf -4 -a [SomeAlias] -o [SomeFont.swf] [SomeFont.ttf]
    and then I am currently embedding them in my app source code .as for compilation using:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    I then have no problem registering them using Font.registerFont(SomeFontClass) and everything works fine.
    However, I would prefer to take the use of these swf fonts one step further and load them dynamically using a Loader so that I do not have to take the hit of having multiple CFF font swfs embedded in the main compiled SWF and so that I could even load an unknown future set of fonts without having to supply them as part of the app build.
    Now I have seen and read many blogs and tutorials where people have exported font swf from Flash Builder where you add an explicit 'Class' name or even made standalone .as static files compiled into standalone swfs only including the two lines:
    [Embed(source="/swf/SomeFont.swf", symbol="SomeAlias")]
    public static var SomeFontClass:Class;
    so that you also have a 'Class' involved. Then people use some form of appropriate applicationDomain.getDefinition("className") as Class
    to pull out the class for the font registration.
    My question is, how does one perform the same font loading and registration of fonts using a Loader only loading the .swfs produced directly from fontswf?
    It seems only a DefineFont4 is tagged in the swf, there doesn't seem to be a 'Class' per se to call on.
    More importantly, iOS apps cannot load external swfs with code in them, so my understanding is any extra wrapped swf that would contain a custom Class technique would fail the iOS requirement of only having one main SWF with any ActionScript compiled code.
    Is there an alternative to the 'Class' technique by grabbing the DefineFont4 tagged resource from the swf and instantiating a proper working Font class from that? One that would still be compatible with the restrictions placed on AIR mobile apps running on iOS?

    Ironically, just after posting this, Adobe released AIR 3.5 beta onto labs, and added multiple SWF support for iOS.
    While this new support makes it easier to manage your content across multiple SWFs and technically allows you to use the class based separate .swfs for each font if desired, the system still requires that all these SWFs be present at compile time when making the final app .ipa for iOS.
    So this still doesn't solve trying to load fonts after the app is already built. For example, as part of a downloaded in-app purchase mechanism.

  • AIR crashes on loading swf with 'Imported for runtime sharing' fonts

    Hello everybody,
    I have a trouble with an AIR application developped with Flex but the error seems to come from the Flash/AIR, after some searches a staff member (Flex harUI) said me that I could find more help for my trouble here.
    I'm developping an AIR application which loads an external swf. This swf contains 'Imported for runtime sharing' fonts from another swf to reduce its size.
    When the AIR application has finished to load (see message below) the whole application crashes without giving any error message except the usual "Process terminated unexpectedly" error message.
    End Loading: [SWF] C:\Users\dev02\myProject\index.swf - 83,930 bytes after decompression
    Error Message:
    Process terminated unexpectedly.
    Launch command details:  "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.6.0\bin\adl.exe" -runtime "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.6.0\runtimes\air\win" "C:\Users\dev02\Adobe Flash Builder 4\Languages_Editor\bin-debug\Language_Editor-app.xml" "C:\Users\dev02\Adobe Flash Builder 4\Languages_Editor\bin-debug"
    I use Flash Builder 4 (build 272416) with sdk 4.6.
    Full discussion here.
    I tried to load the external swf with the most basics codes, it works with a Flash web app but not with a Flex/AIR app or a Flash/AIR app.
    Thanks for the help !

    Thanks for the anwser.
    In fact, I cannot specify a swc because my main application is an editor of sub-applications where each one has its own library.
    The bug remains when sharing a simple MovieClip too.
    Maybe, if I explain my project it will be a little more clear.
    I'm developping a multi-languages module / application.
    For each module, I have an external xml for texts. So in order to add a new language we don't need to recompile, just to change texts in the xml. But, I had to externalize my fonts, (imagine if each swf contains the whole characters set like latin, cyrillic, etc.).
    And then, I have my main text editor application above the module, which loads texts xmls and a preview of the page where we need to change the text. (This is where it crashes, during the process of loading the preview).
    My editor works great for translating, changing texts, modify images but without the preview, what is really frustrating.
    (not so ergonomic, I know...)
    I hope it will help you to understand my trouble.
    regards

Maybe you are looking for

  • How do i delete archive log files manually?

    My db is running in oracle 10.2.0.4. somehow, the RMAN command is not deleting archived backup files. I need to delete those files manually at os level. how do i find till which archivelog files are backed up through RMAN?

  • Loading a .wav file from hard drive

    Is there an easy way to load a .wav from your hard drive? Everything I see requires applets and a URL. I don't want to use any extra packages either..I just want to use the standard ones. Thank you!

  • Running EAS 11.1.2.1

    Hi, Which JRE is comatible with 11.1.2.1 EAS to access console. Some of users getting errors related to EAS. Regards Kumar

  • Flex and the cold fusion wizard

    I am trying to use the cold fusion wizard in Flex 3. What must be set up before you can use this? I know what the wizard does, but I don't understand what is needed or going on in the background in order to get it to work properly. I have a msql tabl

  • Photoshop  CS5.1 Printing

    Hi - hope someone can help me - When I try to print, I get the following window - "There was an error opening your printer.  Printing functions will not be available until you have selected a printer and reopened any documents" This occurred after I