FLASH 3D CAROUSEL WITH XML

  • LO_LA
  • Born
  • Born
  • No Avatar
  • Joined: Aug 13, 2008
  • Posts: 2
  • Status: Offline

Post August 13th, 2008, 1:55 pm

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
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post August 13th, 2008, 1:55 pm

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post August 14th, 2008, 1:21 pm

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.
If at first you don't succeed F1... If that doesn't work try Google!
//// Designer, Developer & Teacher - Interactive, Motion and 3D \\\\
Portfolio at WhenImNotSleeping.com
  • CE/ Pyrocy
  • Proficient
  • Proficient
  • User avatar
  • Joined: Jul 14, 2006
  • Posts: 374
  • Loc: Santa Barbara, CA
  • Status: Offline

Post August 18th, 2008, 11:20 am

half way down on the right...

tuts 1-3 does exactly what you want.

http://gotoandlearn.com/
  • roje0913
  • Student
  • Student
  • No Avatar
  • Joined: Sep 08, 2006
  • Posts: 78
  • Status: Offline

Post August 24th, 2008, 1:19 am

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
  • Joined: Aug 04, 2008
  • Posts: 846
  • Status: Offline

Post August 25th, 2008, 7:00 pm

one of my favorite free flash tutorial sites out there, it's where I started out on flash
Use your words like arrows to shoot toward your goal.
  • APR
  • Born
  • Born
  • No Avatar
  • Joined: Apr 23, 2009
  • Posts: 1
  • Status: Offline

Post April 23rd, 2009, 11:24 pm

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 40 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
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.