www.VFXskills.com                                                                                 www.MAXlife.TV

Google Enter your search terms

 Simple Application Creation in Adobe Flash

Video is no longer available. 

1.  Drag a list component to the stage from the COMPONENTS PALLET (Window - Components (Ctrl + F7))
2.  Drag a button right underneath that.
3.  Click on the LIST component once and then at the bottom, select the PARAMETERS tab and name the LIST, mylist (with no spaces)
4.  Click on the BUTTON component once and then at the bottom, select PARAMETERS tab and name the BUTTON mybutton (with no spaces).  You can also name this in the properties tab instead of parameters tab.
5.  Select the Parameters tab and enter the words "eat item" next the the LABEL.  We're going to have a list of food items that will disappear once they are selected and it is eaten.
6.  Now that we have named the LIST and BUTTON items, we can reference them in ACTIONSCRIPT
7.  Open the ACTIONS PANEL (Window - Actions or F9).  If you drag the dialog box down, it will dock with the other panels. 
8.  Import the classes we're going to use to create this application.
9.  Import both native flash events and F L namespace events. (which is used for components events)
10.    We're also going to import fl.data.dataprovider (because we're going to source the information that's in mylist with a dataprovider).  We can do that with var dp = new dataprovider and then we add items to it by putting in dp additem and the object that has a label.  The first one why don't we just call it tomato.  Then cut and paste that line so you can add to the list and change the word tomato to something else.
11.  Now we can connect that data provider with our list by calling mylist.dataprovider=dp
12.  If we test this movie, we can see there is content in the mylist which can even be selected.  
13.  The next step is to add listeners.  We're going to add an event listener, listening for event.change.  This happens every time you click.
14. ___ select is the function.  And, every time its selected  you also have the opportunity to remove it from the list.  So, we're gonna call that eatitem and we're going to listen to mouseevent.click
15.  Then we create the functions announce select is going to expect an event.
16.  eastitem is another function that tis a mouse event.
17.  You have selected item
18.  Selected item.label
19.  dp remove item mylist.selected item.
20.  TEST - Announces you've selected the tomato and you click on eat item and it removes it from the list.


HERE IS THE ACTIONSCRIPT FOR THIS TUTORIAL (cut and paste into Notepad first, then into flash)

import fl.events.*;
import flash.events.*;
import fl.data.DataProvider;

var dp:DataProvider = new DataProvider();
dp.addItem( { label: "tomato" } );
dp.addItem( { label: "carrot" } );
dp.addItem( { label: "blueberry" } );
dp.addItem( { label: "turnip" } );

myList.dataProvider = dp;

myList.addEventListener(Event.CHANGE, announceSelect);
myButton.addEventListener(MouseEvent.CLICK, eatItem);

function announceSelect(e:Event):void {
trace("You have selected item: " + myList.selectedItem.label);
function eatItem(e:MouseEvent):void {
trace("You have eaten item: " + myList.selectedItem.label);



Site Map         


Please add us to your website or blog!

Privacy Policy - Disclaimer
free sound files, free media files, free tutorials, free web hosting, cheapest domain names, inexpensive domain names, screen capture software, Computer Software Tutorials, online training videos, computer basics tutorial, free windows tutorial, free computer tutorial for kids, computer programming tutorials, free computer courses, pc tutorial, beginner computer tutorials, free computer software tutorials, free internet tutorial, free typing tutorial programs, computing tutorials, computer science tutorials, graphic design tutorials, free visual basic tutorials, free Photoshop tutorials, newbie computer tutorials free flash tutorials, access tutorial online, computer course, pc maintenance online tutorials, absolute beginners computer tutorials, free online computer classes, frshirtsbestee online learning, free computer training download, free computer tutorial for seniors, computer parts tutorial, computer tutorials for children, computer hardware tutorials, free excel tutorials, computer fundamental introduction basics tutorial, Microsoft tutorial, free grocery coupons, Free computer software tutorials, tech support, technical support, the tech support forum, game development, 3d game development software tutorials, graphic design tutorials, graphic illustration tutorials, character animation and design tutorials, web development, Clipart and Banner Ads, adobe photoshop tutorials and downloads, software lessons, how to do it yourself, Fierce Layouts learn adobe Photoshop, learn silverlight, learn microsoft expressions, asp.net, video editing, youtube video, digital image editing software, national association of Photoshop professionals (naap) Flash Animation, graphics, computer software, computer books, manhattan flash animation presentations for advertising and banner ads, adobe, photoshop, macromedia, microsoft, software and application development, learn to, how to, tutorials, hardware, software Tech Support - Free Technical Support for Beginners and Advanced Users of Computers, Videographers, photographers, Programmers and Web Designers, Tutorials and How To Start, computer help, video, audio, nonlinear editing, cameras, microsoft excel free online video lessons, learn excel, learn microsoft word

Free software tutorials, downloads and technical support information for computer geeks, photographers and videographers.