detecting active page

  • deckyfrombgd
  • Newbie
  • Newbie
  • deckyfrombgd
  • Posts: 14
  • Loc: Belgrade,Serbia

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • graphixboy
  • Control + Z
  • Mastermind
  • User avatar
  • Posts: 1828
  • Loc: In the Great White North

Post 3+ Months Ago

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
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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. }

Post Information

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