Solved

How do I set a checkbox to be checked through Lingo in Director 11.5?

Posted on 2010-08-19
2
978 Views
Last Modified: 2013-12-24
I've added a checkbox (the built in flash component) to the stage in my Director 11.5 movie and I can correctly test through script whether the checkbox has been checked or not through the sprite(checkbox).selected property but whenever I display this checkbox again it doesn't remember the last state.

I can set it to be checked or not checked by default in the property inspector but can't find the correct way to update the "selected" property through the script.

I have tried sprite(checkbox).selected = true/1 but this throws a syntax error since .selected is not a valid property of the sprite object.

I assume there must be a way to specify that I wish to update the .selected property of the flash object, but this is my first time using a flash object in my movie and I have been unable to figure this out.

Could somebody please point me in the right direction?

Thanks,
LLMorrisson.
0
Comment
Question by:LLMorrisson
2 Comments
 
LVL 7

Accepted Solution

by:
Chris-Chambers earned 250 total points
ID: 33476372
Hi,

You have to wait a frame for the sprite to be initialised before setting this property.

Try the code below:

Chris.
property spriteNum

property pSprite

property pInitialized

property pLoaded



on beginSprite(me)

  pSprite = sprite(spriteNum)

  pInitialized = false

  pLoaded = false

  (the actorList).add(me)

end



on stepFrame(me)

  if (pLoaded) then

    if not(pInitialized) then

      (the actorList).deleteOne(me)

      pInitialized = true

      pSprite.selected = true

    end if

  else

    pLoaded = true

  end if

end

Open in new window

0
 
LVL 5

Author Closing Comment

by:LLMorrisson
ID: 33548399
Hey Chris,

Sorry for the delay getting back to you about this, been very busy moving!

This has helped me out a great deal. Thank you for the reply.

Regards,
LLMorrisson.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sometimes you know that one object has a specific child in it, but you can't find the child. This happened to me when I was trying to code some actionScript to make a toolbar work with its embedded buttons.  My partner had created the toolbar usi…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now