Category: Javascript

Part 2. Step by Step guide to using Fireworks to create Popup Menus

Make the rectangle into a functioning button

  1. To designate the rectangle as a button, so that it will react when your mouse rolls over it or clicks on it, it needs to be converted to a button symbol. Fireworks button symbols have some functions built in, making it very easy to create the behaviors you want.

    With the rectangle still selected (the blue handles showing), select “Convert to Symbol” from the Modify menu.

  2. Continue reading

Use server-side application variables to drive client-side scripts

You can use serverside variables to drive client-side javascripts. Server-side variables get processed and the results output by the time the page is rendered, so the value of the variable can be used in client-side functions.

In an ASP application I’m working with, I wanted a different tooltip to show up on each tab, depending on what the tab title was. There is a server-side variable called “tabs[i].title”. So I created a little client-side function to test the value of the title on each tab.

 
<script>
var tabName ;

function whichTab(tabTitle){
   if (tabTitle == 'Summary'){
   tabName = Summary;
}
else if (tabTitle == 'Plan Details'){
   tabName = PlanDetails;
}
else if (tabTitle == 'Certifications'){
   tabName = Certifications;
}
else if (tabTitle == 'Transcript'){
  tabName = Transcript;
}
}
</script>
Continue reading

Passing a variable in the URL to turn on and off layers in another page

I have a series of five flowcharts in a tabbed layout, one flowchart per tab (seem to be doing tabs a lot lately). I wanted the user to be able to click a link on another page, and have the flowchart page open to the correct flowchart layer. A working example is here:

Switch layers on the next page by clicking a link

When I tried setting the value of a variable on the new page, it worked in some browsers but not others, probably because some computers are slower at loading pages than others, and the necessary layers would not be loaded in time for the variable to have something to populate.

Continue reading

Passing a variable to any page by clicking a link

I am working on a game which requires people to log in by selecting whichever team they are on. Each team is made up of several departmental units.

People probably won’t know what team they belong to the first time they play. There is no list of all the potential players, so it isn’t possible to automatically associate users with teams.

So we constructed an entry page which lists all the departments and which teams they belong to. People find their department, and are automatically associated with a team.

It required creating a little script to pass the name of the team along to the game login page.

Presumably people WILL know what department they are in, and will be able to select their team in that manner.

The problem was, the team name has to be passed to Questionmark Perception’s login page, since it requires the team name to send whatever points are earned to the appropriate team.

I used the following javascript to set a hidden field “GROUP” on Questionmark’s login page, when a player clicks the team link on the Entry page.

Continue reading

Scroll wheel changes selection in drop-down menus

In some of the Questionmark quizzes I’ve made there are “selection” questions, which are simply pull down menus with several possible answers to a question. I started getting emails from scroll wheel users complaining that Questionmark was changing their answers.

It turned out users would make a selection, then immediately start scrolling the wheel without deselecting the menu, so the scroll wheel would scroll within the menu. I didn’t want to disable the scroll wheel or something like that, so I looked for a way to jump the cursor out of the menu when something is selected.

Continue reading