I want to know the syntax for setting the objects at a certain start point when the user opens the card. This is as far as I can go:
Have searched PDF and other topics but can not find the correct syntax, have used all sorts of word combinations but this one eludes me....sorry, again it's a simple case of not knowing the correct question to ask, I am sure there is a reference somewhere.
on PreOpenCard
put/set/place grc "yellowOval" from/to/into/at 500,300 ???
put grc "RedOval" from 500,300
end PreOpenCard
on mouseUp
wait 2 seconds
set the lockMoves to true
move grc "YellowOval" from 450,330 to 530,69 in 240 ticks without waiting
move grc "redOval" from 450,330 to 100,69 in 200 ticks without waiting
set the lockMoves to false
end mouseUp
tiny code problem
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, asayd
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: tiny code problem
Hi Chris,
In your preOpenCard it's
set the location of grc "yellowOval" to 450,330 (using the loc of your second set of scripts)
Simon
In your preOpenCard it's
set the location of grc "yellowOval" to 450,330 (using the loc of your second set of scripts)
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: tiny code problem
Thankyou Simon, now that makes perfect sense. However I have been doing some reverse engineering using that wonderful breakpoint and out of curiosity could I also do this: (trying to exercise myself as much as possible here)
put the loc of grc "yellowOval" into beginPoint
at which time I then define what beginPoint is for the livecode engine? by making it a variable with the x y co-ordinates?
Thankyou
put the loc of grc "yellowOval" into beginPoint
at which time I then define what beginPoint is for the livecode engine? by making it a variable with the x y co-ordinates?
Thankyou
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: tiny code problem
Hi Chris,
As you have your code now beginPoint is a variable that will contain the loc of grc "yellowOval"
For now please follow the technique of naming your variables with a prefix e.g. tBeginPoint. This will help you in the long run and really help others to be sure what you are talking about.
There is a list of prefixes that I can dig up for you somewhere.
Simon
I'm not clear on this question....I then define what beginPoint is for the livecode engine?
As you have your code now beginPoint is a variable that will contain the loc of grc "yellowOval"
For now please follow the technique of naming your variables with a prefix e.g. tBeginPoint. This will help you in the long run and really help others to be sure what you are talking about.
There is a list of prefixes that I can dig up for you somewhere.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
-
- VIP Livecode Opensource Backer
- Posts: 3901
- Joined: Sat Mar 24, 2007 2:54 am
- Location: Palo Alto
Re: tiny code problem
Here it is:
http://www.fourthworld.com/embassy/arti ... style.html
Under the Naming Conventions section.
Simon
http://www.fourthworld.com/embassy/arti ... style.html
Under the Naming Conventions section.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: tiny code problem
great resource thanks Simon. Ah yes the naming convention, I know consistency and clarity is important - but you should see what I am looking at, no naming convention here otherwise I would have most definitely picked up on it and would have recognised the variables by their prefixes.