Rollover then click sees rollover re-occur.
Hi,
Flash CS5 AS3
Datagrid has 1 row per bus service with settlement names in the cells that display MC's of sttmnts with user rollover. Last two columns are URL's. First column is the service number which doesn't have an associated MC.
We have gone from using Rollover to display sttmnts per service row to click, both have pros and cons on user experience, but to resolve the cons and get the best of both worlds we now wish a rollover to show MC's followed by a click to hold the user choice of a certain row else as they move mouse cursor over grid to get to Magnify button they change the MC's on show again !
using ROLL_OVER function before ITEM_CLICK was my approach but what code is needed to stop ROLL_OVER re-occuring again for this datagrid as after the click any movement across datagrid loses the selection displaying MC's for any row hovered !
Maybe we also need a reset button incase user changes their mind or have it that to click again the service row unselects it.
What is best here, reset button or click to unstick and how is it coded ?
Note that the user can then navigate from Level2 County View of map by clicking on a Level3 button into Level3 District view, where the same datagrid shows up, and needs to be able to maybe rollover again should they wish to reconsider their choice, perhaps the reset button would be good ! The initial view on arrival at Level3 should have their bus service selection still showing, this time with the Level3 MC's for it showing. We have code that appends _Level2 or _Level3 to the dg output depending on if they are at Level2 or Level3.
our code for the dg selections, first is by the way for activating the last two columns url's. :-
dg.addEventListener(ListEvent.ITEM_CLICK,dgClickF);
function dgClickF(e:ListEvent):void{
//trace(e.columnIndex, e.rowIndex)
//trace("Focus has left row: " +e.rowIndex + " col: " + e.columnIndex)
if (e.columnIndex == 6 || e.columnIndex == 7){
var cellData = e.target.columns[e.columnIndex].itemToLabel(e.target.getItemAt(e.rowIndex));
//trace(cellData)
var url : String = cellData;
var targetURL:URLRequest = new URLRequest(url);
navigateToURL(targetURL,"_blank")};
}
dg.addEventListener(ListEvent.ITEM_ROLL_OVER,ShowTempSymbols);
function ShowTempSymbols(e:ListEvent):void{
makeAllVisibleF(false);
var r:RegExp = /\W/g;
for(var s:String in e.item){
//trace(currentLevel)
if(e.item){
var clipName :String = String(e.item).replace(r,"")+currentLevel;
//trace(clipName)
if(Map_Collection[clipName]){
Map_Collection[clipName].visible=true;
}
}
}
}
dg.addEventListener(ListEvent.ITEM_CLICK,ShowSymbols);
function ShowSymbols(e:ListEvent):void{
makeAllVisibleF(false);
var r:RegExp = /\W/g;
for(var s:String in e.item){
//trace(currentLevel)
if(e.item){
var clipName :String = String(e.item).replace(r,"")+currentLevel;
//trace(clipName)
if(Map_Collection[clipName]){
Map_Collection[clipName].visible=true;
}
//trace(s,e.item)
//trace(currentLevel)
//if(e.item){
}
}
}
function makeAllVisibleF(b:Boolean):void{
Map_Collection.Mitre'sGate_Level2.visible=b;
Map_Collection.Mitre'sGate_Level3.visible=b;
// and a load more !
}
Envirographics
