Solved

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

Posted on 2010-08-19
2
977 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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
While working over numerous projects I often had the requirement for doing a screen capture in AS3.0. Unfortunately I found no "ready made" solutions in google search that suited my requirements. But I did come across some great resources which help…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

747 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

12 Experts available now in Live!

Get 1:1 Help Now