FLASH 3D CAROUSEL WITH XML

  • LO_LA
  • Born
  • Born
  • LO_LA
  • Posts: 2

Post 3+ Months Ago

Hi!

I´m trying to give each icon of the carousel a link to a different swf file, but because it is dynamicly download from an external .xml file ....I don´t how to make the icons links in xml or how to refer to each icon in Action Script 2.0 and make them buttons with links.

This is my code in Action Script...
Code: [ Select ]

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 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;
            }
        }
    }
}
  1. var xml:XML = new XML();
  2. xml.ignoreWhite = true;
  3. xml.onLoad = function()
  4. {
  5.     var nodes = this.firstChild.childNodes;
  6.     numOfItems = nodes.length;
  7.     for(var i=0;i<numOfItems;i++)
  8.     {
  9.         var t = home.attachMovie("item","item"+i,i+1);
  10.         t.angle = i * ((Math.PI*2)/numOfItems);
  11.         t.onEnterFrame = mover;
  12.         t.toolText = nodes[i].attributes.tooltip;
  13.         t.content = nodes[i].attributes.content;
  14.         t.icon.inner.loadMovie(nodes[i].attributes.image);
  15.         t.r.inner.loadMovie(nodes[i].attributes.image);
  16.         t.icon.onRollOver = over;
  17.         t.icon.onRollOut = out;
  18.         t.icon.onRelease = released;
  19.     }
  20. }
  21. function released()
  22. {
  23.     //BONUS Section
  24.     var sou:Sound = new Sound();
  25.     sou.attachSound("sdown");
  26.     sou.start();
  27.     
  28.     home.tooltip._alpha = 0;
  29.     for(var i=0;i<numOfItems;i++)
  30.     {
  31.         var t:MovieClip = home["item"+i];
  32.         t.xPos = t._x;
  33.         t.yPos = t._y;
  34.         t.theScale = t._xscale;
  35.         delete t.icon.onRollOver;
  36.         delete t.icon.onRollOut;
  37.         delete t.icon.onRelease;
  38.         delete t.onEnterFrame;
  39.         if(t != this._parent)
  40.         {
  41.             var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
  42.             var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
  43.             var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,100,0,1,true);
  44.         }
  45.         else
  46.         {
  47.             var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,true);
  48.             var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,true);
  49.             var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,200,1,true);
  50.             var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,320,1,true);
  51.             var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,100,1,true);
  52.             theText.text = t.content;
  53.             var s:Object = this;
  54.             tw.onMotionStopped = function()
  55.             {
  56.                 s.onRelease = unReleased;
  57.             }
  58.         }
  59.     }
  60. }


And how my xml file looks....
Code: [ Select ]
<icons>


<icon image="icon1.png" tooltip="Reel" content="Reel"/>

<icon image="icon2.png" tooltip="Short Film" content=" Short Film" />

<icon image="icon3.png" tooltip="About" content="About" />

<icon image="icon4.png" tooltip="Gallery" content="Gallery" />

<icon image="icon5.png" tooltip="Contact" content="Contact Form" />

<icon image="icon6.png" tooltip="Coming soon" />


</icons>
  1. <icons>
  2. <icon image="icon1.png" tooltip="Reel" content="Reel"/>
  3. <icon image="icon2.png" tooltip="Short Film" content=" Short Film" />
  4. <icon image="icon3.png" tooltip="About" content="About" />
  5. <icon image="icon4.png" tooltip="Gallery" content="Gallery" />
  6. <icon image="icon5.png" tooltip="Contact" content="Contact Form" />
  7. <icon image="icon6.png" tooltip="Coming soon" />
  8. </icons>


Please Help!!!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

same way you do an image... just make a fla of each icon, publish it as a swf and replace the "icon1.png, icon2.png," etc with icon1.swf, etc.
  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Posts: 374
  • Loc: Santa Barbara, CA

Post 3+ Months Ago

half way down on the right...

tuts 1-3 does exactly what you want.

http://gotoandlearn.com/
  • roje0913
  • Student
  • Student
  • roje0913
  • Posts: 78

Post 3+ Months Ago

CE/ Pyrocy wrote:
half way down on the right...

tuts 1-3 does exactly what you want.

http://gotoandlearn.com/


nice site there ,thanks
  • mindfullsilence
  • Professor
  • Professor
  • User avatar
  • Posts: 854

Post 3+ Months Ago

one of my favorite free flash tutorial sites out there, it's where I started out on flash
  • APR
  • Born
  • Born
  • APR
  • Posts: 1

Post 3+ Months Ago

Hi,

I have created 3D carousel in Action Script 2.0 with 3 icons dynamically loaded through XML,but what i want is when i click on any icon of the carousel it should open Accordion panel related to that icon.For instance if i click on home icon of the carousel it should be linked to home button of the accordion panel.Could any one help me out with this please.
Thnx

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 15 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.