i hope someone can help me, i have been trying to get a button counter working for 2 weeks but it doesnt appear to be working:
here is what i have:
my button behaviour method-
global mostclicks
property myTargetFrame
property myClicks
property myName
--name the button and give it its target frame
on getPropertyDescriptionList me
PDL=[:]
setaProp PDL, #myName, [#comment:"My button name", #format:#string, #default:""]
setaProp PDL, #myTargetFrame, [#comment:"Target framelabel", #format:#string, #default:""]
return PDL
end
-- count the button clicks
on mouseUp me
myClicks = myClicks + 1
if mostClicks = void then mostClicks = [:]
setAProp mostClicks, myName, myClicks
showMostClicks()
go to myTargetFrame
end mouseUp
my showmostclicks method-
global mostClicks
on startMovie me
member("mostClicks").text=empty
end
on showMostClicks
tempList = [:]
repeat with a = 1 to mostClicks.count
templist.addProp(mostClicks.getPropAt(a), mostClicks[a])
end repeat
member("mostClicks").text = empty
repeat with a = 1 to 3
myScore = tempList.max()
myName = tempList.getOne(myScore)
tempList.deleteOne(myScore)
put a&": "&myName&" clicks: "&myScore&return after member("mostClicks")
if a = mostClicks.count then a = 3
end repeat
end
i have a text member called most clicks to display the counter and button names.
this works if the buttons dont navigate to another marker of my director file, but as soon as i ask my button to navigate to another place the counter does work and doesnt count my clicks.
please help
here is what i have:
my button behaviour method-
global mostclicks
property myTargetFrame
property myClicks
property myName
--name the button and give it its target frame
on getPropertyDescriptionList me
PDL=[:]
setaProp PDL, #myName, [#comment:"My button name", #format:#string, #default:""]
setaProp PDL, #myTargetFrame, [#comment:"Target framelabel", #format:#string, #default:""]
return PDL
end
-- count the button clicks
on mouseUp me
myClicks = myClicks + 1
if mostClicks = void then mostClicks = [:]
setAProp mostClicks, myName, myClicks
showMostClicks()
go to myTargetFrame
end mouseUp
my showmostclicks method-
global mostClicks
on startMovie me
member("mostClicks").text=empty
end
on showMostClicks
tempList = [:]
repeat with a = 1 to mostClicks.count
templist.addProp(mostClicks.getPropAt(a), mostClicks[a])
end repeat
member("mostClicks").text = empty
repeat with a = 1 to 3
myScore = tempList.max()
myName = tempList.getOne(myScore)
tempList.deleteOne(myScore)
put a&": "&myName&" clicks: "&myScore&return after member("mostClicks")
if a = mostClicks.count then a = 3
end repeat
end
i have a text member called most clicks to display the counter and button names.
this works if the buttons dont navigate to another marker of my director file, but as soon as i ask my button to navigate to another place the counter does work and doesnt count my clicks.
please help