Question : Flash Sliding Website

Hi, I am trying to get a nav where the buttons slide to the top of the stage once clicked on. The idea is for the button to return to it's spot once another button has been clicked on.

I have been working on 2 files, the first one changes the buttons x and y co-ordinates but has no smooth sliding transition. The second slides but I cant get control of the other buttons to move.

Help me please! I have attached the 2 different files.

Answer : Flash Sliding Website

First of all, I don't think your current method really is using Flash properly.  What you want to do could be done with tweens really nicely.  That being said, this isn't the worst way to use flash so I think I can help you out.

First of all you should know that you can access most variables by following the proper path through parents and children.  Try running the debugger on your movie to see a good hierarchy of how the variables are scoped.

I initialized a global variable called top first, I did it in the actions layer of the top movie.  I set it to null at first.  _global.top = null;

Next I replaced the onRelease methods as described in the snippet.  Instead of hardcoding for the profile/services switch you'll probably want to keep track of the original location of the top button as well, but that should be trivial.
1:
2:
3:
4:
5:
6:
7:
8:
	btn_services.onRelease = function() {
		endX = 10;
		endY = 10;
		if(_global.top != null){
			_global.top.endY = 140
		}
		_global.top = _level0.services;
	};
Open in New Window Select All
Random Solutions  
 
programming4us programming4us