Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

i need help making a behavior happen 1

Status
Not open for further replies.

sydeffex

Technical User
Mar 23, 2003
1
US
I'd like to switch a graphic for a visible copy, or change the opacity of it when the button is pressed. and at the same time add text to a textfield by adding it to a list. i'm not sure why these changes arent showing up on the stage after i click the button. gchoicelist is a string of true/false variables because the user may or may not activate certain text and bitmaps depending on what they choose. ok so here's the code.

on a button:

global gChoicelist,gInfolist
property psprite

on mouseup me
gChoicelist.mental.mindreading = true
gInfolist.add("The hero can read minds.")
psprite = sprite(me.spritenum)
end

and on a graphic:

global gChoiceList
property pswitchmember

on exitframe me
pswitchmember = sprite(me.spritenum)
if gChoicelist.mental.mindreading then
pswitchmember = member(3,21)
end if
end
 
Hi,
I'm not sure what is "gChoicelist.mental.mindreading"
Are you accessing list in a list?
I think the correct way is:
gChoicelist[mental][mindreading],
where mental and mindreading are both a value.

Heres an example of how it works:
list = [["a","b","c"],["1","2","3"]]
put list[1]
-- ["a", "b", "c"]
put list[1][2]
-- "b"
 
the "gChoicelist.mental.mindreading" will work when you are working with property lists. You can access properties of a list just like you can with your other objects. So "mental" could be a property of "gChoicelist" and "mindreading" could in turn be a property of "mental".

Mayuresh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top