Slideshow from XML in AS3

I'm WAY new to AS3 and I'm looking to create a slideshow
driven by XML. Its a very simple XML file that can have 2 to 5
images in it.
I can get the images to load in, but am having problems on
the Event.COMPLETE function I created. I can't seem to reference
the target at all.. basically when the load is complete, I want to
retrict it to a 600 width or 450 height (depending on whether its
wider or taller).
I can get that information, but have NO idea how to adjust
the width and height of the target. I've tried event.target.name,
and event.currentTarget.name, etc... I have no idea what to do
next!!!
I've attached all the code I have (just started it).
Any help would be GREATLY appreciated!!!!!

You can't manipulate the width and height of the actual
content you're loading, you have to manipulate the object
displaying this content. this can be either the loader's content
DisplayObject or the loader itself.
so where you say for example:
info.width = 600;
you should say
loader.width = 600; //or loader.content.width = 600;

Similar Messages

  • Slideshow from xml - loads in wrong order

    Hi,
    I modified an existing slideshow script so that it would like
    to a page when you clicked the image. However, the images do not
    always load up in the correct order, but the links and descriptions
    do, so if you click an image it takes you to the wrong page.
    It changes when you refresh the browser and acts differently
    in ie to firefox - in ie it is usualy incorrect the first time,
    then goes ok once u refresh. The link to view is:
    http://www.fluidstudioswms.com/gftc/
    and the actionscript is:
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var myShowXML = new XML();
    myShowXML.ignoreWhite = true;
    myShowXML.load("cfpromoexport.xml?cachebuster="
    +Math.random()+ new Date().getTime());
    myShowXML.onLoad = function() {
    _root.myWidth = myShowXML.firstChild.attributes.width;
    _root.myHeight = myShowXML.firstChild.attributes.height;
    _root.mySpeed = myShowXML.firstChild.attributes.speed;
    _root.myImages = myShowXML.firstChild.childNodes;
    _root.myImagesNo = myImages.length;
    createContainer();
    callImages();
    function createContainer() {
    _root.createEmptyMovieClip("myContainer_mc",1);
    myContainer_mc.lineTo(_root.myWidth,0);
    myContainer_mc.lineTo(_root.myWidth,_root.myHeight);
    myContainer_mc.lineTo(0,_root.myHeight);
    myContainer_mc.lineTo(0,0);
    myContainer_mc._x = (Stage.width-myContainer_mc._width);
    myContainer_mc._y = (Stage.height-myContainer_mc._height);
    function callImages() {
    _root.myMCL = new MovieClipLoader();
    _root.myPreloader = new Object();
    _root.myMCL.addListener(_root.myPreloader);
    _root.myClips_array = [];
    _root.myPreloader.onLoadStart = function(target) {
    _root.createTextField("myText_txt",_root.getNextHighestDepth(),0,0,100,20);
    _root.myText_txt._x =
    (Stage.width-_root.myText_txt._width)/2;
    _root.myText_txt._y =
    (Stage.height-_root.myText_txt._height)/2;
    _root.myText_txt.autoSize = "center";
    _root.myText_txt.text = "test";
    _root.myPreloader.onLoadProgress = function(target) {
    _root.myText_txt.text = "Loading..
    "+_root.myClips_array.length+"/"+_root.myImagesNo+" Completed";
    _root.myPreloader.onLoadComplete = function(target) {
    _root.myClips_array.push(target);
    target._alpha = 0;
    if (_root.myClips_array.length == _root.myImagesNo) {
    _root.myText_txt._y = myContainer_mc._y +
    myContainer_mc._height;
    _root.target_mc = -1;
    moveSlide();
    myShowInt = setInterval(moveSlide,
    (_root.mySpeed*1000)+1000);
    for (i=0; i<_root.myImagesNo; i++) {
    temp_url = _root.myImages
    .attributes.url;
    temp_mc = myContainer_mc.createEmptyMovieClip(i,
    myContainer_mc.getNextHighestDepth());
    _root.myMCL.loadClip(temp_url,temp_mc);
    _root.myContainer_mc.Link =
    _root.myImages.attributes.link;
    _root.myContainer_mc.onRelease = function() {
    getURL(this.Link);
    function moveSlide() {
    current_mc = _root.myClips_array[_root.target_mc];
    new Tween(current_mc, "_alpha", Strong.easeOut, 100, 0, 1,
    true);
    _root.target_mc++;
    if (_root.target_mc>=_root.myImagesNo) {
    _root.target_mc = 0;
    next_mc = _root.myClips_array[_root.target_mc];
    new Tween(next_mc, "_alpha", Strong.easeOut, 0, 100, 1,
    true);
    The XML can be viewed at
    http://www.fluidstudioswms.com/gftc/cfpromoexport.xml
    Any ideas would be greatly appreciated.

    Sorry about code - new to the forum, I will remember for
    future use.
    Thanks for identifying the problem area. I have been trying
    to fix the issue by sorting the array but my actionscript is not
    great and I have not had any success :(

  • XML in AS3

    Theres lots of functions to add child nodes, but is it right
    that there are none to delete them. Is there a good approuch to
    deleting just one node?

    You use the delete operator to delete nodes from XML in AS3
    http://livedocs.adobe.com/flex/201/langref/operators.html#delete_(XML)
    "smazr123" <[email protected]> wrote in
    message
    news:f319oc$7nm$[email protected]..
    > Theres lots of functions to add child nodes, but is it
    right that there
    > are none to delete them. Is there a good approuch to
    deleting just one
    > node?

  • Load value one by one from xml as3

    Hi all,
    i want to load value from xml.item.slika and use it to generate image link
    xml file:
    <gallery>
        <item>
            <id>1</id>
            <strana>0</strana>
            <naslov>Lokacije</naslov>
            <aktuelno>1</aktuelno>
            <slika>1.jpg</slika>
        </item>
        <item>
            <id>2</id>
            <strana>2</strana>
            <naslov>Coaching</naslov>
            <aktuelno>1</aktuelno>
            <slika>2.jpg</slika>
        </item>
        <item>
            <id>3</id>
            <strana>0</strana>
            <naslov><![CDATA[O.Å . Bratstvo - panel]]></naslov>
            <aktuelno>0</aktuelno>
            <slika>3.jpg</slika>
        </item> 
    </gallery>
    Function:
    function ucitaneSlike(evt: Event): void {
        var xml = new XML(evt.target.data);
        var slika:String = '';
        var loader: URLLoader = new URLLoader();
            for each(var item in xml..item) {
                slika += item.slika;
                loader.load(new URLRequest(domen + 'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + "?" + new Date().getTime()));
                centralniText.htmlText = '<a href="javascript:popUp(\'' + domen +'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + '\')"><img             src="'+ domen +'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + '" height="50" width="50"></a>';
                vScrollBar.update();
    I get result:
    localhost/podaci/igraci/slike/1/1.jpg2.jpg3.jpg

    oh, if you want your textfield to display all the links, use:
    kglad wrote:
    use the following to get the correct reference for each slika element.  whether the rest of those urls are correct or not, i didn't check:
     function ucitaneSlike(evt: Event): void {
        var xml = new XML(evt.target.data);
        var slika:String = '';
    centralniText.htmlText = "";
        var loader: URLLoader = new URLLoader();
            for each(var item in xml..item) {
                slika = item.slika;
                loader.load(new URLRequest(domen + 'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + "?" + new Date().getTime()));
               centralniText.htmlText += '<a href="javascript:popUp(\'' + domen +'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + '\')"><img             src="'+ domen +'podaci/igraci/slike/'+listaPodataka.lista.selectedItem["RB"]+ '/' + slika + '" height="50" width="50"></a><br/>';
                vScrollBar.update();

  • I have problem loading all items from XML with for each

    Hi all,
    I'm low level as3 programmer and I need help whit this code:
    I have gallery XML file:
    <gallery>
        <item>
            <id>1</id>
            <strana>0</strana>
            <naslov>Lokacije</naslov>
            <aktuelno>1</aktuelno>
            <slika>1.jpg</slika>
        </item>
        <item>
            <id>2</id>
            <strana>2</strana>
            <naslov>Coaching</naslov>
            <aktuelno>1</aktuelno>
            <slika>2.jpg</slika>
        </item>
        <item>
            <id>3</id>
            <strana>0</strana>
            <naslov><![CDATA[O.Å . Bratstvo - panel]]></naslov>
            <aktuelno>0</aktuelno>
            <slika>3.jpg</slika>
        </item>  
    </gallery>
    And:
    var loader: URLLoader = new URLLoader();
         loader.load(new URLRequest("gallery.xml");
    var xml = new XML(evt.target.data);
        for each(var item in xml..item) {
            centralniText.htmlText = item.slika;
    only shows  last item from XML file:
    3.jpg
    I want all. Please help.

    can adding count item in XML help somehow?
    <gallery>
        <item>
            <id>1</id>
            <strana>0</strana>
            <naslov>Lokacije</naslov>
            <aktuelno>1</aktuelno>
            <slika>1.jpg</slika>
        </item>
        <item>
            <id>2</id>
            <strana>2</strana>
            <naslov>Coaching</naslov>
            <aktuelno>1</aktuelno>
            <slika>2.jpg</slika>
        </item>
        <item>
            <id>3</id>
            <strana>0</strana>
            <naslov><![CDATA[O.Å . Bratstvo - panel]]></naslov>
            <aktuelno>0</aktuelno>
            <slika>3.jpg</slika>
        </item>   
        <last>3</last>
    </gallery>

  • Image won't load from XML

    I am making a gallery using xml and as3. I've run into a
    problem very early and I'm not too good with Actionscript yet. So
    I've come here for some help.
    What I want right now, is to have an image be loaded from a
    xml file, which is working for me. And then have a white movieclip
    come in a resize behind the image to be a frame for the image. I
    haven't gotten to this part yet. My problem starts when I try to
    load the image with a blank movieclip to position it. The image
    loads, but the eventListener won't run the imageLoaded function. If
    I remove the function and just have
    holder_mc.addchild(imageLoader); Then it works, but I need the
    image to load and then resize the movieclip frame, and then display
    both right? How can I accomplish this?

    I was trying to solve this myself just last night and after
    seeing your post today I figured maybe I can help you out (as long
    as I'm addressing the problem you have).
    apparently the addEventListener needs a kick start from
    something else. If you look up the Loader class in the Flash help
    files it provides an example near the bottom that holds the key.
    I'm providing a shorthanded solution that I derived from it.
    Rather than:
    imageLoader.addEventListener(Event.COMPLETE,
    completeHandler);
    There is another piece in the in the middle of the process:
    "contentLoaderInfo"
    imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    completeHandler);
    Hope that helps

  • Create interactive element (slideshow) from file?

    Hi,i'm using InDesign CS6 with DPS. Is there a way to create a slideshow from an file (XML for example)? My objective is to create all pages needed and attaching all images in the slideshow from a database. Thanks in advance.

    Sortof. You can use the Data Merge feature in InDesign to build out a set of pages based on XML content and images. That makes it easy to automate the creation of a whole bunch of pages with an image on it. You can't, however, use it to automate making multi-state object slideshows.
    I wrote a blog entry a long time ago about how to use this feature to make a PDF to submit to Blurb with images from Lightroom. You may find it useful: http://www.danecreek.com/blog/2010/02/14/creating-blurb-pdfs-using-lightroom-and-indesign. html.
    Neil

  • Load Sales Order from Xml file

    Hi,
    I want to load a sales order from xml file. How can I do so? Where I'll get the xml schema for Sales Order or other documents (delivery,invoice etc)?
    Plz reply with code and xml file.

    When I'm going to load SO from xml file, it's showing an error:
    "The connected value 0 was not found in table Uasge of Nota Fiscal".
    What is this table for? Which attribute is related with this table?
    How can I find out that?

  • I want to load a sales order from xml file. How can I do.

    Hi,
    I want to load a sales order from XML  file. How can I do ? how can i create the sales order?
    what are the necessary  setting for  create the sales orders.
    with Regards,
    Prakesh.

    Three options come to my mind.
    Option 1: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (BAPI) and Program (CREATEFROMDAT2).
    Option 2: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (DINP) and Program (RVINVB10).
    Option 3: Translate the xml to IDoc so that ORDER04 / ORDER05 Idoc can be used to create Sales order (WEDI transaction).

  • Pls Help me with steps to add data from xml file to SAP B1 through B1iSN.

    Pls Help me with steps to add data from xml file to SAP B1 through B1iSN. I  am getting stuck in xsl transformation. not able to understand where the mapping code needs to be added.
    Pls explain me the steps for adding data from xml to B1 quotation step by step.
    thanks and regards
    Priya

    Hi,
    Have you checked this: https://sap.na.pgiconnect.com/p45508295/?launcher=false&fcsContent=true&pbMode=normal ?
    Thanks,
    Gordon

  • Importing slideshow from iMovie 09

    I don't know if it is a brain cramp or what, but I am having difficulty importing my slideshow from iMovie 09 into iDVD. I carry out all of the steps when in iMovie and then when I go to the media tab, my movie is not there. Can someone please help???

    This is actually quite simple. I'm assuming you want it on a DVD? To do this go into iMovie and got to your slideshow. Click the Share tab and then iDVD. This brings up iDVD and you go on and create your main menu and burn a disc.

  • How to get string value from xml in JSF??

    In JSF How to get string value from xml, .ini and properties file. I want to get string value from xml or text to JSF

    Just use the appropriate API's for that. There are enough API's out which can read/parse/write XML, ini and properties files. E.g. JAXP or DOM4J for xml files, INI4J for ini files and Sun's own java.util.Properties for propertiesfiles.
    JSF supports properties files as message bundle and resource bundle so that you can use them for error messages and/or localization.

  • Update or delete table from XML

    Is it possible to update or delete table's row from XML file?
    Thanks
    Prasanta De

    Hi Steve,
    Thanks for your reply but I could not find any example from the documentation for update-request or delete-request. I need your help in this regards.
    1. I have emp table with many rows and the simple structure like this
    DEPTNO NUMBER(2)
    EMPNO NUMBER(2)
    EMPNAME VARCHAR2(20)
    EMPSAL NUMBER(8,2)
    Key is defined on deptno and empno
    2. I have a xml file like this
    <?xml version = '1.0'?>
    <ROWSET>
    <ROW num="1">
    <DEPTNO>1</DEPTNO>
    <EMPNO>11</EMPNO>
    <EMPSAL>1111.11</EMPSAL>
    </ROW>
    <ROW num="2">
    <DEPTNO>1</DEPTNO>
    <EMPNO>12</EMPNO>
    <EMPSAL>2222.22</EMPSAL>
    </ROW>
    <ROW num="3">
    <DEPTNO>1</DEPTNO>
    <EMPNO>13</EMPNO>
    <EMPSAL>3333.33</EMPSAL>
    </ROW>
    </ROWSET>
    3. I want that xsql servlet will read this xml file and update EMPSAL column depending upon the value of DEPTNO and EMPNO from xml file.
    Please let me know how I should use update-request in xsql page.
    Thanks
    Prasanta De
    null

  • Printing on Pre-printed stationary from XML Publisher

    Hi,
    I have a requirement where a report is to be printed on pre-printed stationary from XML Publisher. The stationary would be NCR paper and has to be printed from a dot matrix printer.
    My first question is whether report generated from XMLP can be printed thro'
    dot matrix printer, coz as far as i know it takes only character format .If yes, do we need any special handling?
    If anybody has any experience related to this problem, please let me know the approach.
    Can mail me at [email protected]
    Regards,
    Satrajit

    Hi Milind
    I see what you've got.
    It is not uncommon to use character mode output for pre-printed stationery.
    This would appear as draft output from a Dot Matrix printer. I hope you understand what I mean here. It is somthing like printing using fixed width font.
    Design and run the report with MODE=CHARACTER from the command line.
    You need to figure out and design the layout in such a way that you are printing in the empty spaces provided in the pre-printed stationery. This is usually by trial and error method. You may probably blow several pre-printed stationery sheets before you get it right.
    Regards
    Sripathy

  • How to retrieve data from XML

    I have a scenario where I need to read data from database of xmltype (data type)
    Table Structure :
    Create table Ex_Tb (id number(30),emp_data XMLType );
    I can save xml content in database,
    Sample
    insert into Ex_Tb values( 1, xmltype ('<?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata>'));
    Data inserted .
    When retrieved from DB I see the data in the generated BO as given below:
    <?xml version="1.0" encoding="UTF-8" ?>
    <ExteOutputCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/pcbpel/adapter/db/Exte file:/C:/JDeveloper/mywork/Application1/Project1/xsd/Exte.xsd" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/Exte">
    <ExteOutput>
    <SDD_XML_REQ_DATA_GETCLOBVAL__><?xml version="1.0" encoding="UTF-8" ?><userdata><uniqueid>54321</uniqueid><name>moorthi</name><age>25</age><city>Chennai</city></userdata></SDD_XML_REQ_DATA_GETCLOBVAL__>
    </ExteOutput>
    </ExteOutputCollection>
    My Question :
    1. How to retrive values of individual tags contained within the embedded XML so that it can be mapped to a BO?
    Basically I would like to map uniqueId, name,age,city from xml to a BO.
    Rgds,
    Krishna

    Hi Krishna,
    I'm not sure but are you selecting the data from the XMLType column as given in the section Using XMLType in an SQL Statement in the below doc?
    http://docs.oracle.com/cd/B10500_01/appdev.920/a96620/xdb04cre.htm#1030582
    Regards,
    Neeraj Sehgal

Maybe you are looking for

  • How to play *.rm files in Solaris 10 x86

    Hi all, I've installed Solaris 10 x86 in SunBlade 1100z. Everthing is okie, the GUI of JDS is very attractive. I think I like it. But I cannot open file *.rm. I try to search some software like Real Player but it run only in Windows or Linux platform

  • How to Inactivate changes made by Change Master

    Hi Guru's, We use Change Master (no system status & release approach in use). If a BOM is changed with CM & data manager wants the change to be inactive (Planned Orders/ process orders should not copy the data of this CM), what could be the solution.

  • OM CUSTOM INFOTYPE INTAKE

    HI, sap experts , i have created 9000-object om  infoytype  and while entering po13 tocode  i have given the custom infotype and selected 9000 infotype ...and it is giving the message specify the object ID .. Plese let me know.. Regards, prasad

  • Scheduled crawls are not crawling all available database rows while manual

    We have "Sales" and "Lettings" properties are indexed separately. The data for these 2 types of property types are being indexed on tables "dbo.SESSalesPropertiesRollup" and "dbo.SESLettingsPropertiesRollup" respectively. The SES scheduling is indexi

  • To Verizon Wireless.....

    I bought 2 of the droid 2 's in june paying full price for both and of course not even a month later they have the buy one get one free ...what the heck is that about....i think they should give those of us that bought them for full price something..