Ask a Question related to Macromedia Director Lingo, Design and Development.
-
kyleg webforumsuser@macromedia.com #1
must all global list be hard-coded in?
As customary, I use parameter dialogue boxes for most of the settings that I would change frequently; however, it seems that you can not use a property from a property desecription list to represent a global list.
Is this correct? My example is to use "glistname" as the substitute for glist name so that I can change the reference as to what list I want the behavior to effect (glist, glist2, glist3 etc.)
As you can see below "glistname" is declareded property and the default to use is "glist".
I keep getting an error when I run; however if I hardcode the word glist where glistname is in the mousedown-- it works?
Ps. I have also declared "glistname" as both a property and as a global, neither way worked. In the example below it is declared as a property which should be working just fine. right now I have to make a new behavior for everytime I want to point to a different list. Not very streamlined
Any help would be greatly appreciated. I have bolded to lines of mention
--On Click Member Change Behavior--
--------------------------------------------------------
PROPERTY DECLARATIONS
property spriteNum
property myClickSwapMember
property myOriginalMember
global glist, glist2, glist3 --list for recording up to 3 seperate changing members (checkboxes)
property myglist
property glistname - property that let you type in the desired glist right from the ParamDiagBox
----------------------------------------------------
EVENTS
on mousedown
set myglist=glistname
global myglist
if sprite(spriteNum).member=member(myOriginalMember)t hen myglist[#myOriginalMember]=1
if sprite(spriteNum).member=member(myOriginalMember)t hen myglist[#myClickSwapMember]=0
if sprite(spriteNum).member=member(myClickSwapMember) then myglist[#myOriginalMember]=0
if sprite(spriteNum).member=member(myClickSwapMember) then myglist[#myClickSwapMember]=1
end if
end if
end if
end if
end
------------------------------------------------
on mouseup --sends it back on 2nd click
global myglist
if myglist[#myOriginalMember]=1 then sprite(spriteNum).member = myClickSwapMember
if myglist[#myClickSwapMember]=1 then sprite(spriteNum).member = myOriginalMember
end if
end if
end
-----------------------------------------
PARAMETERS
on getPropertyDescriptionList
PDL=[:]
PDL [#myClickSwapMember]= [#comment: "Display which member on click?",#format: #graphic, #default: member "Pick your member"]
PDL [#myOriginalMember]= [#comment: "Display which member on click-back ?(should be your Original)",#format: #graphic, #default: member "Pick your member"]
PDL [#glistname]= [#comment: "Choose the name of the glist from the Global List for Member Change behavior that coincides with this sprite",#format: #string, #default: "glist"]
return PDL
end
kyleg webforumsuser@macromedia.com Guest
-
hard-coded path?
I'm a complete newb to swf. I haven't got a clue yet what's going on. I've built a simple little swf that implements a visualization algorithm... -
send coded variables with a link?
If I want to send a variable with a link can I send it like md5. Like this, you write $Id=5 in the code and then use md5 and send it as... -
How to avoid accessing row values with hard coded index
Hi there , My code look like this, string var1,var2,var3,var4; foreach (DataGridItem item in MyDataGrid.Items) { -
how hard to replace titanium internal hard drive? How to cloneold hard drive onto it?
Hi all - I have a 2001 titanium laptop with a 20 Gig hard drive. The thing is getting too full and I'm toying with the idea of getting a bigger... -
DISABLE The hard coded IE5+ security risk file types
I understand according to this article: http://support.microsoft.com/?id=232077 That there are hardcoded file types in IE that demands the... -
Robert Tweed #2
Re: must all global list be hard-coded in?
"kyleg" <webforumsuser@macromedia.com> wrote in message
news:bg5v95$i1o$1@forums.macromedia.com...OK, you've got to understand what is going on here. You can only set>
> As customary, I use parameter dialogue boxes for most of the settings that
> I would change frequently; however, it seems that you can not use a
> property from a property desecription list to represent a global list.
*properties* in getPropertyDescriptionList. In fact, you don't actually set
the property at that time; what you are doing is specifying the default
values for the property when the behaviour is instantiated by the score. In
other words, what happens is this:
1) Score suddenly needs your behaviour
2) Score creates behaviour with (script "whatever").new()
3) Score then sets all properties to the default values specified in the
propertyDescriptionList
4) Score triggers beginSprite event
If you want to affect a global variable, then you must do it in the new or
beginSprite handler for that behaviour. Of course, that will only change the
global at the time that the handler is called. You cannot add/remove values
in globals from behaviours in the same way as if you were to put the values
in prepareMovie, it just doesn't work that way.
You /could/ change the value of a global variable in the
getPropertyDescriptionList handler itself, but that wouldn't do you any
good. If you saved the movie and closed Director, the value would be lost.
To get it to change the global again, you would have to look at the
behaviours inspector. Try this, for example:
global gList
on getPropertyDescriptionList
if( not listP( gList ) ) then gList = []
gList[ gList.count + 1 ] = "I woz ere"
return [:]
end
on mouseUp
put gList
end
You can re-run the movie as much as you like and gList will stay the same.
However, if you open the behaviour inspector and flick between the panel
showing the script properties and any other panel, you will see lots of
extra "I woz ere" entries appearing in the list. If you close and re-open
the movie without looking at that panel, then gList will be empty.
- Robert
Robert Tweed Guest
-
Luke #3
Re: must all global list be hard-coded in?
"Luke" <lukewig@SPAMMAGNET_hotmail.com> wrote in message
news:bg63g8$rj0$1@forums.macromedia.com...
That should be "If you specify the name of the global variable as a> If you specify the name of the global variable as a property, you can
> retrieve that variable from the globals. In other words, your
> getPropertyDescriptionList should look like this
symbol... etc"
Luke Guest
-
kyleg webforumsuser@macromedia.com #4
Luke,
Luke,
First of all, thanks for your reply
I changed the global variable from a property to a symbol and from
set myglist=glistname to set myglist=(the globals)[glistname]
I still get the error "object expected"
Can you look at my dir file and see what might be the problem?
If you can look at this a would be greatly appreciated.
your [email]lukewig@SPAMMAGNET_hotmail.com[/email] shows a no domain error
can you send a good address to [email]kyle.gonyer@dana.com[/email] and let me know where I could send. (if you feel you could take a quick look of course)
thank you
kyleg webforumsuser@macromedia.com Guest



Reply With Quote

