1 / 20

ICPMM15DA Develop A Multimedia Script Week 5

ICPMM15DA Develop A Multimedia Script Week 5. Last Week. BitmapData Loader URLRequest Textfield Containers. Assignment 1. Was due last week I only have 4 people submitted: Karamjit Jaswinder Almas Manjeet

gerd
Download Presentation

ICPMM15DA Develop A Multimedia Script Week 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ICPMM15DADevelop A Multimedia ScriptWeek 5

  2. Last Week • BitmapData • Loader • URLRequest • Textfield • Containers

  3. Assignment 1 • Was due last week • I only have 4 people submitted: • Karamjit • Jaswinder • Almas • Manjeet • Henry you have submitted your storyboard, but I have no emailed flash files from you • These four people have CO’s, the rest of you I have to wonder. • Remember Late Submissions endure MUCH harder marking

  4. Timer class • import flash.utils.Timer; • Timer class is used to set up a timer, like a stop watch, or an alarm • Format: var myTimer:Timer = new Timer (1000, 3); The first variable is how long you want the timer to wait This value is in milliseconds (so 1 second is 1000) The second variable is how many times you want to repeat this If you don’t put this value in, or you put in 0, it will repeat continously.

  5. Example import flash.utils.Timer; import flash.display.Sprite; var onOff:Boolean = true; var mySprite:Sprite = new Sprite(); mySprite.graphics.beginFill(0xFF0000); mySprite.graphics.drawRect(0,0,100,100); mySprite.graphics.endFill();

  6. Example (cont.) var myTimer:Timer = new Timer(4000); myTimer.addEventListener(TimerEvent.TIMER, changeDisplay); myTimer.start();

  7. Example (cont.) function changeDisplay(evnt:Event):void { if(onOff) { addChild(mySprite); onOff = false; } else { removeChild(mySprite); onOff = true; } }

  8. UILoader • UILoader is a useful container class that can load external files into a SWF and give you access to how much has been loaded • Also useful for loading external JPEG’s into the stage quickly. • Requires you to import the Component into the Library • Format: var myUILoader:UILoader = new UILoader; myUILoader.load(URLRequest);

  9. Example import flash.utils.Timer; import flash.display.UILoader; import flash.net.URLRequest; var onOff:Boolean = true; var url_on:URLRequest = new URLRequest(“image1.jpg”); var url_off:URLRequest = new URLRequest(“image2.jpg”);

  10. Example (cont.) var myTimer:Timer = new Timer(4000); myTimer.addEventListener(TimerEvent.TIMER, changeDisplay); myTimer.start(); var myUILoader:UILoader = new UILoader(); myUILoader.x = 100; myUILoader.y = 100; myUILoader.width = 300; myUILoader.height = 300; addChild(myUILoader);

  11. Example (cont.) function changeDisplay(evnt:Event):void { if(onOff) { myUILoader.load(url_on); onOff = false; } else { myUILoader.load(url_off); onOff = true; } }

  12. Arrays • an Array is like a list • very useful to loop through • should have all of the same type var myArray:Array = new Array(); myArray.push(1); myArray.push(3); myArray.push(4); • This makes an array like this: [1, 3, 4] • arrays always have [] around them.

  13. Arrays • You could also do this: var myArray:Array = [1,3,4] • If you want to refer to something in an array, you use this format: myArray[indexNumber] • The first index of the array is actually 0 • so: myArray[0] would equal 1. I can also reassign indexes with a new value by doing this. myArray[1]= 100 the array is now: [1, 100, 4]

  14. Example • Change the previous example to refer to an array of url requests instead of two separate urlRequest.

  15. Assignment 2 • Due Week 8 • Image Gallery • Stage size: 1200 x 700 • The gallery is to consist of a main image display area and thumbnails (running from left to right either above or below the main display).

  16. Assignment 2 • The main display is to start a slide show of all images in a loop. Change interval is 3 sec.The thumbnail panel is to show which image is being displayed in the main window by selection. It can be a filter or different alpha, • We will be looking at Filters next week

  17. Assignment 2 • Clicking of the main image stops the show and starts showing two controls to the left and to the right of the main display area: Next and Previous buttons. • Clicking on the controls will change the main display image to the next or previous. The thumbnail display is to show the change, as well.

  18. Assignment 2 • Clicking on the thumbnail will display the corresponding image in the main display.Clicking on the Main Display when it is not in the slide show mode will resume the slide show. There should be transitions between the image changes.

  19. Example • I have created an example image gallery to give you an idea.

  20. Assignment 2 • Start with PsuedoCode in a Word Document

More Related