473,804 Members | 2,758 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Action Script Tween for Navigation

1 New Member
hi guys.

I'm trying to make a navigation menu with AS tweening. So far I have all 4 buttons and a graphic inside a movie clip named "logo_mc" with an instance name of "logo_mc".

I have managed to AS tween the movment of the logo_mc clip with each of the 4 buttons and position the x & y of the "logo_mc" accordingly. Though if I press any of the other button the logo_mc ends up moving in places on screen where I don't want them to go. Here is what I have so far.

Expand|Select|Wrap|Line Numbers
  1.  
  2. stop();
  3.  
  4. logo_move._x=238.0;
  5. logo_move._y=171.0;
  6.  
  7. this.logo_move.button_one.onRelease = down;
  8. this.logo_move.button_two.onRelease = right;
  9. this.logo_move.button_three.onRelease = up;
  10. this.logo_move.button_four.onRelease = left;
  11.  
  12. import mx.transitions.Tween;
  13. import mx.transitions.easing.*;
  14.  
  15. function down() {
  16. new Tween (logo_move,"_y",Strong.easeOut,171,300,2,true);
  17. }
  18.  
  19. function right() {
  20. new Tween (logo_move,"_x",Strong.easeOut,238,44.0,2,true);
  21. }
  22.  
  23. function up() {
  24. new Tween (logo_move,"_y",Strong.easeOut,171,30.0,2,true);
  25. }
  26.  
  27. function left() {
  28. new Tween (logo_move,"_x",Strong.easeOut,238,450.0,2,true);
  29. }
  30.  
  31.  
This is all good. Though I need some help with the next step I'm trying to achieve. What I would like to achieve is once a button, say "button_one " for example, is pressed the "logo_mc" clip will move into position. At the time "button_one " has been pressed and tweens i need to make all other buttons disabled and to also be able to press the same "button_one " to Action Script tween back to the centre of the x & y positions I have labled in the top of the action script window.

I have a feeling I made an if else statement to tell AS that once "button_one " has been pressed and "logo_mc" has reached its x&y position to then enable the same button ("button_one ") to tell AS to move "logo_mc" back to the centre x&y position. Would this be right?

I hope that dosn't sound confusing. If anyone could help/assist/point me in the right direction that would be greatly appreciated.

thanks
Oct 3 '07 #1
0 1821

Sign in to post your reply or Sign up for a free account.

Similar topics

8
4236
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
7
2526
by: TJS | last post by:
what is wrong here, the submit will only post page back to itself instead of specifed action <SCRIPT language="Javascript"> function Submit_Form(){ document.Form1.Action="cart.asp"; document.Form1.submit(); return false; } </SCRIPT>
13
9720
by: Matt F | last post by:
I have a deployment project that I'm setting up. I need to perform a different custom action based on whether this is a first time install or an update. Does anyone have any idea if it's possible to set the Condition property of a custom action to determine if the currently running install is upgrading a previous installation and if so how? I'm also open to other methods of acheiving this functionality.
1
3325
by: Window Frog | last post by:
Hello all, I am going to be utilizing a <divon a site that is shown and hidden w/ the click of a button. I can already do this, but when the button is clicked the <divis show quite rapidly. I'd like to slow the opening/showing process with something emulating a motion tween. Apple uses something like this in their menus on their website. Any ideas are greatly appreciated.
0
2199
by: suzyq89 | last post by:
Hi there, I'm a newbie with AS2....and i wanted to learn to create a photo gallery that scrolls right or left, and that when you click on the photo it becomes bigger. Well I found a tutorial from a site. The only thing is that... when I built it and applied it to my project it does not work: The issue is that it takes over the main page, even though is in its own swf file....(It's part of a flash website, where each page is loaded...
1
7441
joedeene
by: joedeene | last post by:
Hello all, I am using Macromedia Flash Professional 8 in this example of a simple way to use motion tweens. Ok here goes... Directions: A. Preparation 1.) Start the Flash program. Once loaded, create a new Flash Document. Note: By default the pixels are set to 550 x 400, i changed mine to 275 x 200. 2.) Speed up the animation by changing the frame rate to 36 fps.
3
2370
by: Gozil | last post by:
Hey, Is there some javascript framwork that will let me center an image (with a tween) and at the same time give me a glow effect? Examples: http://www.apple.com/trailers/sony_p.../angelsdemons/ (click the image at the left) http://www.sbliss.com/ (click the images at the bottom left) http://www.insideria.com/2008/11/gre...aining-at.html (click on the image in the post) any advice would be helpful!
6
2946
by: empiresolutions | last post by:
I'm trying to slightly alter the script found here, http://www.adrianhodge.com/web-design/mootools-horizontal-div-slider-121/. What i want to do is make the carousel work on a Next/Previous feature versus a 1, 2, 3 method. I tried to do it myself but found i was was just going in circles and nothing was working. Any help is appreciated. I have listed below the only parts that should matter. Javascript <script language="Javascript"> <!--...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10568
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5516
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4292
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.