SunQuest
           Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 15th, 2003, 09:35 AM
poisedesign poisedesign is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 poisedesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Variables

I need to do the following:

i have this code, that verify if some one wrote 'like' on a text box placed on stage

// if (text1 == "like") {
// gotoAndPlay(10);
// } else {
// gotoAndPlay(15);
// }

but i need that even if some one write 'alike' or somelike the movieplayer goto frame 10 and not to 15

i know to do that in PHP, using the %xpto% but can't do it on ActionScript.

if someone could help me...

Reply With Quote
  #2  
Old July 15th, 2003, 10:01 AM
Wizard2003's Avatar
Wizard2003 Wizard2003 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 206 Wizard2003 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 29 m 24 sec
Reputation Power: 6
What about...
[/CODE]
if (text1 == "like") {
gotoAndPlay(10);
} elseif (text1 == "alike")
gotoAndPlay(10);
}
else {
gotoAndPlay(15);
}
[/CODE]
...I don't know if there's something like:
Code:
if (text1=="like" or text1=="alike") ..

...but I guess not.

Reply With Quote
  #3  
Old July 15th, 2003, 10:19 AM
poisedesign poisedesign is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 2 poisedesign User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks for your post, a lot...

but what i want is that if someone writes anyhting before or after 'like' flash could get it. EG if the user write 'I like apples' (or you like oranges, or anything) the movie go to frame 10 if not, go to 15

Reply With Quote
  #4  
Old July 16th, 2003, 02:16 AM
dkkz dkkz is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 50 dkkz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
try looking into the methods: indexOf() and substr()

Reply With Quote
  #5  
Old July 16th, 2003, 04:55 AM
josepm josepm is offline
josepm.com
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Catalonia
Posts: 17 josepm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 19 sec
Reputation Power: 0
Send a message via ICQ to josepm Send a message via MSN to josepm Send a message via Yahoo to josepm
Try this:

----------
var f = 15;
if ( text1.indexOf("like")!=-1 ) f = 10;
gotoAndPlay(f);
----------

or (same code):

----------
gotoAndPlay( text1.indexOf("like")!=-1 ) ? 10 : 15 );
----------

the function indexOf tells the position of substring "like" in text1,
if text1 doesn't have the substring "like" it returns -1.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway