XML and Flash CS4 - loading images

Hello

I am trying to learn how to use XML to load images and found a tutorial somewhere... Ok. HOWEVER, now I'm stuck on something.

I have loaded a lot of inches and you want to load a larger image version when you click on its thumbnail.

Had to work with, but poorly. Loading the same large image no matter what thumb is clicked. I would appreciate all the advice REALLY.

Thank you!

============================================================================

var xmlRequest:URLRequest = new URLRequest ("rockandroll.xml");
var xmlLoader:URLLoader = new URLLoader (xmlRequest);
var imgData:XML;
var numberOfChildren:int;
var hite:int;
var wid:int;

xmlLoader.load (xmlRequest);
xmlLoader.addEventListener (Event.COMPLETE, xmlLoadedF);

var imageLoader1:Loader = new Loader();
var bigLoader:Loader = new Loader();

var rawImage:String;
var rawImage2:String;
var imgNum:int = 0;

function xmlLoadedF(event:Event):void {}
imgData = new XML (event.target.data);
numberOfChildren = imgData.*.length)
var startX:int = 190;
var startY: int = 60;
var imgNum:int = 0;
var ctr:int = 0;
var cumuX:int = 0;

while(imgNum<36) {}
for (var cols: int = 0; < 7 passes passes ++) {}
var b:MovieClip = new boxx();
addChild (b);

b.x = startX + collars * b.Width;
//
cumuX += Number (imgData.pic [imgNum] .imgW);
//
b.y = startY;
rawImage = imgData.pic [imgNum] .thumb;
rawImage2 = imgData.pic [imgNum] .big;
var imageLoader1:Loader = new Loader();
var bigLoader:Loader = new Loader();

imageLoader1.load (new URLRequest (rawImage));

imageLoader1.addEventListener (MouseEvent.CLICK, itsClicked);
bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
b.addChild (imageLoader1);

imageLoader1.x=(b.width-imgData.pic[imgNum].imgW)/2;
imageLoader1.y=(b.height-imgData.pic[imgNum].imgH)/2;
imgNum ++;
}
startY += b.height;
b.x = startX;
}

function itsClicked(event:Event):void {}

rawImage2 = imgData.pic [imgNum] .big;
addChild (bigLoader);
bigLoader.load (new URLRequest (rawImage2));
bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
}
function itsGone(event:Event):void {}
removeChild (bigLoader);
}
}

===================================

And here is a record in the XML file:

<? XML version = "1.0" encoding = "utf-8"? >
< photos >
< pic >
thumbs/1t.jpg < go > < / inch >
images/1.jpg < big > < / big >
< > 57 imgW < / imgW >
< > 31 imgH < / imgH >
< BIGimgW > 922 < / BIGimgW >
< BIGimgH > 500 < / BIGimgH >
< / pic >

... etc.

=====================================

Thanks again!

use something like:

var xmlRequest:URLRequest = new URLRequest ("rockandroll.xml");
var xmlLoader:URLLoader = new URLLoader (xmlRequest);
var imgData:XML;
var numberOfChildren:int;
var hite:int;
var wid:int;

xmlLoader.load (xmlRequest);
xmlLoader.addEventListener (Event.COMPLETE, xmlLoadedF);

var imageLoader1:Loader = new Loader();
var bigLoader:Loader = new Loader();

var rawImage:String;
var rawImage2:String;
var imgNum:int = 0;

function xmlLoadedF(event:Event):void {}
imgData = new XML (event.target.data);
numberOfChildren = imgData.*.length)
var startX:int = 190;
var startY: int = 60;
var imgNum:int = 0;
var ctr:int = 0;
var cumuX:int = 0;

While (imgNum<>
for (var cols: int = 0; cols)<7;>
var b:MovieClip = new boxx();
addChild (b);

b.x = startX + collars * b.Width;
//
cumuX += Number (imgData.pic [imgNum] .imgW);
//
b.y = startY;
rawImage = imgData.pic [imgNum] .thumb;
rawImage2 = imgData.pic [imgNum] .big;


var imageLoader1:Loader = new Loader();

b.Big = rawImage2;
imageLoader1.load (new URLRequest (rawImage));

b.addEventListener (MouseEvent.CLICK, itsClicked);
b.addChild (imageLoader1);
      
imageLoader1.x=(b.width-imgData.pic[imgNum].imgW)/2;
imageLoader1.y=(b.height-imgData.pic[imgNum].imgH)/2;
imgNum ++;
}
startY += b.height;
b.x = startX;
}

function itsClicked(event:Event):void {}
       
var bigLoader:Loader = new Loader();
addChild (bigLoader);
bigLoader.load (new URLRequest (MovieClip (event.currentTarget) .big));
bigLoader.addEventListener (MouseEvent.CLICK, atmanebentayeb);
}
function itsGone(event:Event):void {}
removeChild (event.currentTarget);

Loader (Event.currentTarget). RemoveEventListener (MouseEvent.Click, itsGone);

event.currentTarget = null;

}
}

Tags: Adobe Animate

Similar Questions

  • PHP, xml and Flash [multiple holders]

    Hello

    A few days ago, I posted a discussion related to php, xml and Flash. I want to display my xml in flash. I am using to do so. I now have a problem of obtaining xml data in my table to appear on different licensed video clips.

    It's my code. I tried a different configuration of the code, but without success.

    var urls:Array = [];

    var: index number;
    var index1:Number;

    var xml = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = parseXML;
    XML. Load ("Content.php");

    parseXML() {} function
    for (var i: Number = 0; i < this.firstChild.childNodes.length; i ++) {}
    URLs.push (this.firstChild.childNodes [i].firstChild.nodeValue);
    }

    index = 0;
    index1 = 1;

    startyourappF();

    }

    function startyourappF() {}

    this.onEnterFrame = preloadA;

    holder.loadMovie (urls [index]);

    This is me trying it to get the second element in the url in an another film clip holder.

    holder1.loadMovie (URLs [index1]);
    }

    function preloadA() {}

    If (Holder.getBytesLoaded () > 50 & & holder.getBytesLoaded () > = holder.getByte sTotal()) {}

    delete this.onEnterFrame;

    Holder._width = 260,0;

    Holder._height = 96.0;
    }

    This should be resizing to the holder of the second.
    If (holder1.getBytesLoaded () > 50 & & holder1.getBytesLoaded () > = holder1.getB ytesTotal()) {}

    delete this.onEnterFrame;

    holder1._width = 260,0;

    holder1._height = 96.0;
    }
    }

    The success of code loads the holder first image but cannot load the second url holder1 and others, that I want to add. I spend the whole night to try different configurations of the code but without success.

    I hope you can help me. All I need is more than an image loaded from the URL variable in several other variables of the licensee.

    Hope you can help.

    soon > >

    You must first set the structure of your directory and you will need to use relative URLS.  There is no sense to work on something else because what works now in your first image, and if you fix the code in your 2nd frame, it will break as soon as you download on your server.

    Thus, to duplicate the configuration of directory, that you plan to use on your server and use relative URLS.

    If your xml, html and swf are in the same directories and you intend to keep them in the same directories when you download on your server, use load ("timol.xml") to load your xml file.  Similarly, remove all path information to load anything else.

  • Add the description of an xml file to the loaded image to full size

    Hi all

    I need a little help with the Gallery picture below please.

    I have a photo gallery that loads some thumbnail in via xml and AS3 support. When you click on the thumbnail, it loads the image full size in a charger.

    How can I add a description of the xml to the image full size.

    Thank you in advance for your time and effort to help me with this.

    I'm still learning a lot about AS3 and xml so your help is most appreciated people.

    It's my xml

    <?xml version="1.0" encoding="UTF-8"?>
    
    <menu>
    
        <items>
    
            <item>
    
                <url>thumb/1.jpg</url>
    
                <linkTo>fullsize\1.jpg</linkTo>
    
                <des>text I would like to appear in full image 1</des>
    
            </item>
    
            <item>
    
                <url>thumb/2.jpg</url>
    
                <linkTo>fullsize\2.jpg</linkTo>
    
                des>text I would like to appear in full image 2</des>
    
            </item>
    
            <item>
    
                <url>thumb/3.jpg</url>
    
                <linkTo>fullsize\3.jpg</linkTo>
    
                des>text I would like to appear in full image 3</des>
    
            </item>
    
            <item>
    
                <url>thumbs\4.jpg</url>
    
                <linkTo>fullsize\4.jpg</linkTo>
    
                des>text I would like to appear in full image 4</des>
    
            </item>
    
            <item>
    
                <url>thumbs\5.jpg</url>
    
                <linkTo>fullsize\5.jpg</linkTo>
    
                des>text I would like to appear in full image 5</des>
    
            </item>
    
        </items>
    
    </menu>
    

    It's my as3, I tried to take as much code that is not required in this example.

    var xmlPath:String = "pictures.xml";
    var xml:XML;
    
    var loader = new URLLoader();
    loader.load(new URLRequest(xmlPath));
    loader.addEventListener(Event.COMPLETE, xmlLoaded);
    
    function xmlLoaded(e:Event):void
    {
    
         
         if ((e.target as URLLoader) != null )
         {
              xml = new XML(loader.data);
              createMenu();
         }
    }
    
    var numberOfItems:uint = 0;
    var menuItems:Array = new Array();
    
    function createMenu():void
    {
              numberOfItems = xml.items.item.length();
    
         var count:uint = 0;
    
              for each (var item:XML in xml.items.item)
         {
    
              var imageLoader=new Loader();
              var menuItem:MenuItem = new MenuItem();
    
              menuItem.addChild(imageLoader);
              
              imageLoader.load(new URLRequest(item.url));
              
              menuItem.linkTo = item.linkTo;
              menuItem.mouseChildren = false;
              menuItem.addEventListener(MouseEvent.CLICK, itemClicked);
              menuItems.push(menuItem);
              
              addChild(menuItem);
              
              count++;
         }
         ***();
    }
    
    function ***():void
    {
         //menuItems.sortOn("zpos3D", Array.NUMERIC | Array.DESCENDING);
         for (var i:uint = 0; i < menuItems.length; i++)
         {
              setChildIndex(menuItems[i], i);
         }
    }
    
    //**************************************loader for large images*************************************
    
    var loader_mc : Loader = new Loader();//loader_mc var for below itemClicked function
    
    //This function is called when a thumb is clicked
    function itemClicked(e:Event):void
    {
         var urlRequest:URLRequest = new URLRequest(e.target.linkTo);//Navigate to the URL that's assigned to the menuItem
         loader_mc.load(urlRequest);//adds the urlRequest to our loader_mc ;
    }
    
    //calling "contentLoaded" function if loading is over;
    loader_mc.contentLoaderInfo.addEventListener(Event.COMPLETE, contentLoaded);
    
    function contentLoaded(e:Event):void
    {
         addChild(loader_mc);//adds loader_mc to the stage     
    }
    

    No, you have some already loaded in your menuItem objects with the "menuItem.des = item.des;" line of code... which means this object contains the text of actual description right here.  If you just need to assign to the textfield object that you want to use to display the description.  In my example I named it 'someTextField', but you can name but you want.  Read my other answer about which you assign this value to the TextField.

  • PHP, xml and Flash

    Hello

    Someone can help me. I try to query an sql database and echo the image in xml format so I can display the image in flash.

    I already know how to query and echo the url of the image of the database.

    This is the code:

    The database is queried at this stage already.

    echo "<? XML version=\"1.01\"? " "> \n";

    echo "< content > \n";

    While ($Nile = mysql_fetch_assoc (Run))

    {

    echo "< point >." $nile ['content']. "" < / item > \n ";

    }

    echo "< / content > \n";

    Flash I creat table to insert a URL and an xml object echoes images. It looks like this.

    This is after you have created the table of object and xml next url the loop for to insert the XML.

    thexml.onLoad = function)

    {

    var photos: Array = thisfirstChild.childNodes;

    for (i = 0; i < photos.length; i ++)

    {

    This pushes the XML in a table of URLs

    URLs.push (photos [i]. Attributes.URL);

    }

    This is supposed to load individual data into the flash movie object.

    movieobject.loadMovie(urls[0]);

    movieobject.loadMovie(urls[1]);

    }

    x.Load (Content.php);

    The echo in the first code xml produces a url link that contains a link to an image in the database. The flash is supposed to display the image on a flash clip call movieobject animation. I have some difficulty in getting the image displayed in flash. If anyone can change or provide the new code, it would be really useful.

    More PHP XML , you can view

  • XML and film of multiple images

    A Flash AS3 question:

    If you import an XML file into frame 1 of a multiple image film. Is the accessible XML in other than farmed frames 1 (say 20 frame)?

    Thank you

    It is accessible from anywhere (using the correct path) anytime AFTER loading is complete.

  • I am trying to open a file for Flash CS4, but for some reason any when I tried to open it, I discovered that the file may have become damaged or corrupted, and Flash CS4 was impossible to open the file ~ is it possible can we fix that?

    How to recover a file that has a reputation for being corrupt or damaged?

    Go to Flash Professional forum

  • Flash CS4 and XML

    Hello

    I use Flash CS4, I have problems by creating an xml file to work

    with action script for a 3D carousel. I created the folder for

    image png icons and xml file using a normal Notepad in windows

    for file works with flash action script 2.0, but in the menu output said msg

    Error opening URL "file:///C|/Users/User/Documents/caroselFile/icons.xml".

    They are not the compiler errors. Notepad or xml editor? I've been

    can I use a normal notebook?

    Maybe I should of saved in the directry fla, but don't know where

    This is the case.

    Thanks Larell

    You can use an absolute path, but the chances of error are much greater than when you use a local path.  In addition, your absolute path does not work when you deploy your swf (on a server under an air or as a file of projection).

    Use a relative path.  the easiest way is to put the xml file in the same directory with your html and swf, fla.  You can then use:

    yourxml. Load ("icons.xml");

    I like to keep xml files in a subfolder of the xml file that contains my html and swf, fla.  in this situation, you would use:

    yourxml. Load("XML/icons.xml");

    but whenever you have a path problem, the best bet after a few checks and emerge from the spelling is to the file to be loaded into the same directory as all flash files and make sure you can get this to work.  then start moving files to create a cleaner more logical Setup, if that suits your needs.

  • Problem with the loading of XML and xmlns

    I'm having a problem with loading an XML file that was created by Filemaker.  FileMaker will display an XML file by using one of two different grammars.  A poster of a standard form for the most that I can use with a glitch.  Flash CS4 AS3 seems to have a problem with the xmlns in one of the nodes.

    More precisely:

    " < FMPDSORESULT xmlns =" http://www.FileMaker.com/fmpdsoresult "> "

    ' If I remove the xmlns = " http://www.FileMaker.com/fmpdsoresult 'the file is loaded properly and I can access the different fields without problem.  However, when I go the xmlns =..., it will trace the XML properly but I can't access the fields by using the code below.  It drives me crazy!

    With part xmlns in the XML file, I get the following error when attempting to load the thumbnails files:

    TypeError: Error #1010: a term is undefined and has no properties.

    I need it so that the user can enter/change the data and simply output the XML file of Filemaker and then the Flash load the XML file not corrupted and displays the information requested by the user.  That is to say I might have the user open the XML file in a word processing application and have remove them the xmlns..., but it is rather heavy and not very user-friendly.

    I tried all the xml.ignore functions I could find, but it does not help.  I hope someone out there can help you

    Thank you

    -Brand-

    _____________________________________________________________________________________

    Partial XML:

    XML to export Filemaker:

    <? XML version = "1.0" encoding = "UTF-8"? >
    <! - this grammar has been deprecated - use the FMPXMLRESULT instead.
    " < FMPDSORESULT xmlns =" http://www.FileMaker.com/fmpdsoresult "> "
    < ERRORCODE > 0 < / ERRORCODE >
    Sport.FP7 < DATABASE > < / DATA >
    < LAYOUT > < / PAGE layout >
    < LINE MODID = '1' RECORDID = "1" >
    Brand of < FirstName > < / name >
    Fowle < name > < / LastName >
    Veil of < sport > < / Sport >
    Medal of <>no < / medal >
    Design of < CourseOfStudy > < / CourseOfStudy >
    < year > 1976-1978 < / year >
    California < HomeState > < / HomeState >
    < ImageName > 93 < / ImageName >
    < / ROW >

    ...

    < / FMPDSORESULT >

    __________________________________________________________________________________

    AS3 code:

    Import fl.containers.UILoader;
    var aPhoto: Array = new Array(ldPhoto_0,ldPhoto_1,ldPhoto_2,ldPhoto_3,ldPhoto_4,ldPhoto_5);
    var toSet:int = 10; time to time delay
    var toTime:int = place;
    var photoPerPage:int = 6;
    var fromPos:int = photoPerPage;
    var imgNum:Number;

    var subjectURL:URLRequest = new URLRequest ("testData_FM8.xml");
    var subjectURL:URLRequest = new URLRequest ("Sports.xml");
    var xmlLoader:URLLoader = new URLLoader (subjectURL);
    xmlLoader.addEventListener (Event.COMPLETE, xmlLoaded);
    var subjectXML:XML = new XML();
    subjectXML.ignoreWhitespace = true;
    subjectXML.ignoreComments = true;
    subjectXML.ignoreProcessingInstructions = true;

    function xmlLoaded(evt:Event):void {}
    subjectXML = XML (xmlLoader.data);

    If {(root.loaderInfo.bytesTotal is root.loaderInfo.bytesLoaded)
    removeEventListener (Event.ENTER_FRAME, xmlLoaded);
    trace ("data XML file loaded");
    trace (subjectXML);
    } else {}
    trace ("file not found");
    }
    imgNum=2;//subjectXML.ROW.length;
    trace (subjectXML);
    loadThumb (0);
    }
    function loadThumb(startPos:int):void {}
    var count:Number = aPhoto.length;
    trace (subjectXML.Database);
    for (var i = 0; i < count; i ++) {}
    try {}
    aPhoto[i].source="images/"+subjectXML.ROW[startPos+i]. ImageName + "_main.jpg";
    } catch (error) {}
    trace (e);
    }
    aPhoto [i] .mouseChildren = false;
    aPhoto [i] .addEventListener (MouseEvent.MOUSE_DOWN, onThumbClick);
    }
    trace ("current mem:" + System.totalMemory);
    ldAttract.visible = false;

    }
    function unloadThumb (): void {}
    var count:Number = aPhoto.length;
    for (var i = 0; i < count; i ++) {}
    aPhoto [i] .unload ();
    aPhoto [i] .removeEventListener (MouseEvent.MOUSE_DOWN, onThumbClick);
    }
    trace ("current mem:" + System.totalMemory);

    }

    function onThumbClick(evt:MouseEvent) {}
    var i: Number;
    trace ("Thumbnail clicked" + evt.target.name);
    i = findPos (evt. Target.Name);
    ldLrgPhoto.source="images/"+subjectXML.ROW[i+fromPos]. LOCAL_OBJECT_ID + "_main.jpg";
    ldLrgPhoto.visible = true;
    btnPrev.visible = false;
    btnNext.visible = false;

    gotoAndStop ("showPhoto");
    }
    function findPos(thumb:String):Number {}
    var pos:Number;
    var count:Number = aPhoto.length;
    for (var i: Number = 0; i < count; i ++) {}
    If (thumb == aPhoto [i] .name) {}
    POS = i;
    }
    }
    return pos;
    }

    Mark,

    The ':' is what we call a scope resolution operator. Using namespace allows you to potentially have two or more nodes that have the same name but a namespace 'different '. "These are normally specified in xml in the form xmlns:mynamespace ="http://myuniqueURI.com/etc"

    Normally, you would use the mynamespace:node by naming your xml nodes that are specific to this namespace.

    But the best is that namespace by default, when there is no real Prefixeespacenom: in the name of node as:

    That's how it is specified in your xml file, that is to say all the nodes without a prefix belong to the filemaker namespace.

    In actionscript, you navigate by using the scope-resolution operator and the variable that represents the namespace does not necessarily resemble the part "mynamespace" above. In your case the namespace used was the one by default (no), but a value has been assigned.

    To the question of the length, you must use the length() method, otherwise the e4x filtering seeks nodes named 'length' and creating a XMLList with no entry in there (because it's not). It is a common thing with other "Properties" that are expressed in the form of methods like children() and often take me when I started with the model XML as3.

  • Property not found on flash.display.Loader charger and there is no default value

    Hi, I want to drag a single image of set of images loaded via xml, but it is showing an error.

    ReferenceError: Error #1069: property not found on flash.display.Loader charger and there is no default value.

    "hand / mouseDownHandler ()" thanks in advance...

    XML

    /////////////////////////////////////

    <? XML version = "1.0" encoding = "utf-8" standalone = "yes"? >

    < GALLERY >

    < IMAGE THUMB = "photo_tb/pic1.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic2.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic3.jpg" / > "

    < IMAGE THUMB = "photo_tb/pic4.jpg" / > "

    < / GALLERY >

    /////////////////////////////////////////////

    package

    {

    import flash.display. *;

    import flash.events. *;

    flash.net import. *;

    import flash.display.Sprite;

    import flash.display.Loader;

    import flash.events.MouseEvent;

    main/public class extends MovieClip

    {

    private var levelXML:XML;

    private var myLoader:URLLoader;

    private var my_images:XMLList;

    private var my_total:Number;

    private var my_thumb_width:Number;

    private var container_mc:MovieClip;

    private var my_mc:MovieClip;

    public void main()

    {

    levelXML = new XML();

    var XML_URL:String = "data / data.xml."

    var myXMLURL:URLRequest = new URLRequest (XML_URL);

    myLoader = new URLLoader (myXMLURL);

    myLoader.addEventListener (Event.COMPLETE, lanceApp);

    }

    private void startApp(e:Event):void

    {

    var myXML:XML = new XML (e.target.data);

    my_images = myXML.IMAGE;

    my_total = my_images.length ();

    createContainer();

    callThumbs()

    for each {(var niveau: XML dans levelXML.level)}

    trace (Level.leveltitle);

    trace (Level.identifyme);

    //}

    }

    private function createContainer (): void

    {

    container_mc = new MovieClip();

    container_mc.x = 50;

    container_mc.y = 50;

    my_mc.x = 100

    my_mc.y = 100

    addChild (container_mc);

    }

    private function callThumbs (): void

    {

    trace (my_total)

    for (var i: Number = 0; i < my_total; i ++)

    {

    'loader_' + i

    my_thumb_width = 100

    var thumb_url = my_images[i].@THUMB;

    var thumb_loader = new Loader();

    thumb_loader. Load (new URLRequest (thumb_url));

    thumb_loader.contentLoaderInfo.addEventListener (Event.COMPLETE, thumbLoaded);

    thumb_loader. Name = i;

    thumb_loader.x = (my_thumb_width * I);

    }

    }

    private void thumbLoaded(e:Event):void

    {

    var my_thumb:Loader = Loader (e.target.loader);

    container_mc. AddChild (my_thumb);

    my_thumb.contentLoaderInfo.removeEventListener (Event.COMPLETE, thumbLoaded);

    Sprite: var loader = Loader (e.target);

    var my_thumb:Loader = Loader (e.target);

    trace (my_thumb)

    my_thumb.addEventListener (MouseEvent.MOUSE_DOWN, mouseDownHandler);

    my_thumb.addEventListener (MouseEvent.MOUSE_UP, mouseUpHandler);

    }

    private void mouseDownHandler(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target.loader);

    container_mc. AddChild (my_thumb);

    e.target.startDrag ();

    }

    private void mouseUpHandler(e:MouseEvent):void {}

    trace ("mouseUpHandler");

    var sprite: Sprite = Sprite (event.target);

    sprite.removeEventListener (MouseEvent.MOUSE_MOVE, OnMouseMoveHandler);

    sprite.stopDrag ();

    }

    private void mouseMoveHandler(event:MouseEvent):void {}

    trace ("mouseMoveHandler");

    event.updateAfterEvent ();

    }

    }

    }

    In your function mouseDownHandler target you 'e.target.loader', however, e.target is a Loader and Chargers have no property loader.

    private void mouseDownHandler(e:MouseEvent):void {}

    var my_thumb:Loader = Loader (e.target.loader);

    Try just "e.target" instead since this should be your code is looking for.

    var my_thumb:Loader = Loader (e.target);

    Although you might find you need to use "e.currentTarget" instead since e.target can point to the content of the loader instead of the charger itself

  • Loading XML AS3.0 to different image

    Hi iam new in Actionscript code I have to run each image stay time for a different time period as for example "img1.jpg will be 20 sec and img2.jpg will be 10 sec' like that.

    Can someone help me here.

    This is the code I have below:

    {com package
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.display.Graphics;
    import flash.events.Event;
    import flash.display.StageScaleMode;
    import flash.utils. *;
    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    SerializableAttribute public class MyMovie extends Sprite {}
    declare variables...
    private var myXml:XML;
    private var myXMLURL:URLRequest;
    private var myLoader:URLLoader;
    private var imageList:XMLList;
    private var loader: Loader;
    private var number: number = 0;
    private var currentImage:Loader;
    private var interval: uint = 0;
    private var abc = 0;

    definition cunstructor...
    / * public function MyMovie() {}
    Super();
    var g:Graphics = this.graphics;
    g.Clear ();
    g.beginFill (0 x 000000, 1);
    g.drawRect (0, 0, 768, 1360);
    g.endFill ();

    }*/
    public void LoadXml(xmlPath:String_=_null):void {}
    var XML_URL:String;
    If (xmlPath == null) {}
    XML_URL = "data.xml".
    } else {}
    XML_URL = xmlPath;
    }
    myXMLURL = new URLRequest (XML_URL);
    myLoader = new URLLoader (myXMLURL);
    myLoader.addEventListener ("complete", xmlLoaded);
    }
    private void xmlLoaded(event:Event):void {}
    myXml = new XML();
    myXml = XML (myLoader.data);
    imageList = new XMLList();
    imageList = myXml.children ();
    loadImage();
    trace (ImageList [No.]. Child ("path"));
    }
    private void loadImage (): void {}
    clearInterval (interval);
    If (charger! = null) {}
    loader.unloadAndStop ();
    Charger = null;
    }
    ABC = 5000;
    var imagePath:String is imageList [No.] .child ("path");.
    var imageRequest:URLRequest = new URLRequest (imagePath);
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeHandler);
    Loader.Load (feeder);
    currentImage = loader;
    addChild (loader);
    }
    private void completeHandler(evt:Event):void {}
    clearInterval (interval);
    If (currentImage! = null) {}
    removeChild (currentImage);
    }
    currentImage = loader;
    currentImage.x = (768/2)-(currentImage.width/2);
    currentImage.y = (1360/2)-(currentImage.height/2);
    var myTween:Tween = new Tween (Regular.easeOut, 0, 1, 0.5, currentImage, "alpha", true);
    var myTween:Tween = new Tween (currentImage, "x", Strong.easeOut, 0, 0, 1, true);
    var myTween:Tween = new Tween (currentImage, "x", Strong.easeOut, 0, 768, 1, true);
    myTween.addEventListener ("motionFinish", TweenFinishedHandler);
    }
    private void TweenFinishedHandler(evt:Event):void {}
    no = no < imageList.length () - 1? No + 1:0;
    range = setInterval (loadImage, 3000);

    }
    }
    }

    XML file:

    <? XML version = "1.0" encoding = "iso-8859-1? >
    < root >
    < img >
    images/img1a.swf < path > < / path >
    < / img >
    < img >
    images/img2a.swf < path > < / path >
    < / img >
    < img >
    images/img3a.swf < path > < / path >
    < / img >
    < / root >

    Check your XML file as follows:

    images/img1a.swf
            10000

    images/img2a.swf
            20000

    images/img3a.swf
            30000

    and your code should be:

    package {}
    import flash.display.Sprite;
    import flash.display.Loader;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.display.Graphics;
    import flash.events.Event;
    import flash.display.StageScaleMode;
    import flash.utils. *;
    Import fl.transitions.Tween;
    Fl.transitions.easing import. *;

    public class loadClass extends Sprite {}
    declare variables...
    private var myXml:XML;
    private var myXMLURL:URLRequest;
    private var myLoader:URLLoader;
    private var imageList:XMLList;
    private var loader: Loader;
    private var number: number = 0;
    private var currentImage:Loader;
    private var interval: uint = 0;
    private var seconds: Number;

    definition cunstructor...
    public void loadClass() {}
    Super();
    var g:Graphics = this.graphics;
    g.Clear ();
    g.beginFill (0 x 000000, 1);


    g.drawRect (0, 0, stage.stageWidth, stage.stageHeight);
    g.endFill ();
    LoadXml();
    }
    public void LoadXml(xmlPath:String_=_null):void {}
    var XML_URL:String;
    If (xmlPath == null) {}
    XML_URL = "data.xml".
    } else {}
    XML_URL = xmlPath;
    }
    myXMLURL = new URLRequest (XML_URL);
    myLoader = new URLLoader (myXMLURL);
    myLoader.addEventListener ("complete", xmlLoaded);
    }
    private void xmlLoaded(event:Event):void {}
    myXml = new XML();
    myXml = XML (myLoader.data);
    imageList = new XMLList();
    imageList = myXml.children ();
    loadImage();
    trace (ImageList [No.]. Child ("path"));
    }
    private void loadImage (): void {}
    clearInterval (interval);
    If (charger! = null) {}
    loader.unloadAndStop ();
    Charger = null;
    }
    var imagePath:String is imageList [No.] .child ("path");.
    seconds = imageList [No.] .child ("sec");
    var imageRequest:URLRequest = new URLRequest (imagePath);
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, completeHandler);
    Loader.Load (feeder);
    currentImage = loader;
    addChild (loader);
    }
    private void completeHandler(evt:Event):void {}
    clearInterval (interval);
    If (currentImage! = null) {}
    removeChild (currentImage);
    }
    currentImage = loader;
    currentImage.x = (stage.stageWidth/2)-(currentImage.width/2);
    currentImage.y = (stage.stageHeight/2)-(currentImage.height/2);
    var myTween:Tween = new Tween (Regular.easeOut, 0, 1, 0.5, currentImage, "alpha", true);
    var myTween1:Tween = new Tween (currentImage, "x", Strong.easeOut, 0, 0, 1, true);
    var myTween:Tween = new Tween (currentImage, "x", Strong.easeOut, 0, 768, 1, true);
    myTween.addEventListener ("motionFinish", TweenFinishedHandler);
    }
    private void TweenFinishedHandler(evt:Event):void {}
    no = no< imagelist.length()-1="" no+1="" :="">
    trace (seconds);
    range = setInterval (loadImage, seconds);
          
    }
    }
    }

    Hope this solves

  • content Flash CS4 class loader is displayed in the browser

    Hello

    I am very new to Dreamweaver and actionscript, so any help would be greatly appreciated!

    I'm on a PC and created a simple gallery in flash cs4 to load images on click of a button.  The images are loaded with a class loader.  When I test the gallery in flash images loading properly.  However, I have inserted the .swf in Dreamweaver and when I downloaded the page on the server, the buttons and animation worked correctly, but none of the images have been posted.  I tested it in Firefox and IE, and it did not work in a browser.

    I thought that perhaps that the files were in an incorrect location, but everything is in the same file, including the .swf and images.  I'm also using TweenMax and all of these files are also with the .swf.

    I also made sure that I got the latest version of the Flash Player, but it still doesn't work.

    Thank you!

    Hello

    First place the following line above thetag.

    
    

    Also when I insert the following text to the address, http://dedications.ucdavis.edu/imgs/image01.jpg , I get a 404 message, this shows that the image is not in the place it should be, which shows that you have a problem with your link.

    PZ

  • Title and Description of loading external XML code

    I create an Autorun for CD using flash CS4 in which Tilelist will display the product image and cursor will slip into the images. When he's slipped, product title and Description must be specified. But instead of projection, text field is blank and nothing appears. Here is the code:

    Yes, looks like you have your information stored in XML attributes instead of nodes.

    Access it via my_xml.product[item].@label

  • Load Image and removes BitmapData

    Hello.

    I use the qnx.ui.display.image class to load an image that is in the package with the application, and it works fine. However, I'm looking at a bunch of functions that take BitmapData format of an Image, and I wonder how to load an image in a format of BitmapData, or how to convert the qnx.ui.display.image class to give me the BitmapData form.

    Thanks in advance.

    Note that the Image can take a URL, Bitmap, or BitmapImage in setImage().  And it has a cache property that is a qnx.utils.ImageCache.

    Apparently, qnx.utils.ImageCache.getImage () returns a BitmapData.  Looks like you need to know what URL cache stores under.  Not sure how you would find out that unless the image had been loaded in the first place of a URL.

    The BitmapData docs say you can load with flash.display.Loader, then it can be assumed if you were loading from a URL that you would get directly, bypassing the ImageCache stuff.

    (I don't have a direct answer, sorry.)

  • Flash will load audio but not video... and then crashes...

    Flash will load the audio from a video, but the video display will be green.  The player then crashes.  Initially, this was just my videos from YouTube.com, but now I have problems with Windows Media Player Classic (and sometimes with Windows Media Player).  I tried uninstalling and reinstalling several times.  Flash is not displayed in my programs, but can I uninstall in Control Panel.

    I have Windows 7 and 64-bit.

    I use the 10.3.181.34 version.  According to http://www.adobe.com/software/flash/about/ I have a flash installed successfully.  Yes, I see the image.

    These are the files in my SysWOW64 > C:\windows\system32\macromed > Flash

    Flash10m.ocx

    FlashInstall.log

    flashplayer. XPT

    FlashUtil10u_Plugin.exe

    install.log

    Npswf32.dll

    I use Firefox 5.  Shockwave Flash 10.3.181.34 is enabled.

    I have no idea what to do. Help.

    As soon as I read 'green' in any position, the first thing that comes to mind is to disable hardware acceleration.  Right-click on the Flash Player test page and select settings.  Then on the display panel uncheck "enable hardware acceleration".

  • How the loading image in as3 without XML?

    Hey Hi,

    Can someone help me please, I want to load image wihout using XML.

    How can I do this?

    Thank you


    JaxNa

    The only thing you need XML for is to load in a list of images... it isn't as you need. You load images and swf with a Loader object files - and there is a lot of info in the help. In short, if you can simply do:

    var myLoader:Loader = new Loader();

    myLoader.load (new URLRequest ("myimage.jpg"));

    addChild (myLoader);

Maybe you are looking for

  • Why the back button isn't a drop-down list to go back multiple levels in Firefox 4? Y at - it an option to reactivate the which?

    Before that I've upgraded to Firefox 4, the back button (as it is in all other browsers under the Sun,) had a drop-down list so you could spend a layer of back up and fall back on several levels. This is particularly important when there is a site yo

  • Satellite A300-2 TB-Ethernet network card problem

    Hi all I have a laptop Satellite A300-2 CT with Windows XP SP3 for a year. There is a problem in the network ethernet card, I think. If I connect my computer to a wireless network, all right. However, if I connect the computer to a wired network via

  • Access waveform data passed in a DLL

    Hello I'm working on a LabVIEW application that processes the continuous stream, 2 ms/s, 32 analog input channels, each channel. This application has a DLL built in order to improve the table great handling performance in LabVIEW. Initially, I fed th

  • Fixed IP address assignment to a PAP2T

    PAP2T hung in the WRT54G. When I put the config PAP2T DHCP = Yes, it works fine, but the router assigns a dynamic IP address. When I put the PAP2T for DHCP = No and provide a fixed IP, subnet mask and gateway, it does not connect to the host of VOiP.

  • Validity (WBF) sensors (PID = 0018) does not not on windows 8

    Hello I have a problem with the validity sensor (WBF) (PID = 0018) After I between windows 7 to windows validity sensor 8 does not work on dv6 3300 ev I get the message This device cannot start. (Code 10) The process hosting the driver for this devic