Xml menu DONE :)

Fabulous piece of work hga77.

I would like to bring into the thread the idea of transitions in the external swf files that the xml menu loads in. at the moment it loads in my externals but i cant figure out how to make transitions work. I cant get a fade out animation - it just dissapears.

I will not go into any further details because in my zip i have included a more detailed info text file that explains things in more detail. In there also is a traditional fla/swf file so you can see how i want the transitions to work.

I hope you can find time to look into this problem hga77, if not perhaps someone like scotty might look into it?

Thanks for the thread,

Cheers guys.

Salvador,
If I understand you correctly, check out this tutorial:
http://www.kirupa.com/developer/mx2004/transitions.htm

-Joshua

sticmann,

Yeah i can do that already - but it doesnt seem possible in the xml version because actionscript can’t be placed on individual buttons which seems to be a major problem with it.

if its not possible to do this, it would be nice just to know that and then i can forget it and use normal buttons

Thanks

hga77,

How would I code the menu so that the text color of the current menu item the user is on is different from the rest.

Thanx,
russ

Hi hga77,

Thanks for the amazing menu!
If I were to have a really long name for a button, is it possible to have the text wrap to a second or third line, and the button grown in height to accommodate it?

Thanks

Marley,
Find the place in the menu code that tells flash what to do when you push the button and rework it with the code from the transition tutorial. I don’t have it in front of me right now, so I don’t know exactly where it is in the code. It will take a little tweaking, but since it is the same action each time (all that changes is the currMovie value which you already have as the action in the xml), it shouldn’t be too bad.
-Joshua

Sticmann, there is so much code here and its very advanced. I looked through it all and can’t see anything that looks like button code - on release, on press type of code that I am used to. Its just too complex for me and needs an expert to look at it really.

I have contacted quite a lot of people who are quite advanced programmers and no one can work it out - i dont think it can be done, but what do I know :slight_smile:

Cheers, if you get a chance and can look at it, that would be great.

I know hga would be able to do this much quicker and better than I would. I’m sure it can be done and it is a function I will need on the next site I’m building, so if hga doesn’t get to it, I will try.
-Joshua

thanks sticmann, thats very kind of you.

Perhaps hga has retired from the thread - i bet he’s sick of it by now :slight_smile:

im not retired just yet people :wink:

Just very busy…i’ll make sure all is solved within this week :slight_smile:

thats great hga77 :slight_smile:

xml menu_v2_fading_loading

  • added code for preloading external files that are loaded in, along with a preloader.

  • added fading effect.

fleuron, That is possible but not simple to do! And it means changing he menu functionality. Sorry mate

Thanks for the help hga77. Do you think you can point me in the right direction? I only need to worry about long names under the submenu. I suppose I need to check for text wrap, then depending on how many lines of text there are, change the graphic height of the button? Sounds way simpler then it is, am I missing anything? Would I be able to put this in the code in frame 1 or would it have to go elsewhere? Or do I need to keep your basic concepts and dramatically change the code to make this happen?

fleuron, i dont know what the maximium text length you need! Cant you just strech the menu horizontally and keep the text on a single line? If not then upload a sample xml file so that I can see how big you need the text to be.

The problem here is that if you dynamically change the height of various buttons, then the menu animation/motion algorithum has to change. This is because at the moment all buttons have the same height and hence the code can calculate where the items destinations/targets are. Having different buttons with different heights adds a great deal of work…

With regards to my fade in and fade out problem. fabulous !!!

And an extra bonus of the loaded in swf files not dissapearing when when one of the main buttons that have submenus is pressed

Much respect.

Thank you.

no problem :wink:

And an extra bonus of the loaded in swf files not dissapearing when when one of the main buttons that have submenus is pressed

The reason why that happened was becuase you had an “action” attribute in the xml file for items that did not need an action passed for them.

For example, look at the following xml:

<menu>
	<item name="Home" action="Home.swf">
	</item>
	<item name="Products & Services" action="link 1">
		<sub name="Production" action="production.swf"/>
		<sub name="Customer focused" action="Customer.swf"/>
		<sub name="Services" action="services.swf"/>
	</item>
<menu>

Now if you look at the first item with the name “home”, we also have an action “Home.swf”. This is valid since we actually need to load in a home page.

But if you look at the second item with the name “Products & Services”, we also have an action “link 1”. This is not valid, since the menu will attempt to load in a file that doesnt even have an extenstion (eg. .swf, .jpg, etc). Plus we dont need to load in anything for this item (unless you need to that is, by specifying a correct swf, jpg, etc). So thats why if you click on the second item, you get a blank responce. So, it should be like this:

]<menu>
	<item name="Home" action="Home.swf">
	</item>
	<item name="Products & Services">
		<sub name="Production" action="production.swf"/>
		<sub name="Customer focused" action="Customer.swf"/>
		<sub name="Services" action="services.swf"/>
	</item>
<menu>

:slight_smile:

makes sense hga77 :beam:

Thank you