XML +loadMovie

I'm trying to create a menu through XML and i'm using 2
attributes in dat XML one is buttons name and another is link.
This link is not a URL this is a name of another swf which i
wanna load.
stop();
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
var btn_arr = new Array();
var link_arr = new Array();
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
total = xmlNode.childNodes.length;
xml_arr = xmlNode.childNodes;
for (i=0; i<total; i++) {
btn_arr.push(xml_arr
.attributes.heading);
link_arr.push(xml_arr.attributes.pageToLoad);
trace('"'+link_arr
+'"');
makeButtons();
function makeButtons() {
for (var i = 0; i<xml_arr.length; i++) {
button0_mc._visible = false;
var btn = button0_mc.duplicateMovieClip("btn"+i+"_mc",
1000+i);
btn._y =
this["btn"+(i-1)+"_mc"]._y+this["btn"+(i-1)+"_mc"]._height+5;
btn._x = 1.1;
btn.button_txt.text = btn_arr;
btn.onRollOver = function() {
trace(bt._name) //always come to btn4_mc
this.effectIn("in");
btn.onRollOut = function() {
this.effectIn("out");
btn.onRelease = function() {
loadMovieNum('"'+link_arr
+'"', i+10); //showing error loading URL
xmlData.load("xml/menu.xml");
//////////////////////////////////// XML
<nav>
<nav_item heading="Home" pageToLoad="site.swf" />
<nav_item heading="About Flash" pageToLoad="flash.swf"
/>
<nav_item heading="Flash Resources"
pageToLoad="resources.swf" />
<nav_item heading="Flash Forums" pageToLoad="forums.swf"
/>
<nav_item heading="Contact Us"
pageToLoad="contact_us.swf" />
</nav>

Hi,
Well first of all the [i-1] index is giving errors because
when you start with -1 index for XML childNodes that is NULL for
all values anyhow must be giving error for IMAGE only as NULL can
be assigned to STRING. I think you were trying to prevent the last
DUMMY node from loading but the flow was not correct. Second thing
is when you do get to the BARRY node structure your code is having
one typo plus required one addition to fecth the image(see attached
code). So you see it wasn't getting the image path anyhow hence the
errors.
Hope this helps.
Thanks and Regards,
Sumeet

Similar Messages

  • LoadMovie to load xml button file... undefined

    Hi, I am a designer and not familier with programming, my
    fiend purchased some flash buttons with xml file, when i run its
    swf its work perfect for me. there are 6 six buttons in it and i
    can easily change their name from xml file.
    ok here is the problem
    i want to assemble those button in another file and just
    those buttons to run from a different main file.
    i made a movie clip container and gave it an instance name
    holder_mc
    on main file on frame action i wrote this
    loadMovie("button.swf","holder_mc");
    ok there are loading in my file but problem is that now i see
    only one button now and written Undefined on the buttons.
    i am not sure why they are not working , i followed many
    online tutorials on loadMovie and did exactly same...
    one thing is interesting see here.. without xml files are
    loading perfect but with xml file i always get error even though
    xml file is already in my folder.
    I look forward to learn something from your experts.
    thank you very much
    i am using flash 8 professional. AS 2.0

    ok this time i made nav bar my main .. this time i am not
    loading nav bar in another movie since i was really undefined error
    but this time i have another xml file which is only a simple xml
    file but when i click on nav bar to load another swf file which is
    txt file, it loads but i don't see anything on it, no text , no
    content nothing there... even though when i view it separtly it
    works fine..
    any help would be appreciated.
    thanks

  • LoadMovie XML problem

    I Have a photo gallery that uses XML to get its thumbnails
    and Images. It works perfectly on its own. But what i want to do is
    embed it in another .SWF When I do this:
    quote:
    loadMovie("photos_04.swf", _root.holder);
    the SWF photos_04.swf loads, but not with 100% functionality.
    for example my buttons don't work but the first image loads.
    Example1(standalone):
    http://www.zvision.net/pg/photos_04.swf
    Example2(embeded):
    http://www.zvision.net/pg/container_04.swf
    Please notice how the
    icon buttons on the button do not link in the
    container_04.swf, yet they do in the photo_04.swf

    Here is the code for the loaded swf;
    The _lockroot is applied to the loader movie clip
    I think the problem may lay in the 9th line.
    XMLData = new XML();
    XMLData.load("cal.xml");
    XMLData.onload = viewApp;
    function viewApp () {
    mainTag = new XML();
    arrCal = new Array();
    arrDate = new Array();
    arrMsg = new Array();
    mainTag = this.firstChild.nextSibling;
    if (mainTag.nodeName.toLowerCase() == "diary") {
    arrCal = mainTag.childNodes;
    for (i=0; i<=arrCal.length; i++) {
    if (arrCal
    .nodeName == "cal") {
    if ((arrCal.attributes.yearID == myNewYear) and (arrCal
    .attributes.monthID == myNewMonth)) {
    arrDate = arrCal.childNodes;
    for (j=0; j<=arrDate.length; j++) {
    if (arrDate[j].nodeName == "date") {
    diaryDate = arrDate[j].attributes.id;
    myDiary = _root["Numbers" + diaryDate];
    myDiary.gotoAndStop (3);
    arrMsg = arrDate[j].childNodes;
    for (k=0; k<=arrMsg.length; k++) {
    if (arrMsg[k].nodeName == "msg") {

  • LoadMovie() &  XML.onLoad query(AS2)

    Hi all :)
    I have a Flash file that uses the loadMovie () to load JPG
    files successfully, example:
    imageuri = "../images/00_proto" + var1 + ".jpg";
    holder_mc.holder0.loadMovie(this["imageuri"]);
    Working
    Example
    'holder_mc' is the container clip and 'holder0' is the clip
    that stores the loaded JPG file, this works fine.
    I am upgrading the Flash file using an XML database, code
    example:
    var statesXML:XML = new XML();
    statesXML.ignoreWhite = true;
    statesXML.load("../XML/USA.xml");
    statesXML.onLoad = function(success)
    // XML loading excluded
    // Problem code
    imageuri = "../images/00_proto" + var1 + ".jpg";
    _parent.holder_mc.holder0.loadMovie(this["imageuri"]);
    The JPG's are not being loaded into the 'holder0' clip from
    inside the XML.onLoad() method. Spent hours trying to fix this,
    still have not resolved the problem. Any responses much welcomed!
    regards
    John
    www.javono.com

    Hi John,
    Its diffcult as I don't know what you've tried before, but my
    first stop would be to trace out imageurl to make sure the path to
    the image is correct (although usually you'll get an error message
    if not). Are you sure you need _parent. on the start of that path?
    Have you tried it without that?
    Tom.

  • LoadMovie Messing with my Mind - and XML

    Hello,
    I'm having a little trouble loading a loadMovie containing a
    page with XML. There is basically a main.swf that loads a
    product.swf in a Movie Clip called "container". Standalone the
    product page works fine. When I load in the product.swf it break
    the code. It no longer generates the thumbnails from an
    attatchMovie, or loads the XML. I a little lost, aand a little
    tired, can someone help me out.... Thanks...

    I noticed calls to _root in the AS you included for
    product.swf. If so, that could very well be the problem. Your
    main.swf is going to be _root after you make the
    loadMovie("products.swf") call. If possible, change your _root
    calls in product.swf. I would define a variable in the products.swf
    timeline that stores the products _root timeline name. Then make
    the call to that variable in product.swf in place of _root. I've
    seen colin moock do this in numerous scripts he's written. I've
    used them before in the past but without samples available (on a
    separate hdd) at the moment, I can't remember the exact way to do
    this.

  • LoadMovie(XML) vs.Enterframe

    I am creating a swf slideshow from an external XML file. the
    XML system loads the swf movies into a movie symbol on the stage.
    The symbol has a format function for scale and position, and
    updates within an onEnterFrame code block based on stage size. When
    the swf loads into the symbol, it no longer updates its scale or
    position based on the stage size.
    I know that loading swfs causes the dimensions to adjust,
    however the dimesions of the container are based on an equation for
    stage size adjustment by the user. So...in theory the dimensions of
    the container should be controlled by constant calls to the
    enterFrame.
    This is the Enterframe Block and format function:

    When the httpservices completes isn't the result bound to an arrayCollection (or array) so you could essesntially accomplish anything you want, sort search etc..
    Is the XML result directly bound to a datagrid or is it bound to arrayCollection first and then bind the arrayCollection to the data grid?
    From the network layer comparison, say you have 100 rows with 10 columns, the file size of XML vs CSV makes a big difference.  Do you think this warrants bringing the file as CSV instead of XML?  You also have to consider the server side doing the extra formating.  You will notice a big difference in an enterprise database if its doing extra work and file I/O.
    Being so used to ODBC-RAW data, I'm finding some apps are slow because of the XML format and I'm looking for an alternative similar to the ODBC-RAW data format.  I do agree that you can do more with XML but if it's just use for say in drop down list, data grid and not so much for formatting, I think CSV will do just fine.  I would however, bring in a single row as XML.
    Thanks for replying back so quickly.
    -nobody-

  • How do I hyperlink in XML?

    Hello. I currently am building a new project, which is a carousel. The carousel itself is OK, everything works, including the click the icon to read the description. The only problem is that I need to have a hyperlink in one of the descriptions. I know how to hyperlink in HTML, and tried that in XML, but it didn't work. I also tried XSL or something to link but that just screwed up the SWF file itself. Here is my XML code.
    <icons>
    <icon image="icon1.png" tooltip="Helicopters" content="MA Furion 450
        Head Servo's- Hitec HS-5065mg
        Gyro/Tail Servo- Spartan DS760/ Futaba s9257
        Motor- MA 4400kv -6
        Esc- MA 60amp
        Hyperion Blades
        SMC 2200 3s 40c Packs
    Align T-Rex 600E
        Head Servo's- Hitec HS5925mg
        Gyro/Tail Servo- Futaba GY401
        Motor Align 600l
        ESC- Align 75amp
        Radix Blades
        Kasama Tail with TT and Metal Head
    Gaui Hurricane 550
    Gaui Hurricane 200" />
    <icon image="icon2.png" tooltip="About Me" content="My Name is Robert McQuillen, I'm 12 year's old and I have Been flying for about 8 months and I Currently fly a MA Furion 450, Trex 600e, Gaui 550, Gaui 200. I've met some very nice people in this hobby that have helped me out alot." />
    <icon image="icon8.png" tooltip="Videos" content="http://www.youtube.com/watch?v=jBLJEhqAFMA
    http://www.youtube.com/watch?v=Z3MCXnFt4sE" />
    <icon image="icon4.png" tooltip="Sponsers" content="Currently, I have no sponsers but if you wish to contact me to sponser me, you can email me at
    [email protected]" />
    <icon image="icon5.png" tooltip="Events" content="RCCR Ray Edmounds Memorial Fun Fly - June  28th- (OVER WITH)
    IRCHA Jamboree - August 12 - 15
    RAMS Open House - August 22 - 23
    RAMS Northeast Helicopter Jamboree - August 28 – 30
    NEAT Fair - September 18 - 20
    Keystone Indoor Electric Fly - October 17 - 18 ( Not Confirmed)" />
    <icon image="icon6.png" tooltip="Photos" content="Photos are going to be uploaded soon. Sorry for any inconveniences." />
    </icons>
    I'm trying to insert the link in the Photos section and the Videos section instead of having youtube links.
    The carousel file is
    import mx.utils.Delegate;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var numOfItems:Number;
    var radiusX:Number = 300;
    var radiusY:Number = 75;
    var centerX:Number = Stage.width / 2;
    var centerY:Number = Stage.height / 2;
    var speed:Number = 0.05;
    var perspective:Number = 130;
    var home:MovieClip = this;
    theText._alpha = 0;
    var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
        var nodes = this.firstChild.childNodes;
        numOfItems = nodes.length;
        for(var i=0;i<numOfItems;i++)
            var t = home.attachMovie("item","item"+i,i+1);
            t.angle = i * ((Math.PI*2)/numOfItems);
            t.onEnterFrame = mover;
            t.toolText = nodes[i].attributes.tooltip;
            t.content = nodes[i].attributes.content;
            t.icon.inner.loadMovie(nodes[i].attributes.image);
            t.r.inner.loadMovie(nodes[i].attributes.image);
            t.icon.onRollOver = over;
            t.icon.onRollOut = out;
            t.icon.onRelease = released;
    function over()
        //BONUS Section
        var sou:Sound = new Sound();
        sou.attachSound("sover");
        sou.start();
        home.tooltip.tipText.text = this._parent.toolText;
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
        home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
        home.tooltip._alpha = 100;
    function out()
        delete home.tooltip.onEnterFrame;
        home.tooltip._alpha = 0;
    function released()
        //BONUS Section
        var sou:Sound = new Sound();
        sou.attachSound("sdown");
        sou.start();
        home.tooltip._alpha = 0;
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            t.xPos = t._x;
            t.yPos = t._y;
            t.theScale = t._xscale;
            delete t.icon.onRollOver;
            delete t.icon.onRollOut;
            delete t.icon.onRelease;
            delete t.onEnterFrame;
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
                var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
                theText.text = t.content;
                var s:Object = this;
                tw.onMotionStopped = function()
                    s.onRelease = unReleased;
    function unReleased()
        //BONUS Section
        var sou:Sound = new Sound();
        sou.attachSound("sdown");
        sou.start();
        delete this.onRelease;
        var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
                tw.onMotionStopped = function()
                    for(var i=0;i<numOfItems;i++)
                        var t:MovieClip = home["item"+i];
                        t.icon.onRollOver = Delegate.create(t.icon,over);
                        t.icon.onRollOut = Delegate.create(t.icon,out);
                        t.icon.onRelease = Delegate.create(t.icon,released);
                        t.onEnterFrame = mover;
    function moveTip()
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover()
        this._x = Math.cos(this.angle) * radiusX + centerX;
        this._y = Math.sin(this.angle) * radiusY + centerY;
        var s = (this._y - perspective) /(centerY+radiusY-perspective);
        this._xscale = this._yscale = s*100;
        this.angle += this._parent.speed;
        this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
        speed = (this._xmouse-centerX)/2500;

    Oh my goodness, thank you SOOOO much!
    The site now works, and I don't get the glitches!
    Wonder if I can embed videos this way

  • How do I get my XML numeric values to show up when loaded into flash?

    Hi there,
    I've created an AS2 3D carousel  It loads text values in the "content" section of the code below -  including numbers and special characters into the .swf but...
    What I can't figure out, is how to get it so that the "Tooltip" loads the text into the movieclip, but can also have numeric and special characters in it.
    For example, I need the title of one of the icons on this carousel to be "3D Images," but only the "D Images" shows up from the XML text for the tooltip.  The content when a user clicks on the icon can include numbers, just not the titles for some reason.
    http://iongeo.com/collaboration_test_dev/video_arctic_imaging.html
    I think it has something to do with the way that my text is loaded from the xml document specifically for the tooltip and tipText for the movie clip.  Can numeric values be loaded into a movie clip in AS2?  PLEASE HELP!
    import mx.utils.Delegate;
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    var numOfItems:Number;
    var radiusX:Number = 300;
    var radiusY:Number = 75;
    var centerX:Number = Stage.width / 2;
    var centerY:Number = Stage.height / 2;
    var speed:Number = 0.05;
    var perspective:Number = 130;
    var home:MovieClip = this;
    theText._alpha = 0;
    theHeader._alpha = 0;
    var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
    tooltip._alpha = 0;
    var xml:XML = new XML();
    xml.ignoreWhite = true;
    xml.onLoad = function()
        var nodes = this.firstChild.childNodes;
        numOfItems = nodes.length;
        for(var i=0;i<numOfItems;i++)
            var t = home.attachMovie("item","item"+i,i+1);
            t.angle = i * ((Math.PI*2)/numOfItems);
            t.onEnterFrame = mover;
            t.toolText = nodes[i].attributes.tooltip;
            t.content = nodes[i].attributes.content;
            t.header = nodes[i].attributes.header;
            t.icon.inner.loadMovie(nodes[i].attributes.image);
            t.r.inner.loadMovie(nodes[i].attributes.image);
            t.icon.onRollOver = over;
            t.icon.onRollOut = out;
            t.icon.onRelease = released;
    function over()
        //BONUS Section
        home.tooltip.tipText.text = this._parent.toolText;
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
        home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
        home.tooltip._alpha = 100;
    function out()
        delete home.tooltip.onEnterFrame;
        home.tooltip._alpha = 0;
    function released()
        //BONUS Section
        home.tooltip._alpha = 100;
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            t.xPos = t._x;
            t.yPos = t._y;
            t.theScale = t._xscale;
            delete t.icon.onRollOver;
            delete t.icon.onRollOut;
            delete t.icon.onRelease;
            delete t.onEnterFrame;
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,150,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,250,1,true);
                var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
                var tw5:Tween = new Tween(theHeader,"_alpha",Strong.easeOut,0,100,1,true);
                theText.text = t.content;
                theHeader.header = t.header;
                var s:Object = this;
                tw.onMotionStopped = function()
                    s.onRelease = unReleased;
    function unReleased()
        //BONUS Section
        var sou:Sound = new Sound();
        sou.attachSound("sdown");
        sou.start();
        delete this.onRelease;
        var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,100,0,0.5,true);
        var tw:Tween = new Tween(theHeader,"_alpha",Strong.easeOut,100,0,0.5,true);
        for(var i=0;i<numOfItems;i++)
            var t:MovieClip = home["item"+i];
            if(t != this._parent)
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,100,1,true);
            else
                var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,100,t.theScale,1,true);
                var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,100,t.theScale,1,true);
                var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
                var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
                tw.onMotionStopped = function()
                    for(var i=0;i<numOfItems;i++)
                        var t:MovieClip = home["item"+i];
                        t.icon.onRollOver = Delegate.create(t.icon,over);
                        t.icon.onRollOut = Delegate.create(t.icon,out);
                        t.icon.onRelease = Delegate.create(t.icon,released);
                        t.onEnterFrame = mover;
    function moveTip()
        home.tooltip._x = this._parent._x;
        home.tooltip._y = this._parent._y - this._parent._height/2;
    xml.load("icons.xml");
    function mover()
        this._x = Math.cos(this.angle) * radiusX + centerX;
        this._y = Math.sin(this.angle) * radiusY + centerY;
        var s = (this._y - perspective) /(centerY+radiusY-perspective);
        this._xscale = this._yscale = s*100;
        this.angle += this._parent.speed;
        this.swapDepths(Math.round(this._xscale) + 100);
    this.onMouseMove = function()
        speed = (this._xmouse-centerX)/8000;

    Kglad, you are my HERO!
    Thanks so much for your reply, I did not know about the embed options within flash...
    Mike

  • Dynamically create empty mcs and asign elements from array and loadmovie

    I'm creating an educational game for my school students.
    A little boy is flying through the city when he encounters objects flying from left to right.
    He hears a SOUND eg: Dog - he must go and click the dog image with the flying cursor. There are at least 5 DIFFERENT objects that should be flying on the screen. There could be various of them at any one time.
    I have the roots of the images in an xml file. And the actual swf are in a file called IMAGE and the sounds in SOUND.
    My problem is that most tutorials I see use the attachmovie method but I don't want to put all the swf's in the library as there are hundreds.
    I have to use the loadmovie method.
    I take it I have to loop through the array and assign each element to an empty movieclip which in turn is in the loop so you get 5 empty clips - I will use i (index). It doesn't seem to be working. I shall keep trying and post back here if I get any luck but I'm running out of ideas.
    Then the objects have to float across the screen. Don't know whether to use tween object or onEnterFrame handler or other. AND someone has mentioned using setinterval to "spit out" the objects.
    BUT if I have five flying across the screen I'm left without clips to stick in any more.
    Oh my head hurts but I will keep going.
    CHEERS if any help is around. This should be quite a standard thng for game developpers. Code at the moment
    function loadEnemies():Void {
    enemy_xml = new XML();
    enemy_xml.ignoreWhite = true;
    enemy_xml.onLoad = function(success:Boolean) {
    if (success) {
    _root.parseEnemyXML();
    //enemy_xml.load("level_"+level+".xml");
    enemy_xml.load("data/animal_catch.xml");
    function parseEnemyXML():Void {
    rows = enemy_xml.firstChild.childNodes.length;
    for (var i:Number = 0; i<rows; i++) {
    var row_string:String = String(enemy_xml.firstChild.childNodes[i].firstChild.firstChild);
    _root["row_"+i+"_array"] = row_string; //MAIN ARRAY holds an array images/dog_a.swf/ images/cat_a.swf etc... all five
    _root.createEmptyMovieClip("enemyObjects", 1);
    enemyObjects.createEmptyMovieClip("holder_"+i, i);
    _root["object"+i] = new Sound(enemyObjects["holder_"+i]);
    trace(row_string);
    loadMovie["row_"+i+"_array"], ["holder_"+i]
    if (level == 1) {
    alerts_mc.play();
    } else {
    currRow = 0;
    rowCounter = 0;
    OK got to about here BUT
    a. I started to get confused around the createEmptyMovieClip part
    b. I KNOW I shouldn't have Sound(enemyObjetcs etc... BUT I copied the code from a tutorial and I don't know what to replace it with.
    I'm close but I need a little polishing.

    It doesn't do you much good to work with borrowed code that you do not understand.  Your best bet will be to start small, creating one functional piece of the puzzle at a time, and work your way up.  Start with making sure you are loading and parsing the xml properly, then set about loading the external content, then see about making that content move around, etc...
    In the code you show, your loadMovie line of code does not resemble anything I have seen before, looking more like (but not quite like) a multi-dimensional array element than a loadMovie() function call.  If you find you need to have control of the items as soon as they load, then you should consider using MovieClipLoader.loadClip instead of loadMovie.  The MovieClipLoader class provides features, such as to be able to determine when items have fully loaded.

  • Loading swf with XML on Click

    Hi all, can anyone help
    can anyone shine a little light onto a little confusion I am having, I have a menu that already loads in images via an XML file on a menu, what I am trying to do is when an image/meni Item is click I would like to load in an swf into the same place as the image Item loads into! am I making any sense.
    on a click event, do I use in the XML file the <link>link to swf</link>   ????
    this is what I have in my xml file that loads in the images so far;
    <image name="image 12" path="img/img12.jpg"
    title="Lorem ipsum 12"
    text="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi commodo 12" />
    what I am getting confused with is what I also put within the AS, I am sure it is not alot but I'm just not sure what needs to go where??
    this is what I have within the AS that loads in XML, I hope its ok to paste this code, never like posting to much code incase is scares people off, I just don't want to leave anything out, hope thats ok with everyone:eek:
    // Use URLLoader to load XML
    xmlLoader = new URLLoader();
    xmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
    // Listen for the complete event
    xmlLoader.addEventListener(Event.COMPLETE, onXMLComplete);
    xmlLoader.load(new URLRequest("data.xml")); 
    stage.addEventListener( MouseEvent.MOUSE_WHEEL, onMouseWheel );
    //———————————————EVENT HANDLERS
    private function onXMLComplete(event:Event):void
    // Create an XML Object from loaded data
    var data:XML = new XML(xmlLoader.data);
    // Now we can parse it
    var images:XMLList = data.image;
    for(var i:int = 0; i < images.length(); i++)
    // Get info from XML node
    var imageName:String = images[i].@name;
    var imagePath:String = images[i].@path;
    var titles:String = images[i].@title;
    var texts:String = images[i].@text;
    // Load images using standard Loader
    var loader:Loader = new Loader();
    // Listen for complete so we can center the image
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageComplete);
    loader.load(new URLRequest(imagePath));
    // Create a container for the loader (image)
    var holder:MovieClip = new MovieClip();
    holder.addChild(loader);
    var button_main:Button_mr = new Button_mr();   /
    holder.addChild(button_main);               
    var tooltip:ToolTip = new ToolTip();
    tooltip.field.text = titles;  //loads tooltip 1
    tooltip.field2.text = texts;  //loads tool tip 2
    tooltip.x = -350; 
    tooltip.y = 0;   
    holder.addChild(tooltip);
    // Same proceedure as before
    holder.buttonMode = true;
    holder.addEventListener( MouseEvent.CLICK, onMenuItemClick );
    // Add it to the menu
    circleMenu.addChild(holder);
    many thanks for any help!!!!

    1. Be sure in main.swf there is no masking or layering hiding
    the reflection area. A way to test quickly is to load in a plain
    master swf that is much larger than the externals swf.
    2. Know the weakness of loadMovie for timing issues that
    require the external movie to be fully loaded before actions are
    taken on it. I see a bunch of these in the code you posted. Best to
    use
    MovieClipLoader.onLoadInit
    before you attempt to access the external swf properties or code or
    add code.
    3. Be sure the code is firing on load and all objects are
    created. Add some trace statements for those objects.
    4. I noticed you do not use BitmapData so this may not be
    relevant but be sure to add
    System.security.allowDomain("*");
    to the main.swf as well as in external swfs and only if you
    are using the BitmapData class.
    5. As I started to look at the code a bit and noticed this
    item:
    There is no constructor for the Flash MovieClip class. You
    will not see a compiler error message because you do not have the
    code wrapped into a class.
    var home:MovieClip = new MovieClip();
    However it does not have impact on the code.
    better would be
    var home:MovieClip;

  • CDATA links in xml document

    Hello all,
    I am trying to add an html link inside a parapgraph of text that is loaded through an xml document. I have done some research and it appears I need to set my actionscript to read the html. When I add the href in the text it reads literally as the code instead of creating a hyperlink in the paragraph. My problem is I did not set up the original flash document and I anot sure where to add the htmlText=true; and so on.
    Here is the link. The problem is in the "press" section. last line in the paragraph of text. You can see the aref code not working.
    http://atelierdelalain.com/index_test.html
    Thanks in advance for any help!
    Sandra
    XML data:
    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <images>
            <pic>
            <image>http://atelierdelalain.com/press/01.jpg</image>
            <title><![CDATA[WHAT IS JAMES WEARING?]]></title>
            <desc><![CDATA[As you know by now, I love to incorporate the work of fine artisans and crafts people into the interiors I create for both myself and my clients; an individually handcrafted object really can make a space.
    This brings me to furniture maker Emmanuel Delalain and his company Atelier Delalain who are doing the most marvelous things in wood and metal. With clean elegant lines, highly considered functionality, and a rich sensual poetry to his work, it didn't surprise us to learn that Delalain honed his craft as a young man in the Southern French coastal workshop of his father and grandfather building sailboats.
    To view full article click here.<a href="http://www.strutdenver.com" target="_blank">Strut</a>]]></desc>
            <dims><![CDATA[]]></dims>
            <note><![CDATA[]]></note>
            <thumbnail>http://atelierdelalain.com/press/thumbs/01.jpg</thumbnail>
            <width>600</width>
            <thumbwidth>47</thumbwidth>
        <subpics>
        </subpics>
        </pic>
    </images>
    Actionscript Code:
    import mx.transitions.*;
    import mx.transitions.easing.*;
    displayWidth = Stage.width;
    function loadXML(loaded) {
        if (loaded) {
            xmlNode = this.firstChild;
            image = [];
            title = [];
            desc = [];
            dims = [];
            note = [];
            thumbnails = [];
            imageW = [];
            subimage = [];
            subthumb = [];
            subW = [];
            subArray = new Array();
            total = xmlNode.childNodes.length;
            for (i=0; i<total; i++) {
                image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
                title[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
                desc[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
                dims[i] = xmlNode.childNodes[i].childNodes[3].firstChild.nodeValue;
                note[i] = xmlNode.childNodes[i].childNodes[4].firstChild.nodeValue;
                thumbnails[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
                imageW[i] = xmlNode.childNodes[i].childNodes[6].firstChild.nodeValue;
                if (i == 0) {
                    thisX = 0;
                    w = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
                } else {
                    thisX = Number(w)+Number(2);
                    thisW = xmlNode.childNodes[i].childNodes[7].firstChild.nodeValue;
                    w = Number(thisX)+Number(thisW);
                //number of subpics
                total_subpics = xmlNode.childNodes[i].childNodes[8].childNodes.length;
                if (total_subpics != undefined) {
                    subArray[i] = new Array();
                    for (x=0; x<total_subpics; x++) {
                        subArray[i][x] = new Array();
                        subArray[i][x][0] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[0].firstChild.nodeValue;
                        subArray[i][x][1] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[1].firstChild.nodeValue;
                        subArray[i][x][2] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[2].firstChild.nodeValue;
                        subArray[i][x][3] = xmlNode.childNodes[i].childNodes[8].childNodes[x].childNodes[3].firstChild.nodeValue;
                thumbnails_fn(i, thisX);
            firstImage();
        } else {
            content = "file not loaded!";
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("flash/press.xml");
    listen = new Object();
    listen.onKeyDown = function() {
        if (Key.getCode() == Key.LEFT) {
            prevImage();
        } else if (Key.getCode() == Key.RIGHT) {
            nextImage();
    Key.addListener(listen);
    previous_btn.onRelease = function() {
        prevImage();
    next_btn.onRelease = function() {
        nextImage();
    p = 0;
    this.onEnterFrame = function() {
        filesize = picture.getBytesTotal();
        loaded = picture.getBytesLoaded();
        preloader._visible = true;
        if (loaded != filesize) {
            preloader.preload_bar._xscale = 100*loaded/filesize;
        } else {
            preloader._visible = false;
            if (picture._alpha<100) {
                picture._alpha += 10;
                subHolder._alpha += 10;
    function nextImage() {
        if (p<(total-1)) {
            p++;
            if (loaded == filesize) {
                ///////////// sub thumbs ////////////
                subHolder.removeMovieClip();
                if (subArray[p] != undefined) {
                    createEmptyMovieClip("subHolder", 10);
                    subHolder._x = 800;
                    for (z=0; z<subArray[p].length; z++) {
                        subthumbs_fn(p, z);
                    createEmptyMovieClip("Line", 1);
                    lineLen = z*60+z*5;
                    Line.lineStyle(1, 0x492F92, 100);
                    Line.moveTo(795, 0);
                    Line.lineTo(795, lineLen);
                    createEmptyMovieClip("Line2", 2);
                    Line2.lineStyle(1, 0x492F92, 100);
                    Line2.moveTo(895, 0);
                    Line2.lineTo(895, lineLen);
                } else {
                    Line._alpha = 0;
                    Line2._alpha = 0;
                subHolder._alpha = 0;
                ///////////// end sub thumbs ////////////
                picture._alpha = 0;
                picture.loadMovie(image[p], 1);
                //displayWidth = Stage.width;
                imageWidth = imageW[p];
                res = displayWidth-imageWidth;
                place = res/2;
                picture._x = place;
                title_txt.htmlText = true;
                title_txt.htmlText = title[p];
                desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
                picture_num();
    function prevImage() {
        if (p>0) {
            p--;
            ///////////// sub thumbs ////////////
            subHolder.removeMovieClip();
            if (subArray[p] != undefined) {
                createEmptyMovieClip("subHolder", 10);
                subHolder._x = 800;
                for (z=0; z<subArray[p].length; z++) {
                    subthumbs_fn(p, z);
                createEmptyMovieClip("Line", 1);
                lineLen = z*60+z*5;
                Line.lineStyle(1, 0x492F92, 100);
                Line.moveTo(795, 0);
                Line.lineTo(795, lineLen);
                createEmptyMovieClip("Line2", 2);
                Line2.lineStyle(1, 0x492F92, 100);
                Line2.moveTo(895, 0);
                Line2.lineTo(895, lineLen);
            } else {
                Line._alpha = 0;
                Line2._alpha = 0;
            subHolder._alpha = 0;
            ///////////// end sub thumbs ////////////
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            //displayWidth = Stage.width;
            imageWidth = imageW[p];
            res = displayWidth-imageWidth;
            place = res/2;
            trace("dW:"+displayWidth+"iW:"+imageWidth+"x:"+place);
            picture._x = place;
            title_txt.htmlText = true;
            title_txt.htmlText = title[p];
            desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
            picture_num();
    function firstImage() {
        if (loaded == filesize) {
            ///////////// sub thumbs ////////////
            subHolder.removeMovieClip();
            if (subArray[p] != undefined) {
                createEmptyMovieClip("subHolder", 10);
                subHolder._x = 800;
                for (z=0; z<subArray[p].length; z++) {
                    subthumbs_fn(p, z);
                createEmptyMovieClip("Line", 1);
                lineLen = z*60+z*5;
                Line.lineStyle(1, 0x492F92, 100);
                Line.moveTo(795, 0);
                Line.lineTo(795, lineLen);
                createEmptyMovieClip("Line2", 2);
                Line2.lineStyle(1, 0x492F92, 100);
                Line2.moveTo(895, 0);
                Line2.lineTo(895, lineLen);
            } else {
                Line._alpha = 0;
                Line2._alpha = 0;
            subHolder._alpha = 0;
            ///////////// end sub thumbs ////////////
            picture._alpha = 0;
            picture.loadMovie(image[0], 1);
            //displayWidth = Stage.width;
            imageWidth = imageW[0];
            res = displayWidth-imageWidth;
            place = res/2;
            picture._x = place;
            title_txt.htmlText = true;
            title_txt.htmlText = title[p];
            desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
            picture_num();
    function picture_num() {
        current_pos = p+1;
        pos_txt.text = current_pos+" / "+total;
    function thumbNailScroller() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        scroll_speed = 10;
        tscroller.onEnterFrame = function() {
            if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
                if ((_root._xmouse>=(hit_right._x-60)) && (thumbnail_mc.hitTest(hit_right))) {
                    thumbnail_mc._x -= scroll_speed;
                } else if ((_root._xmouse<=(hit_left._x+60)) && (thumbnail_mc.hitTest(hit_left))) {
                    thumbnail_mc._x += scroll_speed;
            } else {
                delete tscroller.onEnterFrame;
    function thumbnails_fn(k, xpos) {
        thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
        tlistener = new Object();
        tlistener.onLoadInit = function(target_mc) {
            target_mc._x = xpos;
            target_mc.pictureValue = k;
            target_mc.onRelease = function() {
                p = this.pictureValue-1;
                nextImage();
            target_mc.onRollOver = function() {
                this._alpha = 80;
                thumbNailScroller();
            target_mc.onRollOut = function() {
                this._alpha = 100;
        image_mcl = new MovieClipLoader();
        image_mcl.addListener(tlistener);
        image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
    function scrollLeft() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        if (thumbnail_mc.hitTest(hit_right)) {
            thisX = thumbnail_mc._x;
            dist = hit_right._x-thumbnail_mc._x;
            r = thumbnail_mc._width-dist;
            if (r>=200) {
                newX = thumbnail_mc._x-200;
            } else {
                newX = thumbnail_mc._x-r;
            new Tween(thumbnail_mc, "_x", Regular.easeOut, thisX, newX, .5, true);
    function scrollRight() {
        // thumbnail code!
        this.createEmptyMovieClip("tscroller", 1000);
        if (thumbnail_mc.hitTest(hit_left)) {
            thisX = thumbnail_mc._x;
            dist = hit_left._x-thumbnail_mc._x;
            if (dist>=200) {
                newX = thumbnail_mc._x+200;
            } else {
                newX = thumbnail_mc._x+dist;
            new Tween(thumbnail_mc, "_x", Regular.easeOut, thisX, newX, .5, true);
    buttonRight.onRelease = function() {
        scrollLeft();
    buttonLeft.onRelease = function() {
        scrollRight();
    function subthumbs_fn(p, z) {
        subHolder.createEmptyMovieClip("sub"+z, subHolder.getNextHighestDepth());
        sublistener = new Object();
        sublistener.onLoadInit = function(targ_mc) {
            //targ_mc._x = 800;
            targ_mc._y = 60*z+5*z;
            thumbWidth = subArray[p][z][3];
            thumbRes = 90-thumbWidth;
            thumbPlace = thumbRes/2;
            targ_mc._x = thumbPlace;
            trace(targ_mc._x);
            targ_mc.onRelease = function() {
                //p = this.pictureValue-1;
                //nextImage();
                picture._alpha = 0;
                picture.loadMovie(subArray[p][z][0], 1);
                //displayWidth = Stage.width;
                imageWidth = subArray[p][z][2];
                res = displayWidth-imageWidth;
                place = res/2;
                picture._x = place;
                this._alpha = 30;
                //picture_num();
            targ_mc.onRollOver = function() {
                targ_mc._alpha = 80;
                trace(targ_mc);
            targ_mc.onRollOut = function() {
                this._alpha = 100;
        sub_mcl = new MovieClipLoader();
        sub_mcl.addListener(sublistener);
        sub_mcl.loadClip(subArray[p][z][1], "subHolder.sub"+z);

    Thank you for your replies
    I tried adding the code mentioned, but I still can't get it to work. I added:
    title_txt.htmlText = true;
    title_txt.htmlText = title[p];
    desc_txt.htmlText = true;
    desc_txt.htmlText = desc[p]+" "+dims[p]+". "+note[p];
    Am I adding in the wrong place? The text box that has the html in it is the "desc_txt" box. Any clues as to where the code would go in relation to the above code listed?
    Again... thank you for all of your help. Really appreciated! 
    Sandra

  • Need help with this xml gallery !!!

    i have build a gallery but its very simple...... it takes images from xml file.
    i have attached all files in zip.
    i just want two things if anyone can help.
    first when i press next button it goes to next image but with no effect. it just displays next image ... i want to incorporate a sliding effect when the image is changed to another.
    and second i want to use autoplay feature.
    as soon as swf starts the images came one by one with difference of few seconds.
    thx in advance... i really need help in this....!

    You're welcome.
    I don't have an example to offer for the autorun.  You should be able to think it thru.  One key, as I mentioned is to preload all of the images first, that will allow for smooth playing of the show--no waiting for images to load between changes.  You can load them into empty movieclips and hide them (_viisible = false) until they are needed.  You could load them when called for, but you would have to put conditions on the displaying of things until the image loads, which will change when they are all loaded, so I recommend just loading them all first.
    For the timing you can use setInterval.  If something is going to be allowed to interupt the autorun, then you will need to make use of the clearInterval function as well, so that you stop the clock.
    Since you will be wanting to know when things are loaded, you will need to use the MovieClipLoader.loadClip method for loading the images instead of using loadMovie.  This is because the MovieClipLoader class supports having an event listener.  If you look in the help documents in the MovieClipLoader.addListener section, there is an example there that provides a fairly good complete overview of using the code.  The only difference is you'd be looking for the onLoadComplete event rather than the onLoadInit event.

  • Need help scrolling dynamic content from XML

    I am trying to make a photo gallery and I have succeed in
    importing the pictures from XML into Flash. There are still two
    problems:
    1. The content is loading into a movieclip and I tried to
    place a scroll pane on the stage to adding scrolling capabilities.
    I set the parameters to control the movieclip that holds the
    thumbnails but it is not making a scroll bar. I can see the
    pictures inside of the scroll pane but it will not scroll to show
    the rest of the pictures.
    2. I can not figure out how to space the thumbnails evenly. I
    made a variable and multiplied the x position of each picture by it
    but there are large differences between landscape and portrait
    pictures.
    Thanks for the help

    You need to switch from using loadMovie to using the
    MovieClipLoader object. This object has a listener called
    "onLoadInit" that allows you to get the size of your photo when it
    comes in, but before it appears on stage, so that you can adjust
    its placement. Check out the help docs for info on usage.
    WL

  • Load images via xml/parameters, and assign URL

    Hi All
    I am trying to do a simple gallery that will loop around
    three images or so
    and when you click on them the page goes to a given URL.
    I found a generic example gallery, that reads the image
    sources in from an
    XML file but it does not have an event attached to it for the
    initial click.
    The code is this (looping around each node of XML):
    imageData = new Object;
    imageData.path = imageNode.attributes.path;
    imageArray[s]=imageData;
    imageNode = imageNode.previousSibling;
    I have tried putting:
    imageData.href = "
    http://www.google.com";
    imageData.url = "
    http://www.google.com";
    But to no avail.
    Does anybody have any suggestions or ideas?
    Many thanks
    Darren

    create arrays that contain the same info as the xml.
    p.s.  and, you'll use attachMovie() instead of loadMovie().

  • XML scrolling thumbnail, image loader, & Buttons [halfway works]

    Intro:
    I started a flash-based website a few years ago. Back in 2006 I was able to get a xml scrolling thumbnail, image loader to work without a glitch.
    For numerous reasons I had to put the project on hold until now. [one was that my 30 day trial of flash expired and only recently was I able to purchase the Adobe Web Suite CS4 as well as a new computer which could run the apps.]
    Last Friday saw a bump in the road in the development of my site as two, rather straightforward task, turned into something short of a nightmare as I have been unable to get past these two, seemingly, relatively simple task.
    I have posted in 4 other flash forums the issues, in detail, that I am facing - and have quite a bit of interest/views in the topic as the numbers suggest - yet no response/answer as of yet. [Which confirms other messages I have seen which seem to state that working with buttons has become increasingly difficult with the newer version of flash - something Im a bit surprised with actually from Adobe. - I would have thought there would be a palette where you could set parameters...]
    Screenshot of Site/Timeline:
    Before getting into the two questions I have, I would like to post an image of the site as it looks whenever an swf file is saved out, as well as a piece of the timeline in the back for reference.
    Issue #1
    As of now when the swf file is saved out you get exactly what you see above:
    a: A scrolling thumbnail
    b: ...which loads a large image when clicked on it - PEFECT...
    BUT...
    1a: I need for the buttons to load in this action, not for it to just load on its own.
    [i.e., the silk_paintings gallery is what is open, so I need the "silk_paintings" button to call up this action]
    note: Initially I had attacked this problem by taking out the actions layer you see above and applying it directly to the individual buttons with some crude MouseEvent Listener/Handerls... that did not work - at all.
    Im sure it may be "easier" to make an array out of it, but with my coding level it may be "easier" to apply it to the buttons.
    1b: How I currently see it, I would take the xml-list and duplicate it for the number of galleries I have.
    [I would then re-name the xml-list to reflect the name of the galleries they are to represent, i.e. "silk_paintings"]
    [also, I would have to rename the folders to "thumbnails1,2,3, etc., & "images 1,2,3, etc"
    From there I would duplicate the actions and paste it into the buttons, changing the xml-list name to that of "silk_paintings", etc., as well as write in the MouseEvent listener Handler to make it work. [ah, ha, but what is that magic phrase, I have tried to implement various code from other tutorials, and all in vein.]
    Issue #2
    At this point I would be tickled pink just to get this to basic function to work.
    However, once the buttons are working and calling up the xml, etc., then I need the buttons to stay on the semi-transparent blue color it is whenever in the 'hit' state. [note: NOT pictured above.]
    With the way the buttons are currently set up, and with wanting to use scripting to get them to interact with the thumbnail gallery, it will have to be some miraculous code to tell that button what color to stay as whenever its clicked, and of course it going back to white when another button is clicked.
    Conclusion:
    Since this is an Adobe Forum I would like to make a few additional statements in hopes that the developers, etc. may take heed.
    Adobes products are not cheap, and when I went to purchase the websuite I went in as a designer needing a program as not to need to program.
    I understand the flexibility that coding gives, but something as simple as linking buttons should not be in the realms of rocket science. [yes, for many its not...but my brain just does not operate that route despite all the tutorials thrown at me.]
    Again, it would seem that there would be a button panel where you could drag options like scrolling thumbnail slider, loader, and then parameters would come up. [much like Apples iWeb. - but before the argument of one being pro and the other for non-pros, I see it differently. Software should not be the limiting factor in how flexible you can design, or rather ones lack of programming shouldnt be. With all the talented, and I say this in all humility and honesty, programmers working for Adobe, Im sure something could be programmed like what Im asking for.]
    note: Director is a good example, back in 1997 I knew nothing of multimedia and in one week I had assembled a portfolio, clicking buttons, speech, movies, and all. - and no, I dont have the money to buy more software!
    At this moment I am at the mercy of someone who reads code like its a nighttime tale they are telling their kids, and who can see the exact issue I have and can share the appropriate, correct code. [as I have noticed, it has to be on target - naturally - but this target changes with just a slight change in the design.]
    Thank you,
    peace
    Dalen
    p.s.
    The actionscript: [note: This is only the current working/good code that Im trying to get the buttons to call up.]
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML ();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array;//Array of full size image urls
    var thumbURL:Array = new Array;//Array of thumbnail urls
    var thumbX:Number = 25;//Initial offset of _x for first thumbnail
    x.onLoad = function(){ //Function runs after XML is loaded
        var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0;i<photos.length;i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);         
              var t = panel.attachMovie("b","b"+i,i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function () {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function () {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function () {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function () {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease  = function () {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    x.load ("silk_paintings.xml");// path to XML file
    panel.onRollOver = panelOver;
    function panelOver() {
         this.onEnterFrame = scrollPanel;
         delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
         if (_xmouse<b.xMin||_xmouse>b.xMax||_ymouse<b.yMin||_ymouse>b.yMax) {
         this.onRollOver = panelOver;
         delete this.onEnterFrame;
         if (panel._x >= 740) {
         panel._x = 740;
    if(panel._x <= (thumbX-10))  {
              panel._x = (thumbX-10)
         var xdist = _xmouse - 830;
         panel._x += -xdist / 7;
    The xml:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <slideshow>
    <photo thumbs="thumbnails/i_brown_fairy.jpg"  urls="images/brown_fairy.jpg"  />
    <photo thumbs="thumbnails/i_blonde_fairy.jpg"  urls="images/blonde_fairy.jpg"  />
    <photo thumbs="thumbnails/i_flower_fairy.jpg"  urls="images/flower_fairy.jpg"  />
    <photo thumbs="thumbnails/i_red_fairy.jpg"  urls="images/red-fairy.jpg"  />
    </slideshow>
    Attached is a link to the file I made named "index".
    https://rcpt.yousendit.com/706233226/5e7b4fe0973dacf090b5cbae32c47398
    I would have liked to have included the following files but was limited due to "you-send-it" not uploading folders.  Files not included: [but functioning] : xml list - images [folder] - thumbnails [folder]
    Again, Thank you
    Dalen

    The issues with the buttons calling up the scrolling thumbnail panel have been resolved, as well as keeping the buttons in their hit state once clicked, thanks to Rob.
    Those that have been following this thread, or stumble upon it in their searches later, may appreciate to see the final solution to this particular issue.
    [Hopefully I will be able to update this thread with a url in the future to show the site in operation, which may help somebody with their project in the future if its set up similarly.]
    Alas, it would be nice if future versions of flash had a more direct, flexible, user friendly method for creating navigation.
    [We may see development beyond the flash ads which everyone seems to loathe... and more creativity with flash in terms of games, web interactivity, &  animation.
    Below are 2 sets of code:
    a] the first is located within the first frame of the first button, and has some extra variables in it that the additional buttons call upon...
    b] the second is the code applied to every other button.
    stop();
    fscommand("allowscale", false);//keep SWF display at 100%
    var x:XML = new XML();//Define XML Object
    x.ignoreWhite = true;
    var fullURL:Array = new Array();//Array of full size image urls
    var thumbURL:Array = new Array();//Array of thumbnail urls
    //  .......  CHANGE
    var thumbX:Number;// = 25;//Initial offset of _x for first thumbnail
    // make an array of all of the instance names of each button object...
    // only do this once
    var buttonsList:Array = new Array(shadesOfGrey, silkPaintings);
    shadesOfGrey.isLatched = false;
    // the rollover function... repeat for each button
    shadesOfGrey.onRollOver = shadesOfGrey.onDragOver=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(2);
    // the rolloff function... repeat for each button
    shadesOfGrey.onRollOut = shadesOfGrey.onDragOut=shadesOfGrey.onReleaseOutside=function ():Void {
         if (!this.isLatched) {
              this.gotoAndStop(1);
    // the mouse press function... repeat for each button
    shadesOfGrey.onPress = function():Void  {
         resetAllButtons();
         this.isLatched = true;
         this.gotoAndStop(3);
    shadesOfGrey.onRelease = function():Void  {
         x.load("shadesOfGrey.xml");// path to XML file
         thumbX = 25;
    function resetAllButtons():Void {
         for (b in buttonsList) {
              buttonsList[b].isLatched = false;
              buttonsList[b].gotoAndStop(1);
    x.onLoad = function() {//Function runs after XML is loaded
         //  resets the position of the panel on each new load
         panel._x = 740;
         //  .......  CHANGE  removes the existing movieclips from the panel before any new load...
         for (c in panel) {
              if (typeof (panel[c]) == "movieclip") {
                   removeMovieClip(panel[c]);
         var photos:Array = this.firstChild.childNodes;//Defines variable for length of XML file
         for (i=0; i<photos.length; i++) {//For loop to step through all entry lines of XML file
              fullURL.push(photos[i].attributes.urls);//Each loop, adds URL for full sized image to Array fullURL
              thumbURL.push(photos[i].attributes.thumbs);//Each loop, adds URL for thumbnails to Array thumbURL
              //trace(i+". Full Image = "+fullURL[i]+"  Thumb Image = "+thumbURL[i]);
              var t = panel.attachMovie("b", "b"+i, i);//Each loop, Define local variable 't' as a new instance of 'b' movie clip, given unique instance name of 'b' plus the index number of the For loop
              t.img.loadMovie(thumbURL[i]);// Each loop, load thumbnail image from XML data into variable movie clip
              t._y = 0;//Set Y coordinate of variable movie clip
              t._x = thumbX;//Set X coordinate of variable movie clip based on variable thumbX
              t.numb = i;//Set sub-variable 'numb' inside variable t to hold index number
              t._alpha = 75;//Set the Alpha value of the variable movie clip to 75% - for onRollOver highlight action
              thumbX += 55;//Increment thumbX value so next thumbnail is placed 125 pixels to the right of the one before
              t.onRollOver = function() {//define onRollOver event of the variable movie clip
                   this._alpha = 100;//Set thumbnail alpha to 100% for highlight
              t.onRollOut = function() {//define onRollOut event of the variable movie clip
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onPress = function() {//define onPress event of the variable movie clip
                   this._rotation += 3;//rotates thumbnail 3 degrees to indicate it's been pressed
                   this._x += 3;//Offset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y -= 3;//Offset Y coordinate by 3 pixels to keep clip centered during rotation
              t.onReleaseOutside = function() {//define onRelease event of the variable movie clip
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during rotation
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during rotation
                   this._alpha = 75;//Reset thumbnail alpha to 75%
              t.onRelease = function() {//define onRelease function to load full sized image
                   this._rotation -= 3;//rotate thumbnail back 3 degrees
                   this._x -= 3;//Reset X coordinate by 3 pixels to keep clip centered during
                   this._y += 3;//Reset Y coordinate by 3 pixels to keep clip centered during
                   this._alpha = 75;//Reset thumbnail alpha to 75%
                   holder.loadMovie(fullURL[this.numb]);//Load full sized image into holder clip based on sub-variable t.numb, referenced by 'this'
         holder.loadMovie(fullURL[0]);//Initially load first full size image into holder clip
    // this one function scrolls the panel for all of the buttons, it gets the
    // size of the panel when the images are loaded by any given button...
    stroke.onEnterFrame = function() {
         if (this.hitTest(_xmouse, _ymouse, false)) {
              if (panel._x>=740) {
                   panel._x = 740;
              if (panel._x<=740-panel._width+mask._width) {
                   panel._x = 740-panel._width+mask._width;
              if ((panel._x<=740) && (panel._x>=740-panel._width+mask._width)) {
                   var xdist = _xmouse-830;
                   panel._x += -xdist/7;
    Of note is the change to how the movie clips are measured... this change in and of itself has really helped to make the thumbnail panels operation more efficient.
    Below is the script for each additional button: [Having issues with the forums not letting me post additional code, so I will put the remaining code in a reply below.]
    cont.

Maybe you are looking for

  • Apache, iPrint and SSL/nile.nlm

    Hi, Getting various abends on a daily basis. Server is running as a vm on ESX 4.1 on an AMD platform. The running process is not always the same (apache_workprocess, seg.nlm, pcountdp.nlm) but the type of abend seems to be very consistent. It is the

  • X200 Fan Issues with Windows 7

    Hi all, I've just done a fresh install of Windows 7 Ultimate 64-bit onto my X200, and everything works great except for 1 thing - the fan constantly runs and doesn't stop at all as long as the laptop is on. I've seen a few other posts of other X200 o

  • Transaction Variant for SHD0 in CAT2

    Hi,    We have a requirement to default the wage type in CAT2 screen. Is it possible to accomplish this using the SHD0 transaction variant.  The wage type appears in the table control in the CAT2 screen .Kindly advice. Regards, Prabaharan.G

  • NB200 - Not reading 16GB SDHC card

    Hi, When I insert SDHC into the NB200, autoplay starts up but then just keeps running on a loop and the mixed content box appears. Occasionally I've managed to see what's on the SDHC card if i click on 'view files' in the contents box but not always

  • Using AP elements on a center justified page

    Sorry if this question has been asked innumerable times before. If so, can anyone direct me to a link that explains how to move AP elements about on a center justified web page? When I do so, the AP elements seem to do their own thing, irrespective o