detecting active page

  • deckyfrombgd
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 25, 2005
  • Posts: 14
  • Loc: Belgrade,Serbia
  • Status: Offline

Post February 3rd, 2007, 2:48 am

I'm intend to use one flash navigation menu for all html pages on my future site,but I don't know how to detect which page is currently active so my menu can mark that item different then others.I suppose that I must import that data from header of HTML page and make my action-script do the rest of the work,but that's just in my head as a theory and I would like to see some nice example or tutorial for that...
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 3rd, 2007, 2:48 am

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Joined: Jul 11, 2005
  • Posts: 1828
  • Loc: In the Great White North
  • Status: Offline

Post February 3rd, 2007, 10:31 am

use a serverside language like PHP to set a variable on each page. Pass that variable to flash and use actionscript to do the rest.

Easy way to pass variables into flash is with the swfObject http://blog.deconcept.com/swfobject/

Both http://www.liveactionset.org and http://www.continentalski.com use that sort of deal.
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post February 4th, 2007, 10:52 pm

not really needed a serverside language. Since you have more html pages,
then you can just write by hand the pageID after the .swf object.
either use the swfObject or just in the html source of each page, change in these 2 locations:
Code: [ Select ]
<param name="movie" value="menu.swf?pageID=0">
....
<embed src="menu.swf?pageID=0" ...
  1. <param name="movie" value="menu.swf?pageID=0">
  2. ....
  3. <embed src="menu.swf?pageID=0" ...

and in each page, give a different pageID (1,2, ...), then in the flash source,
you will just use:
Code: [ Select ]
switch (pageID) //yes, it gets it from the html
{
case 0:  // set menu for page 0
         break;
case 1:  // set menu for page 1
         break;
case 2:  // set menu for page 2
         break;
.....
}
  1. switch (pageID) //yes, it gets it from the html
  2. {
  3. case 0:  // set menu for page 0
  4.          break;
  5. case 1:  // set menu for page 1
  6.          break;
  7. case 2:  // set menu for page 2
  8.          break;
  9. .....
  10. }
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 36 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
 
cron
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.