Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Got the 3d carouselk thing working I'm having problems with the PL

  • (2 Pages)
  • +
  • 1
  • 2

28 Replies - 2997 Views - Last Post: 12 June 2008 - 11:49 AM

#1 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Post icon  Posted 18 March 2008 - 11:30 AM

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



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

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,

Is This A Good Question/Topic? 0
  • +

Replies To: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

#2 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 18 March 2008 - 01:17 PM

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 March 2008 - 01:20 PM

Was This Post Helpful? 0
  • +
  • -

#3 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 18 March 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!
Was This Post Helpful? 0
  • +
  • -

#4 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 20 March 2008 - 12:44 PM

View Postthehat, on 18 Mar, 2008 - 04:35 PM, said:

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

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)


Was This Post Helpful? 0
  • +
  • -

#5 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 21 March 2008 - 06:28 AM

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:

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:

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!
Was This Post Helpful? 0
  • +
  • -

#6 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 24 March 2008 - 02:16 PM

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.

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)


Was This Post Helpful? 0
  • +
  • -

#7 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 24 March 2008 - 02:42 PM

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:

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:

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


Was This Post Helpful? 0
  • +
  • -

#8 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 25 March 2008 - 10:37 AM

I'm getting an erro message now:

last MC name = undefined

Is that because it's not counting the carousel?
Thanks,
bmcc
Was This Post Helpful? 0
  • +
  • -

#9 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 25 March 2008 - 10:52 AM

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 March 2008 - 10:53 AM

Was This Post Helpful? 0
  • +
  • -

#10 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 25 March 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: 160
Was This Post Helpful? 0
  • +
  • -

#11 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 25 March 2008 - 02:03 PM

View Postthehat, on 25 Mar, 2008 - 01:51 PM, said:

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.

Attachment attachment



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,
Was This Post Helpful? 0
  • +
  • -

#12 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 25 March 2008 - 02:24 PM

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)
Was This Post Helpful? 0
  • +
  • -

#13 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 26 March 2008 - 01:52 PM

View Postthehat, on 25 Mar, 2008 - 02:24 PM, said:

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)


Awesome dude,

This really helped out. Now I've got it working with the play list and all the songs work. ;)

Now I'm just working on getting the drop down menu working and the upperMenu working as well.

I'm going to try and get it working myself, bu if you have any suggestions there alway's welcome.

I'm thinking that all I have to do is get everything working with menuHolder.

Thanks alot,
bmcc
Was This Post Helpful? 0
  • +
  • -

#14 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 27 March 2008 - 12:30 PM

View Postthehat, on 25 Mar, 2008 - 02:24 PM, said:

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)




Hey thanks alot dude,

I got pretty much everything working except the dropDown Menu. I'm getting a message that say's

Quote

waiting to unload the previous player


It's in DropDown.fla Scene 1, combo, menu, line 81.

I think it has someting to do with

Quote

dDown = undefined
that I get in an error message.
Was This Post Helpful? 0
  • +
  • -

#15 thehat  Icon User is offline

  • awake ? web();
  • member icon

Reputation: 106
  • View blog
  • Posts: 951
  • Joined: 28-February 08

Re: Turning my Horizonatal scroller into 3d CAROUSEL with playlist PLAYER

Posted 27 March 2008 - 01:08 PM

No worries, I don't have a copy of your dropdown.fla but if you can post it I'll certainly take a look.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2