Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Programming - Workshop 3

360
views

Published on

Third presentation on programming in Actionscript 3.0. We handle Strings and functions.

Third presentation on programming in Actionscript 3.0. We handle Strings and functions.

Published in: Self Improvement

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
360
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
27
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. Programming Cas Lemmens - Workshop 3
• 2. So far we’ve seen... Variables Mathematical functions Boolean Logic Loops Conditionals Arrays Strings Functions
• 3. Arrays fruits.push(); fruits.unshift(); fruits.pop(); fruits.shift(); fruits.splice(); fruits.concat(); fruits.length; fruits.toString();
• 4. Procedural programming Strings
• 5. var welcome:String = “Hyper Island”;
• 6. var welcome:String = “Hyper Island”; H y p e r I s l a n d
• 7. var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 8. Value of an index var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 9. Value of an index var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.charAt(8);
• 10. Value of an index var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.charAt(8);
• 11. Value of an index var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.charAt(8);
• 12. Value of an index var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.charAt(8); variable answer has value ”l”
• 13. Index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 14. Index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:uint = welcome.indexOf(‘e’);
• 15. Index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:uint = welcome.indexOf(‘e’);
• 16. Index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:uint = welcome.indexOf(‘e’);
• 17. Index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:uint = welcome.indexOf(‘e’); variable answer has value 3
• 18. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 19. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.indexOf(‘e’);
• 20. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.indexOf(‘e’);
• 21. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.indexOf(‘e’);
• 22. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.indexOf(‘e’); variable answer has value 3
• 23. First index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.indexOf(‘e’); variable answer has value 3
• 24. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 25. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘e’);
• 26. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘e’);
• 27. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘e’);
• 28. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘e’); variable answer has value 3
• 29. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘e’); variable answer has value 3
• 30. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 31. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘z’);
• 32. Last index of a value var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:int = welcome.lastIndexOf(‘z’); variable answer has value -1
• 33. Slicing an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 34. Slicing an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.slice(2,8);
• 35. Slicing an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.slice(2,8);
• 36. Slicing an array var welcome:String = “Hyper Island”; p e r I s 2 3 4 5 6 7 var answer:String = welcome.slice(2,8);
• 37. Slicing an array var welcome:String = “Hyper Island”; p e r I s 2 3 4 5 6 7 var answer:String = welcome.slice(2,8); variable answer has value “per Is”
• 38. Splitting an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 39. Splitting an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:Array = welcome.split(7);
• 40. Splitting an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:Array = welcome.split(7); variable answer has value
• 41. Splitting an array var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:Array = welcome.split(7); variable answer has value “Hyper I” “sland”
• 42. Making a substring var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11
• 43. Making a substring var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.substr(3,4);
• 44. Making a substring var welcome:String = “Hyper Island”; H y p e r I s l a n d 0 1 2 3 4 5 6 7 8 9 10 11 var answer:String = welcome.substr(3,4);
• 45. Making a substring var welcome:String = “Hyper Island”; e r I 3 4 5 6 var answer:String = welcome.substr(3,4);
• 46. Making a substring var welcome:String = “Hyper Island”; e r I 3 4 5 6 var answer:String = welcome.substr(3,4); variable answer has value “er l”
• 47. Making a substring var welcome:String = “Hyper Island”; e r I 3 4 5 6 1 2 3 4 var answer:String = welcome.substr(3,4); variable answer has value “er l”
• 48. Making a substring var welcome:String = “Hyper Island”; e r I 3 4 var answer:String = welcome.substr(3,4); variable answer has value “er l”
• 49. Making a substring var welcome:String = “Hyper Island”; e r I 3 4 var answer:String = welcome.substr(3,4); variable answer has value “er l”