Unexplained code in "Classroom in a Book" on AS3

I'm slowly going through the Adobe "Classroom in a Book" on
ActionScript. Every now and then the sample code includes what
appears to be a property "e" as in "function doThis (
e:mouseEvent)" or "var rbg:RadioButtonGroup =
e.target as RadioButtonGroup;"
What is "e", and when should one use it?
Thanks.

From the description you give, that "e" is in my opinion by
99% an event variable/object.
function (e:Event) { trace(e); } // defines 'e' as an object
of type Event.
The same way you can write:
function (myvariable:Event) { trace(myvariable); } or
function (microEvent:Event) { trace(microEvent); } or
whatever.
In each case that means that the function take one argument
of type Event.
Depending the case, you can use MouseEvent type, IOErrorEvent
etc. etc. Each type of event contains different information. But
all events contain i.e. the target property to find out from where
the event started.
I also always use variable 'e' for defining event variables
to handler functions. Because:
a) 'e' is to short to type :P
b) doesn't require any time to think it's name in order to be
appropriate to the code :P
c) that kind of variable is very common in use. Every event
handler function have one such variable.
Thus why to use any other names to describe them, except from
just the fast, easy, understandable 'e'? :P
I.e. Suppose you have write a code with 20 event handlers
like:
function check_sex(e:Event) { if (e.target.name="woman") {
UseAMan();} else { UseAWoman();} }
function ioerror_handle(e:IOEventEvent) { e.target.Reload();
trace (e.text); }
function on_progress(e:ProgressEvent) { slider.width =
e.bytesLoaded/e.bytesTotal; } etc
You can easily use any other variable name instead of 'e'.
However if you do that, you will type much more letters + the code
might be a bit more confusing to understand for someone else!....
:P lol... :D I gotta to sleep.. 'e'e'e'ee....

Similar Messages

  • A question based on classroom in a book cs5????

    So i am new to flash and wanted to learn so i went and bought the classroom in a book for flash cs5 to self teach my self and well in chapter 6 it has you create a navagation menu. This menu has four boxes you can hover over and click ( i completed the whole lesson so its ready to go) and well when you go to test (command + enter) the flash movie plays but it plays on a custom loop over and over. I went to the top and went under control and deselected loop and it still does it and or it stops but then nothing is clickable.. what gives?? the lesson had me design the menu so you are able to hover over and have a box appear and then when you click it makes a sound and then after you click a new window pops up with info about that particular button and well when you test it it loops through at the blink of an eye and none of the buttons work and it just plays like a movie. I can email the file to get some answers but i just need some help so please if you have read this book or have the book you may know what i am talking about.
    Thanks

    Hi, I am also experiencing the same issue. The code that's inserted in frame 1 (actions) appears as follows:
    stop();
    gabelloffel_btn.addEventListener(MouseEvent.CLICK, restaurant1);
    function restaurant1(event:MousEvent):void
    gotoAndStop("label1");
    garygari_btn.addEventListener(MouseEvent.CLICK, restaurant2);
    function restaurant2(event:MousEvent):void
    gotoAndStop("label2");
    ilpiatto_btn.addEventListener(MouseEvent.CLICK, restaurant3);
    function restaurant3(event:MousEvent):void
    gotoAndStop("label3");
    pierreplatters_btn.addEventListener(MouseEvent.CLICK, restaurant4);
    function restaurant4(event:MousEvent):void
    gotoAndStop("label4");
    /* Click to Go to Frame and Stop
    Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and stops the movie.
    Can be used on the main timeline or on movie clip timelines.
    Instructions:
    1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
    movieClip_2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame);
    function fl_ClickToGoToAndStopAtFrame(event:MouseEvent):void
    gotoAndStop(1);
    When you test the movie, the following errors appear:
    Scene 1, Layer 'actions', Frame 1, Line 4 1046: Type was not found or was not  a compile-time constant: MouseEvent.

  • What software is required to view Photoshop CC "Classroom In A Book" downloadable video lesson files from Peachpit? (edited by mod for clarity)

    Hi all, I am a brand new student, so what I know about photoshop right now is virtually nill. I have the Adobe Photoshop CC classroom in a book. In the back of the book there is a key code to register your book at Peachpit.com. Upon registering the book, you are given lessons to download. I have done this. My problem is no device on my computer will allow me to view these lessons. I already have windows media player and real player cloud and neither one are allowing me to view these. I've already lost hours of study time trying to figure this out, does anyone out there know what I can do or know what I can download. On the RealPlayer cloud site they said WINDVD was a good alternative, this was not the case for me, it totally wacked out my computer putting me even further behind. Help?

    Have you asked the book publisher?
    Report back with the codec details of your file, use the programs below... A screen shot works well to SHOW people what you are doing
    http://forums.adobe.com/thread/592070?tstart=30 for screen shot instructions
    Free programs to get file information for PC/Mac http://mediaarea.net/en/MediaInfo/Download

  • Actionscript3 classroom in a book

    I am new to actionscript and have purchased the actionscript classroom in a book from Adobe.
    I am at the end of Lesson3. At the end of the lesson they give suggestions to try after completing the lesson.
    One of the suggestions is to "Try creating a MovieClip that bounces off two or even four sides of the stage.
    I cannot figure out how to do this. Here's the code from the lesson that moves the movieclip across the stage and when the movieclip goes off the stage, the movie clip goes back to x=0 and starts moving across the stage again.
    addEventListener(Event.ENTER_FRAME,star_Move);
    function star_Move(e:Event):void {
    if (star_mc.x<stage.stageWidth) {
    star_mc.x+=4;
    } else {
    star_mc.x=0;
    What code is needed for the moveclip star_mc to bounce back and start moving across the stage going from right to left?
    Thanks for any help,
    Steve

    Play around with this. Should have everything you need.
    addEventListener(Event.ENTER_FRAME,star_Move);
    var xmultiplier:int=-1;
    var ymultiplier:int=-1;
    var xincrement:uint=4;
    var yincrement:uint=4;
    stage.align=StageAlign.TOP_LEFT;
    // get the internal bounds rect of the star so
    // we can deal with any transformation point
    var starBounds:Rectangle= star_mc.getBounds(star_mc);
    function star_Move(e:Event):void
    // x movement
    if ((star_mc.x+starBounds.left)<0)
      // mc is outside right boundary, so move left to right
      xmultiplier=1;
    if ((star_mc.x+starBounds.right)>stage.stageWidth)
      // mc is outside left boundary, so move right to left
      xmultiplier=-1;
    star_mc.x += (xincrement*xmultiplier);
    // y movement
    if ((star_mc.y+starBounds.top)<0) {ymultiplier=1;}
    if ((star_mc.y+starBounds.bottom)>stage.stageHeight) {ymultiplier=-1;}
    star_mc.y += (yincrement*ymultiplier);

  • Flash--Classroom in a book

    I'm trying to learn Flash by using the Adobe Flash "Classroom
    in a Book" and I'm stumped. The book is telling me to draw two
    overlapping rectangles for masking but every time that I do it
    doesn't come out right. If I use only one, things are fine, until I
    need to 'free transform". I don't like asking questions but I've
    got 7 hours into this chapter and I can't seem to make the tooling
    work for me.
    Anyone familiar with the book would be most appreciated. :)

    bnther wrote:
    > urami_
    >
    > Thanks for the reply. Looking at the code would
    obviously be easier when
    > offering help ( I should have done that first)
    >
    >
    >
    http://www.adrive.com/public/ac7f1a123050ea48ac8918040cac014b0b7b1e7a070c96b2137
    > 02df88bd3398f.html
    Try to break apart the mask object. Select the image on layer
    Mask and CTRL B.
    Do it to all the masks. You are drawing shapes with the
    "Object Drawing" option set ON, which should work w/o
    problem on a mask layer but in your case seem this is what
    cause the problem. After breaking apart each of the
    objects, everything seem to work fine.
    The option of "drawing object" can be easily turn on or off.
    Select rectangle drawing tool and you will see
    little icon down the tool bar. Second last, a circle within a
    square shape. If you turn it off, your shapes
    won't be grouped anymore while drawing and using this option
    for drawing mask made the file works - in your case.
    Tho take note, with this option set off, the shapes will
    merge once you overlap them. They will become one.
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Question about classroom in a book lesson 11 PS cs4

    Hi, In lesson 11 of classroom in a book (Photoshop cs4) is a very little explanation about making a web site in Photoshop (looks like they where in a hurry to finish the book at the end). Did try to make my own web site but the problem I encounter is that when I make different pages from one design and save them in SAVE FOR WEB & DESIGN like home, contact etc. One page is overwriting the last page and the page get corrupted and the web site doesn't work when you click on the different buttons. Is there anybody who knows how to do this? Because the book is not helping here much and the help section as well. Making one page is no problem! I understand the slicing etc. The only problem I have is making a home page with 5 buttons
    and 5 pages. Thanks in advance!!!!!!!

    Thanks! Yes I can work with DreamWeaver write and read CSS and XHTML, but that doesn't help me in understanding this lesson of Classroom in a book, because the lesson is delivered with the rest of the web pages already made and there is only one small example of using "SAVE FOR WEB AND DEVICES". When I try to make more then one page PhotoShop is overwriting the last saved file. So my question is: " can you only save one page"? Or what is the idea?!. When I import the index page in DreamWeaver the code looks like a mess your right about that for sure. And the slices are still all there. In Classroom in a book is no explanation about using it with DreamWeaver in this context and it's the worst lesson of the whole book.
    Yes thanks about using sub folders I found that out yesterday by trying, isn't it strange that there is no mode to save individual pages???
    Greetings!!!!!

  • FAQ: Where can I download updated lesson files for Flash Catalyst Classroom in a Book?

    The format for Flash Catalyst projects changed in version CS5.5. When you open a file that was created in Flash Catalyst CS5 in Flash Catalyst CS5.5, you get a message offering to convert the file to the new format. In the case of most of the lesson files that come with the Flash Catalyst Classroom in a Book, this is a quick, straightforward process. Once it's completed, simply save the converted file with a new name, and you can continue working on the lesson.
    A few of the lesson files, however, do not convert successfully. Adobe Press has provided new versions of those files that have been rebuilt in Flash Catalyst CS5.5, and should open without mishap. Otherwise, they are identical to the files provided with the book. Adobe Press apologizes for any invonvenience.
    You can download the updated lesson files from the Peachpit website. If you don't already have a Peachpit account, you will need to create one (simply supply an email address, name, and password; you do not need to enter a member code or ISBN number):
    Download the updated lesson files

    This may not be the same tutorial, but lesson files are downloadable with it.
    http://www.digitalclassroombooks.com/CS6/Dreamweaver/files.html
    Hope this helps.

  • How do i use illustrator cs6 classroom in a book

    how do i use illustrator cs6 classroom in a book?

    Do you have a copy of Illustrator installed?
    Then just begin at page 1, read it and practice what you read. Step by step.
    If you don't understand parts of it, dive into the manual as well or ask a question in this forum. But mind that not everybody has a copy of the Classroom in a book. So you need to ask your questions precisely and post screenshots of your artwork.

  • Classroom in a Book Examples Do Not Work.

    I am working through the Dreamweaver CS4 Classroom in a Book, while working on a MacPro OS X 10.6.1 Snow Leopard.
    Many examples do not function as advertised. This is one example:
    On page 114, the user is asked to insert a Spry menu into the page. When this is done the properties panel should appear, in which the Text, Links, Titles and so on can be entered. On my system the properties panel does not appear as it should. Instead, the properties panel for HTML and CSS remains present. It is not possible to enter the attributes as intended in the lesson. I can enter them manually into the markup, but since this will not result in correctly generated script (it is generated Javascript) it is pointless to do this. The failure of the Dreamweaver GUI makes it impossible to proceed with the lesson.
    I tried to repair this situation be deleting the files and copying them anew from the CD ROM. then started again. The error was repeated.
    My file setup is slightly different from the default. I always make an extra directory for the HTML files, named html
        ~/username/Documents/DW CIB/html/
        ~/username/Documents/DW CIB/css/
        ~/username/Documents/DW CIB/images/
        ~/username/Documents/DW CIB/js/
        ~/username/Documents/DW CIB/SpryAssets/
          and so on.
    But this is not the problem, as the system is seeing this. For example, the links inserted to the pages are automatically correct:
       <link href="../SpryAssets/SpryMenuBarVertical.css" rel="stylesheet" type="text/css" />
    Is there an issue here with Mac and Snow Leopard? Or are more people having these problems? Or am I missing something here?

    Benjamin Rossen wrote:
    I have a reason for using a different directory structure. I like to see all the .html files in alphabetic order, and not interrupted by the directories containing images, scripts and other resources. These directories are particularly disturbing if they are open.
    You have two options:
    Buy a Windows computer. Windows organizes files and folders that way by default.
    On your Mac, expand the Files panel so you can see the Type column header. Click Type, and the files will be reorganized the way you prefer.
    I put only the index.html in the site root, with a redirect on it to home.html in the lower directory, so that only one .html file is in the default root directory of the site. Now I know the Dreamweaver will not function correctly when I do this. 
    I think this is not good. I recommend that Adobe augment the system to operate correctly for any file structure built by the user.
    Dreamweaver does operate correctly for  any file structure, but it can't detect a redirect.

  • Problem with Classroom in a book

    I have been working through the lessons in Adobe Premier Elements 11 Classroom in a book and am having a problem with Lesson 6 "Creating a Picture-in-Picture overlay.  the lesson comes with Greenscreen.mov file to be used in the lesson but when I try to use it I get the error message in a pop up "This type of file is not supported, or the required codec is not installed.  As this is the file downloaded from the CD that came with the book and can't understand why I am having a problem using it.

    Ermananda
    It appears that my first impression of your situation was correct, that is, another Classroom in a Book corrupt/damaged lesson file as confirmed by nealeh's detailed post numbered 5.
    You may want to bookmark this thread and the link to the publisher since you may run into other corrupt/damaged files are you proceed through the book's lessons.
    Regarding what you wrote
    As a further note I went on to lesson 7 creating transitions.  You start by openning Lesson07_Start_Win.prel.  It tells me to open the file Lesson07_Movie.mov in the project assets panel and to open and play it in the preview window.  When I do that the greenscreen.mov that I could not open in lesson 6 appears to be running in the preview mode but maybe that is because the whold clip is done together as a completed mov file??
    That might be explained by nealeh's report that the greenscreen.mov exists in more than one place.
    The following is the link to the Premiere Elements 12 Help PDF. You might want to cross check with it as you go through your book's lessons.
    http://helpx.adobe.com/pdf/premiere-elements_reference.pdf
    Give the keyframing another look. If problems with the concept and its working through, please let us know and we can provide some step by step information on that.
    Glad for the opportunity to be of assistance. Please do not hesitate to ask if you need any help with your Premiere Elements workflows.
    Thanks.
    ATR

  • Problem Playing AVI Files From Adobe Classroom In A Book

    Hiya,
    I just bought the Adobe Classroom In A Book for Premiere Pro CS4.  However, when I try to run Lesson 1, Premiere Pro appears to be having a cow with the AVI file needed for the project.  It tells me that the codec is missing or unavailable.  I'm using a MacBook Pro on Leopard and, according to the updater agent, I'm up-to-date.  Has anyone tried this book?  And run into problems?  Any solutions to offer me?  This is driving me bonkers!
    Please and thank you!

    Hm-m, the DV-Type II's *should* play fine in QT. At least they do with QT on my PC. Adobe is usually pretty good at getting their CiaB assets X-platform. Wonder what's going on here. I think that this is the third thread on CiaB assets not playing on a Mac. Odd indeed, and probably just a "mess up" on someone at Adobe Press.
    Had similar with a Painter 3.0 book, years ago. The author had to send me 11 CD's before we found one that had the PC files on it. All the rest were Mac-only and she was really pissed at her publishing house. However, she hung in there, and we got it sorted out.
    Hunt

  • I bought the ibook version of "Photoshop Elements 11: Classroom in a Book"

    Hello
    the ibook version of photoshop elements 11:  classroom in a book did not come with the lession CD that normally comes with the hardcopy of this book.  I was wondering if there
    was any way of getting the Lession CD because the ibook is worthless to me without the lession CD. 

    There should be a link to these files at the back of the book.  For example in PSE 10 the page looks like this:
    You could try substituting the ISBN number in the above book to see if it works.

  • I am new to PS PS6 and purchased PS Classroom in a Book as a primer.  In Lesson 1 (using the 01B_Sta

    I am new to PS PS6 and purchased PS Classroom in a Book as a primer.
    In Lesson 1 (using the 01B_Start.psd example) I am able to type and move horizontal text but when I follow the instructions (exactly as writ!)
    to change the text colour, via a swatch selection, the foreground colour and the Optios Bar text colour swatch change, but the text that I typed and then selected to change (per instruction!) does not change from default black.
    Can some one help me fix what I am sure is a trivial problem?  No tech support over the week-end.  The only time I have to do this!
    Thank you.
    Jack

    Hi !  Kendall,
    Thank you for your response.  Your reply was very clear and helpful.
    The screen shot you requested is attached.
    Using your advice I can change the color of the text I inserted in the
    Classrooom in a Book Adobe Photoshop CS6 Lesson 1 lesson (Page 24)
    Following the instructions in the Book however, the text I inserted does
    not change color.
    The Book instructions are:
    1.  In ther tools panel, select the Horizontal Type tool (T).
    2.  Drag the Horizontal Type Tool across the text to select all the words.
    (When I do this I select the text in a "box" as shown in the Screen Shot
    below. It does not "highlight" the text in colour as your methods do.)
    3.  Click the Swatches tab .... and select a swatch.
    The selected colour does appear as the foreground colour and the text
    colour swatch in the options bar BUT THE TEXT DOES NOT CHANGE.
    Is the book wrong or (more likely) am I making a mistake?
    Really grateful for your help.
    Screen shot attached below.
    Jack

  • I NEED ADOBE WORK BOOKS FOR CS5 TRAINING CLASSROOM IN A BOOK

    I am studying Adobe CS5. I need work books for ActionScriptt 3.0 for Adobe Professional CS5,Adobe Flash Professional,Adobe After Effects CS5,Adobe Photoshop CS5,Adobe INDesign, CS5, Adobe Flash Catalyst CS5,  Adobe Fireworks CS5,Adobe Illustrator CS5,,Adobe Dreamweaver CS5, Adobe Premiere Pro CS5 I have completed all the Adobe Training Manuals. I need work books for more training. Where can I Buy The Books?
    [email protected]

    You can buy Classroom in a Book for CS5 products at Adobe Press.
    Find some examples here:
    http://www.adobepress.com/search/index.asp?page=1&query=cs5&showResults=Store&searchagain= Search+Again&subject=Adobe+Aft…

  • Adobe Classroom in a book

    Hi everybody! Can someone help me out? I was wondering if you can learn premiere pro cs3 using the premiere pro 2.0 classroom in a book? The cs3 version still has not been published. Are they that different? Thanks. Cheers.

    rumor has it that CS3 cib is shipping this month. Many features you can learn from the CS2 book, with the excepetion of the new functions, and Onlocation.

Maybe you are looking for

  • B/W G3 Tower & G4 iMac Issue

    Hello All, I have a bit of a problem with a G3 tower that was donated to my shop the other day (I am the manager of a charity shop in London). The tower will switch on and the hard drive whirrs but the monitor comes up with the ?/Mac flashing folder

  • Safari hangs on new tab and slows switching full screen apps..

    Hey guys,having problems with safari,when a new tab is open which displays all the most visited sites,it lags wayyyy toooo much when switching to other full screen apps,this happens only in new tab and while showing visited sites not when another web

  • Help  with installing a plug-in

    Can anyone help me - how do I install the DVcam tuner plug-in, from the extras folder in Final Cut Pro 4.5 into the application itself on my computer. Thanks, Tom

  • Accessing formula field in subreport..

    Post Author: kior CA Forum: Data Connectivity and SQL Hi, I'm new in Crystal report and need help on my problem "how to access the formula field i have created in subreport to my main report". Thanx in advance..

  • Why does my iTunes player crash everytime I try to play a TV show that I purchased in the Apple store?

    I purchased a TV show from the Apple store. I am trying to watch it on my PC through iTunes. It downloaded fine and I was able to open it last night. Today I tried to watch the same episode that I opened last night and the player lauches and then thr