Nav Problems

  • Strain
  • Born
  • Born
  • Strain
  • Posts: 2

Post 3+ Months Ago

How do I create a navigation system like this at

http://www.amplifier.com?

I'm fairly new to flash, but was wondering if there was a simpler way to create a nav system. I'm not too concerned with filesize as the output is to CD-ROM. Just a simplified version.

Am I right in thinking I need to target X and Y values?

Please help. This is for a deadline in less than 48hrs!

Cheers
  • Strain
  • Born
  • Born
  • Strain
  • Posts: 2

Post 3+ Months Ago

OK. I'm still working on this.

Could anyone tell me how to code a button inside a movieclip that will take me to XY coordinate inside that movieclip? I'll buy you a drink if you do!

Cheers.
  • roarmeow
  • Professor
  • Professor
  • User avatar
  • Posts: 861
  • Loc: BKNY

Post 3+ Months Ago

aight... this is just an idea.

set up a movieclip as the _root and set up your entire current movieclip as a movieclip in the library of that new _root movieclip. let's call it "main"

now... drag "main" onto the stage and position it in the place where you'd like it to be for the 'home' position.

set up some variables like this on frame1:
Code: [ Select ]
presentx=_root.main._x;
presenty=_root.main._y;
  1. presentx=_root.main._x;
  2. presenty=_root.main._y;


now you've got the current position of the mc...
then, on each button placement, you want to set the coordinates of where you want it to go to... and you should manually set this for each button... like, say the about section would be at 450,300
Code: [ Select ]
on(release){nextx=450;
nexty=300;
gotoAndPlay("movebegin");}
  1. on(release){nextx=450;
  2. nexty=300;
  3. gotoAndPlay("movebegin");}


now you've got to create a way for it to get there... and you want to know how many frames it should take to get there... let's set that manually... let's say it's 20 frames... this script will tell it how much it has to go in each frame to get to where it's going
label this new frame "movebegin"...
Code: [ Select ]
i=20;
deltax=(nextx-presentx)/i;
deltay=(nexty-presenty)/i;
  1. i=20;
  2. deltax=(nextx-presentx)/i;
  3. deltay=(nexty-presenty)/i;


now... for the action, on the frame after "movebegin", let's label it "moving":
Code: [ Select ]
if (i<1){
presentx=_root.main._x;
presenty=_root.main._y;
stop();
}else{
_root.main._x=_root.main._x+deltax;
_root.main._u=_root,main._y+deltay;}
  1. if (i<1){
  2. presentx=_root.main._x;
  3. presenty=_root.main._y;
  4. stop();
  5. }else{
  6. _root.main._x=_root.main._x+deltax;
  7. _root.main._u=_root,main._y+deltay;}

on the frame after "moving", write:
Code: [ Select ]
i=i-1;
deltax=(nextx-presentx)/i;
deltay=(nexty-presenty)/i;
gotoAndPlay("moving");
  1. i=i-1;
  2. deltax=(nextx-presentx)/i;
  3. deltay=(nexty-presenty)/i;
  4. gotoAndPlay("moving");


i'm just writing this on the fly, so try it out and lemme know if it works... i've got to go get some holiday gifts now and mmm... maybe i'll check it out later...

good luck... you're hecka ambitious...

peace,
puck

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.