Ask a Question related to Macromedia Director Lingo, Design and Development.
-
theBaronsglove webforumsuser@macromedia.com #1
prop list
hi,
the problem i am having is in the property description list variable, is the
listname i type in so i dont have to create loads of scripts just one script
on each button, so button one change the variable listname, to listA, so now
if the button is clicked it would know to access listA.
it is changing the variable it just does not like it being used, what am i
doing wrong?
cheers
lee
moviescript
-----------------------
global listA, listB
on startmovie
listA = [1,9,10]
listB = [4,6,7,8]
end
----------------------
this is the script on each button so button one will trigger listA, buttone
2 trigger listB
---------------------------------
global listA, listB, a
property listname, pList
on getPropertyDescriptionList
pList = []
addProp pList, #listname, [#default"", #format#string, #comment"Name of
sprite's group?"]
return pList
end getPropertyDescriptionList
on mousewithin me
if the mousedown then
repeat with a in listname
sprite(a).locH = sprite(a).locH - 10
end repeat
end if
end
theBaronsglove webforumsuser@macromedia.com Guest
-
"Page" and "Rect" props of the Field prop in Javascript API
Page property of the Field property in Javascript Acrobat API returns an array of pages that this field exists in. On the other hand, "rect" property... -
Multi-line TextBox - Paste text with numbered list, bullet list, tab character
Hi All, I need a server control that's exactly like a multi-line TextBox, but also allow users to paste text with numbered list, bullet list, and... -
Need a button to rollover, show list and link from list
Hi, very new to Flash and need some help with a button. I'm creating a title bar for a site and I'm doing something similar to the button on... -
Change prop location in List
Hi, I have this list: thelist= no I want to move property #A456 before prop #A123 how cann I do that? tnx -
#25625 [NEW]: [chm] bug on ref.ftp.html | ftp_*list cant retrive ftp list on some ftpd
From: sentomas at hotmail dot com Operating system: freebad PHP version: 4.3.3 PHP Bug Type: FTP related Bug description: ... -
Rob Dillon #2
Re: prop list
In article <br61e0$31a$1@forums.macromedia.com>, <
[email]webforumsuser@macromedia.com[/email]> wrote:
--> hi,
>
> the problem i am having is in the property description list variable, is the
> listname i type in so i dont have to create loads of scripts just one script
> on each button, so button one change the variable listname, to listA, so now
> if the button is clicked it would know to access listA.
> it is changing the variable it just does not like it being used, what am i
> doing wrong?
>
> cheers
> lee
>
>
>
>
> moviescript
> -----------------------
> global listA, listB
> on startmovie
>
> listA = [1,9,10]
> listB = [4,6,7,8]
>
> end
>
> ----------------------
>
> this is the script on each button so button one will trigger listA, buttone
> 2 trigger listB
> ---------------------------------
> global listA, listB, a
> property listname, pList
> on getPropertyDescriptionList
> pList = []
> addProp pList, #listname, [#default"", #format#string, #comment"Name of
> sprite's group?"]
> return pList
> end getPropertyDescriptionList
>
> on mousewithin me
> if the mousedown then
> repeat with a in listname
> sprite(a).locH = sprite(a).locH - 10
> end repeat
> end if
> end
>
>
>
>
>
Rob
_______
Rob Dillon
Team Macromedia
[url]http://www.ddg-designs.com[/url]
412-243-9119
[url]http://www.macromedia.com/software/trial/[/url]
Rob Dillon Guest
-
Rob Dillon #3
Re: prop list
You're leaving out the colons. This line: addProp pList, #listname,
[#default"", #format#string, #comment"Name of sprite's group?"]
should look like this:
addProp pList, #listname, [#default:"", #format:#string, #comment:"Name
of sprite's group?"]
another way to write this line is:
pList[#listName] = [#default:"", #format:#string, #comment:"Name of
sprite's group?"]
The getProp... function can be confusing. It creates a property list
with each property that you want to define as a property in the list.
The value of each of those properties is a property list. This "value"
property list has three default properties and one optional property.
The values of each of these properties make up the contents of the
property inspector window.
--
Rob
_______
Rob Dillon
Team Macromedia
[url]http://www.ddg-designs.com[/url]
412-243-9119
[url]http://www.macromedia.com/software/trial/[/url]
Rob Dillon Guest
-
theBaronsglove webforumsuser@macromedia.com #4
Re: prop list
hi rob,
cheers for that.
umm.. one other thing is that it picking up the value i.e listA, but i cant figuare out how to get the values from listA list.
listA = [1,9,10]
if the mouseup then
repeat with a in listname
-- list name is the veriable at you add by typing in the property descriptionlist
sprite(a).locH = sprite(a).locH - 10
end repeat
---------------------------------------------
so to translate what is happing
if the mouseup then
repeat with a in listA
sprite(a).locH = sprite(a).locH - 10
end repeat
--it returns listA
-----------------------------------------------
it should return:
if the mouseup then
repeat with a in listA
sprite(a).locH = sprite(a).locH - 10
end repeat
--returns 1,9,10
so it can move sprite 1, sprite 9, sprite 10
-------
cheers
lee
theBaronsglove webforumsuser@macromedia.com Guest
-
Rob Dillon #5
Re: prop list
Hi Lee,
This part of the getProp... function is defining a property called
#listName. In that property you're putting the string "listA". If you
have a list someplace, either as a global, or defined someplace else in
the behavior, it has no relationship with this newly created behavior.
There is probably a simpler or at least easier way to do what you want
to accomplish. Can you explain a bit more about what you want to do?
--
Rob
_______
Rob Dillon
Team Macromedia
[url]http://www.ddg-designs.com[/url]
412-243-9119
[url]http://www.macromedia.com/software/trial/[/url]
Rob Dillon Guest
-
theBaronsglove webforumsuser@macromedia.com #6
Re: prop list
hi rob,
the basis of what im trying to achieve, is a demo, of a slider navigation for my uni project.
the idea is - by a process of elimination which file the user is looking for (note: file = a sprite, its a demo) so if the user has around 20 files, and visually they cant tell them apart, they could use the slider to set values, by Name, Size(bytes), type.
so it kind of a guess who, in finding the right sprite.
so in the rubbish thing ive created, ive created different list for the values - see below
listA = [1,9,10]
listB = [4,6,7,8]
listC = []
listD = [5]
listE = [2,3]
----------------------------
sizeA = [1,2,3,5,6,8]
sizeB = [1,7]
sizeC = [9]
sizeD = [10]
sizeE = [4]
-----------------------------
typeImage = [1,7]
typeDoc = [2,3,4,5,6,8,9,10]
----------------------------------------------
(note - the slider is not being used, i thought i would get it working using diffrent button when transfer it to sliders)
so if the button that uses the list from listA, it would keep all the sprites in listA i.e. sprite 1, sprite 9, sprite10. and also send all the other sprites off stage and so on.
one problem i am facing now is how to return them from off stage to on stage?
but here is the mousedown script-
on mousedown
myList = value(listname)
repeat with a in myList
sprite(a).locH = sprite(a).locH - 300
end repeat
end
thanks for the help rob
cheers
lee
theBaronsglove webforumsuser@macromedia.com Guest
-
Rob Dillon #7
Re: prop list
Hi Lee,
I really don't understand your explanation. You have a number of
sprites in a particular frame. Do you know which sprites to
(potentially) act on? Or does the user select the sprites somehow? In
other words, do you make the lists of sprites or does the user?
To control the movement of any number of sprites and then control their
move back to their original locations you can create a property list of
the sprite numbers and their starting locs.
For instance, you could apply a behavior like this to each sprite:
---------
global fullSpriteList
global fullSpriteLocList
property thisSprite
on beginSprite me
thisSprite = me.spriteNum
if fullSpriteList = VOID then fullSpriteList = []
if fullSpriteLocList = VOID then fullSpriteLocList = [:]
if getOne(fullSpriteList,thisSprite) = 0 then
fullSpriteList.add(thisSprite)
end if
if getOne(fullSpriteLocList,thisSprite) = 0 then
fullSpriteLocList.addProp(thisSprite,sprite(thisSp rite).loc)
end if
end
-----------
If you need to generate the lists of sprites by type, or size, etc. at
runtime you can use a similar mechanism.
Since you are moving sprites in a specific list, you know their sprite
channel numbers. When you want to move those sprites back to their
original location, just look up that loc in the fullSpriteLocList and
move them to that loc:
on returnSprites thisList
repeat with n in thisList
sprite(n).loc = fullSpriteLocList[n]
end repeat
end
--
Rob
_______
Rob Dillon
Team Macromedia
[url]http://www.ddg-designs.com[/url]
412-243-9119
[url]http://www.macromedia.com/software/trial/[/url]
Rob Dillon Guest



Reply With Quote

