Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statements

Status
Not open for further replies.

Manic

Programmer
Feb 28, 2001
343
GB
I am trying to set up an if statement based on markers.

the code that I have is

if marker = "section 1 end"
then
else

on mouseenter
cursor 280
end
on mouseleave
sprite(31).member = "buttons_off_01"
sprite(39).member = "hidden"
cursor -1
end
on mousedown
go to "section 1"
end

end if

I basicaly want it to use the functionality of the image if it is not at the end of section one.

any help would be appriciated.
Manic
-----------------------------
I've broken it again !!
-----------------------------
lee.gale@virgin.net
 
I can see several things wrong with that code. First of, if statements (along with any other code) must be inside a handler (i.e. on mouseenter me). You cannot have a handeler as the result of an if statement. Also, a block if statement is written like this:

if condition then
actions
else
actions
end if

So I think your code could be better written like this:

on mouseenter
if marker <> &quot;section 1 end&quot; then
cursor 280
end if
end

on mouseleave
if marker <> &quot;section 1 end&quot; then
sprite(31).member = &quot;buttons_off_01&quot;sprite(39).member = &quot;hidden&quot;
cursor -1
end if
end

on mousedown
if marker <> &quot;section 1 end&quot; then
go to &quot;section 1&quot;
end if
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top