Trying to get id of label field?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Trying to get id of label field?
Hi Guys,
I've created a couple of icons using the label control. I basically dragged the label control, made sure it was opaque, filled the background in to a specific colour, changed text colour and line spacing so the 'icon' looked exactly the way I wanted it. I then duplicated that control, changed the background colour slightly, as I wanted to use it as a hover over on a button.
The problem is trying to attach those two controls to my button. I've inserted a blank button, but I can't change the icons for hover over etc to the ones from the label field as they don't have ID numbers on them. Is there anyway I can get the id numbers of the static controls I have created?
Many thanks
jalz
I've created a couple of icons using the label control. I basically dragged the label control, made sure it was opaque, filled the background in to a specific colour, changed text colour and line spacing so the 'icon' looked exactly the way I wanted it. I then duplicated that control, changed the background colour slightly, as I wanted to use it as a hover over on a button.
The problem is trying to attach those two controls to my button. I've inserted a blank button, but I can't change the icons for hover over etc to the ones from the label field as they don't have ID numbers on them. Is there anyway I can get the id numbers of the static controls I have created?
Many thanks
jalz
Re: Trying to get id of label field?
Hi jalz,
let me see if I really get it...
1. You created some FIELDS (labels are fields) and modified them until they look OK for you.
2. You want to use them (the way they look) as ICONS in buttons.
Is that correct so far?
Well, you cannot do this directly, since ICONS in buttons need to be IMAGES!
You could "import snapshot..." to create IMAGES from your different fields
and use them in your buttons.
Best
Klaus
let me see if I really get it...

1. You created some FIELDS (labels are fields) and modified them until they look OK for you.
2. You want to use them (the way they look) as ICONS in buttons.
Is that correct so far?
Well, you cannot do this directly, since ICONS in buttons need to be IMAGES!
You could "import snapshot..." to create IMAGES from your different fields
and use them in your buttons.
Best
Klaus
Re: Trying to get id of label field?
Thanks Klaus,
I think I will recreate them as images and import them. Thought there might be a way of converting the label field into an image/icon/sprite directly from within livecode.
I think I will recreate them as images and import them. Thought there might be a way of converting the label field into an image/icon/sprite directly from within livecode.
Re: Trying to get id of label field?
Hi jalz,
No other way, sorry.
Best
Klaus
yes, you can "import snapshot..." in Livecode to "turn" your fields into images!jalz wrote:Thanks Klaus,
I think I will recreate them as images and import them. Thought there might be a way of converting the label field into an image/icon/sprite directly from within livecode.
No other way, sorry.
Best
Klaus
-
- Livecode Opensource Backer
- Posts: 328
- Joined: Mon Dec 05, 2011 5:34 pm
- Contact:
Re: Trying to get id of label field?
Jalz,
Just to be clear - the "import snapshot ..." is a Livecode programming code statement (look it up in the Livecode Dictionary).
Klaus doesn't mean that you can only create snapshot images Outside of Livecode and Import them (even though the command sounds like that!) Although creating the images outside of Livecode is perfectly acceptable as well.
Hope that helps,
Dave
Just to be clear - the "import snapshot ..." is a Livecode programming code statement (look it up in the Livecode Dictionary).
Klaus doesn't mean that you can only create snapshot images Outside of Livecode and Import them (even though the command sounds like that!) Although creating the images outside of Livecode is perfectly acceptable as well.

Hope that helps,
Dave
Coding in the Sun - So much Fun.
Visit http://electronic-apps.info for released App information.
Visit http://electronic-apps.info for released App information.
Re: Trying to get id of label field?
There's another way out of this as well:
Set the script of the hover label to
Set the script of the normal label to
Set the loc of both labels to the same thing
Hide the hover label
Now when you move the cursor of the displayed label the hover label will appear and when you move the mouse off it the normal label will appear. No button needed.
Set the script of the hover label to
Code: Select all
on mouseLeave
lock screen
hide me
show field "NormalButton"
unlock screen
end mouseLeave
on mouseUp
-- do your normal mouseUp stuff here in the hover button
end mouseUp
Code: Select all
on mouseEnter
lock screen
hide me
show field "HoverButton"
unlock screen
end mouseEnter
Hide the hover label
Now when you move the cursor of the displayed label the hover label will appear and when you move the mouse off it the normal label will appear. No button needed.
PowerDebug http://powerdebug.ahsoftware.net
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev
PowerTools http://www.ahsoftware.net/PowerTools/PowerTools.irev