Welcome to Dream.In.Code
Getting Help is Easy!

Join 109,337 Programmers for FREE! Ask your question and get quick answers from experts. There are 1,039 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

3 Pages V  1 2 3 >  
Closed TopicStart new topic

Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER, Got the 3d carouselk thing working I'm having problems with the PL

bmcc81
post 18 Mar, 2008 - 11:30 AM
Post #1


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 122


My Contributions


Hi,

I've got this site. HORIZONTAL SCROLLING WEB PAGE

I'm trying to take the code from that and integrate my new 3D Carousel everything seems to work except my PLAYLIST.. ARGHHH


DOWNLOAD FILES HERE



CODE
xml.onLoad = function(i:Number)
{
    createMP3(0);
    var count = i;
    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.playlist = nodes[i].attributes.playlist;
        //t.playlist = playlist[count];
        t.toolText = nodes[i].attributes.tooltip;
        t.theTitle = nodes[i].attributes.theTitle;
        t.content = nodes[i].attributes.content;
        t.icon.inner.loadMovie(nodes[i].attributes.image);
        t.r.inner.loadMovie(nodes[i].attributes.image);
        t.icon.back._visible = false;
        t.icon.onRollOver = over;
        t.icon.onRollOut = out;
        t.icon.onRelease = released;
        
        count++;
        createMP3(count);
    }
}

xml.load("icons.xml");


AND HERE'S THE CODE THAT LOADS THE XML

CODE
xml.onLoad = function(i:Number)
{
    createMP3(0);
    var count = i;
    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.playlist = nodes[i].attributes.playlist;
        //t.playlist = playlist[count];
        t.toolText = nodes[i].attributes.tooltip;
        t.theTitle = nodes[i].attributes.theTitle;
        t.content = nodes[i].attributes.content;
        t.icon.inner.loadMovie(nodes[i].attributes.image);
        t.r.inner.loadMovie(nodes[i].attributes.image);
        t.icon.back._visible = false;
        t.icon.onRollOver = over;
        t.icon.onRollOut = out;
        t.icon.onRelease = released;
        
        count++;
        createMP3(count);
    }
}

xml.load("icons.xml");



CAN ANYONE HELP OUT? i'M NOT SURE ON HOW TO GET THE PLAYLIST TO SHOW UP & WORK

Thanks in advancem,
User is offlineProfile CardPM

Go to the top of the page


thehat
post 18 Mar, 2008 - 01:17 PM
Post #2


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


Hi,

I'm trying to run your code, and getting the following error against your playlist.as: ActionScript 2.0 class scripts may only define class or interface constructs. The error continues to appear when the include directive from frame 1 for dock20_throwaway.fla is removed, so I'm guessing that you are calling to playlist.as somewhere else as a class rather than a code snippet. Thing is, so far I can't see where you're doing it.

Any ideas?

This post has been edited by thehat: 18 Mar, 2008 - 01:20 PM
User is offlineProfile CardPM

Go to the top of the page

thehat
post 18 Mar, 2008 - 04:35 PM
Post #3


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


Right, I'm still now 100% sure of how this all works, but here are some things for you to look at:
  • Where do you attach home.playlistHolder_mc that you use as a load target for Playlist.swf (dock20_throwaway.fla, frame 84, line 103)?
  • On line 177 (same move and frame) you say var lastMC = menuHolder["item"+(numOfItems-1)]; but the items are attached to home, not menuHolder. This is also a problem in scrollMenu.as. line 71.
  • Something about the playlist.as file causes errors, and although they don't seem to be site breaking it might be as well to just put that code on the timeline instead.

I hope this gives you something to go on, I will give this thing more thought tomorrow if you're still stuck. Good luck!
User is offlineProfile CardPM

Go to the top of the page

bmcc81
post 20 Mar, 2008 - 12:44 PM
Post #4


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 122


My Contributions


QUOTE(thehat @ 18 Mar, 2008 - 04:35 PM) *

Right, I'm still now 100% sure of how this all works, but here are some things for you to look at:
  • Where do you attach home.playlistHolder_mc that you use as a load target for Playlist.swf (dock20_throwaway.fla, frame 84, line 103)?
  • On line 177 (same move and frame) you say var lastMC = menuHolder["item"+(numOfItems-1)]; but the items are attached to home, not menuHolder. This is also a problem in scrollMenu.as. line 71.
  • Something about the playlist.as file causes errors, and although they don't seem to be site breaking it might be as well to just put that code on the timeline instead.
I hope this gives you something to go on, I will give this thing more thought tomorrow if you're still stuck. Good luck!


Hey thanks alot dude,

I checked out your web sites. Really cool. I have the reservoir dog game. I'm stuck in that game too. HaHa don't worry I'll figure that out myself.

Well back 2 flash. I tried making everything;
home.menuHolder. and nothing will shows up. It's kinda important to have it inside the menuHoler because thats what makes everything float around when the screen is resized. But I guess you already know that.

I have this inside the scrollMenu.as, but I'm not sure if it's the right code because I call the xml also at FRAME 84 LINE 23 in dock20-throwaway

CODE
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++)
    {
        toolText[i] = nodes[i].attributes.tooltip;
        theTitle[i] = nodes[i].attributes.theTitle;
        playlist[i] = nodes[i].attributes.playlist;
        descTitle[i] = nodes[i].attributes.descTitle;
        description[i] = nodes[i].attributes.description;
        image[i] = nodes[i].attributes.image;
    }
    play();
}

home.menuHolder.xml.load("icons.xml");



I attached the original dock20.fla that was a horizontal scroll, not a carousel. Maybe that will help you see where I went wrong.


Hmm, I don't think I attached home.playlisHolder_mc but do I need that.

What do you think I should do? I'm not sure about my menuHolder_mc I find that thing mess's everything else up.

NE WAYZ
Thanks for your help,
bmcc


Attached File(s)
Attached File  dock20.zip ( 290.67k ) Number of downloads: 41
User is offlineProfile CardPM

Go to the top of the page

thehat
post 21 Mar, 2008 - 06:28 AM
Post #5


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


The reason nothing shows up when you make everything home.menuHolder is that on frame 1 you position menuHolder a long way off stage. If you use the debugger you can see all the items attached to it. You should probably add menuHolder to your positioning code on frame 1 to keep it where you want it.

Adding everything to the menuHolder has another problem, it breaks the carousel action. This is because the scope within the mover function shifts, and it is now looking inside the menuHolder for a load of variables that are on the root. This mover function fixes that:

as

function mover()
{
this._x = Math.cos(this.angle) * _root.radiusX + _root.centerX;
this._y = Math.sin(this.angle) * _root.radiusY + _root.centerY;
var s = (this._y - _root.perspective) /( _root.centerY+ _root.radiusY- _root.perspective);
this._xscale = this._yscale = s*100;
this.angle += _root.speed;
this.swapDepths(Math.round(this._xscale) + 100);
}


For me, this makes the selected icon leave the carousel and move to the top right.

Finally for now, in Playlist.fla Move tracklistContainer line 37 you create an infinite loop if the trackLists Array is empty. Put in a check for that before starting the loop:

as

if(_root.playlistTracks.length > 0) {
for (i=1; i<=_root.playlistTracks.length; i++){
if (i>0){
removeMovieClip(_pl);
}
}
}


I now get the playlist displayed, but with no info because I don't have the XML files, and it seems to display too soon. Hope that sets you on the right path!
User is offlineProfile CardPM

Go to the top of the page

bmcc81
post 24 Mar, 2008 - 02:16 PM
Post #6


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 122


My Contributions


Thanks alot,

I'm just having trouble still intergrating what your telling me.
I had that playlist.fla line 37 commented out.

So now I've uncommented it and it doesn't like how I've placed my code.

CODE
function loadPlaylist(num:Number):Void{
    
    _root.XMLtrackListing.ignoreWhite = true;
    
    _root.XMLtrackListing.onLoad = function(success){
        
        if(_root.playlistTracks.length > 0) {
                for (i=1; i<=_root.playlistTracks.length; i++)}
            if (i>0){  
                removeMovieClip(_pl);  
            }
            for (var i:Number=0; i<_root.playlistTracks.length; i++)
            {
                //removes the previous elements from the playlist
                _root.playlistTracks.pop();
            }
            
            var AlbumRoot =_root.XMLtrackListing.firstChild;
            var tracksNB = AlbumRoot.childNodes.length;
            
            for (var j=0; j<tracksNB; j++)
            {
                _root.playlistTracks[j] = AlbumRoot.childNodes[j].childNodes[0].childNodes[0].nodeValue;
                _root.playlistTitles[j] = AlbumRoot.childNodes[j].childNodes[1].childNodes[0].nodeValue;
                _root.playlistArtist[j] = AlbumRoot.childNodes[j].childNodes[2].childNodes[0].nodeValue;
            }
            //trace(playlistTracks);
            _root.gotoAndPlay(2);
        }
    }
    
    _root.XMLtrackListing.load(myPl);
}



Could you send me the file so that I can see what you did?

I also tried putting the whole code of the carousel in the menuHolder MC and the carousel works and I got the plLoader to show but still the playlist doesn't show.

I also attached that file if you wanna take a look.

Thanks so much,
bmcc


Attached File(s)
Attached File  dock20_MINE.zip ( 111.36k ) Number of downloads: 38
User is offlineProfile CardPM

Go to the top of the page

thehat
post 24 Mar, 2008 - 02:42 PM
Post #7


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


Hey,

I'll take this new file and have another look.

With playlist.fla, I was talking about the code inside the tracklist container movie that's on frame 2. On frame 37 of that movieclip you had:

as

for (i=1; i<=_root.playlistTracks.length; i++){
if (i>0){
removeMovieClip(_pl);
}
}


and I just put an if round it to ensure it publishes when the playlistTracks array has no length:

as

if(_root.playlistTracks.length > 0) {
for (i=1; i<=_root.playlistTracks.length; i++){
if (i>0){
removeMovieClip(_pl);
}
}
}
User is offlineProfile CardPM

Go to the top of the page

bmcc81
post 25 Mar, 2008 - 10:37 AM
Post #8


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 122


My Contributions


I'm getting an erro message now:

last MC name = undefined

Is that because it's not counting the carousel?
Thanks,
bmcc

User is offlineProfile CardPM

Go to the top of the page

thehat
post 25 Mar, 2008 - 10:52 AM
Post #9


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


I think that's because you are attaching the items in your carousel to the root (or home as you call it on frame 84), but in the function that is called when you click an item you refer to menuHolder. Make sure every call to one of those items, including the attachMovie, uses menuHolder, not home or _root.

Then, if you can't see the carousel, look in the debugger and check a- if the items are attached to menuHolder, and b- the x and y position of menuHolder. You will probably want to remove the absolute position values you give menuHolder on frame 1 and add it to your positioning code near the bottom of that frame.

I'm at work right now, but I'll post the version I have with that error fixed later on if you're still having problems.

This post has been edited by thehat: 25 Mar, 2008 - 10:53 AM
User is offlineProfile CardPM

Go to the top of the page

thehat
post 25 Mar, 2008 - 01:51 PM
Post #10


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


As promised, here are the versions of the files I have that I've made changes to. They're far from perfect, but it gets as far as needing the albums XML file. The playlist box still appears far to soon.

Attached File  playlist_altered.zip ( 114.84k ) Number of downloads: 53
User is offlineProfile CardPM

Go to the top of the page

bmcc81
post 25 Mar, 2008 - 02:03 PM
Post #11


D.I.C Head

**
Joined: 10 Jul, 2007
Posts: 122


My Contributions


QUOTE(thehat @ 25 Mar, 2008 - 01:51 PM) *

As promised, here are the versions of the files I have that I've made changes to. They're far from perfect, but it gets as far as needing the albums XML file. The playlist box still appears far to soon.

Attached File  playlist_altered.zip ( 114.84k ) Number of downloads: 53




Gee thanks,

But could you send the old files I sent you, cause I'm getting undefined in the text box's and the play list doesn't show ups still. I guess I changed stuff that I shouldn't have.
Also when I click on it it shrinks super small and goes into the top left hand corner, I then have to pull the window open to scale it bigger.
Still away off but getting allot closer though thanks.

But it does know find the xml I can see that it does.

Thanks again,


User is offlineProfile CardPM

Go to the top of the page

thehat
post 25 Mar, 2008 - 02:24 PM
Post #12


D.I.C Head

Group Icon
Joined: 28 Feb, 2008
Posts: 216



Dream Kudos: 100
My Contributions


Sure, this is the whole content of my folder minus the empty swfs I had to create for about, contact, etc. I really want to see this thing working now!

Download Link (DIC's upload keeps timing out so it's a direct link)

User is offlineProfile CardPM

Go to the top of the page

3 Pages V  1 2 3 >
Closed TopicStart new topic
Time is now: 9/6/08 04:20PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month