I need help understanding how this works. AS 2.0

Its my first time here and i only started learning flash today. I aint too great with maths and i was showed this piece of code that makes a triangles point follow the cursor. It involved mathimatical things ( which i aint so great at) and the guy said "You dont need to know how it works, just how to use it." well i copied his code and it worked, but i have no idea how to use it in other rotation apart from the one he taught us. I dont even understand how to redo his code i saved it to a word document and anytime i wanted to make something rotate something in that fashion i would refer to that. But i dont want to have to do that, i want to know how to use it, dont have to understand it, but use it for other rotation matters. If you are going to help, please try to be a bit simmple i explaining it, cause im new. Dont get me wrong i aint thick but i can find it a bit hard to follow some things, that is i my current problem.
here is the rotation code:
onEnterFrame = function()
hero._rotation = getmouse(hero);
getmouse = function(mc:MovieClip):Number
dy = _ymouse-mc._y;
dx = _xmouse-mc._x;
rad = Math.atan2(dy,dx);
rotate = rad*180/Math.PI
return rotate+90
also if it helps, here is the video i was watching: http://www.youtube.com/watch?v=w3OfrpbNhHs
please if you can, explain how the entire thing works.
thanks for any help given in advance.

Hi,
Here's a short primer.  It may not be sufficient but here goes.
1st, move the closing bracket at the end and put it on the third line.  This makes the code more efficient
onEnterFrame = function(){                               // this causes Flash to repeatedly
                                                                          execute the next line at the
                                                                          frame rate you selected
                                                                          for your document
       hero._rotation = getmouse(hero);               // this tells Flash to rotate a
                                                                          movie clip (named hero) based
                                                                          on the function getmouse()
};                                                                     // putting the }; here makes the
                                                                          code more efficient and readable
getmouse = function(mc:MovieClip):Number{   // This is the function called with
                                                                         mc referring to hero that was
                                                                         passed from the second line.
     dy = _ymouse-mc._y;                                // dy means delta y which subtracts
                                                                        the y position of the movieclip
                                                                        from the mouses y position
     dx = _xmouse-mc._x;                               // dx = delta x (same as above line
                                                                        but on the x axis)
                                                                     // once you have the x and y sides
                                                                        you male a triangle.
                                                                        Now use trig to find the angle
     rad = Math.atan2(dy,dx);                           // the computer works in radians
                                                                        the arc tangent atan2 will give the
                                                                        angle in radians
     rotate = rad*180/Math.PI                            // you want to convert the radians to
                                                                        degrees, that's what this line does
     return rotate+90                                         // this returns the value of rotate back
                                                                        to the calling function in line 2.
                                                                        the +90 determines which part
                                                                    // of the hero movie clip is facing the
                                                                       mouse.
If you put the mouse cursor over any of the green reserved words above in the Actions panel you will get a desctription of what these do.
hope that helps.

Similar Messages

  • Help understand how this works

    Hows everyone doing, i need some help understand this. This is my first time using Lulu. From the reviews i'v read about it they tell me this is the #1 place to come to to get my books printed. Here the question,  i have all 3 of my books ready to be uploaded do i just sent that in, then they send me the prints ? or so they self them for me. Sorry if this seems like a dumb question, but its my first time using this particular site.

    Here's a quick overview:
    You start the new book wizard. Click "Create," pick a book type and size (hardcover, paperback, etc.; 6x9, 8.5 x 11, etc.), and click "Make this book."
    Hint: If you want the widest distribution for your book, pick a size / type that has a green checkmark next to it.
    The wizard will guide you to name your book, apply an ISBN (or get a free one), upload your contents, and upload your cover or design a cover. It will guide you to set pricing and distribution, and many other options.
    When you've done all that, your book will be available to order. You will see two prices: the one you pay, and the one other people pay. The one you pay is the printing cost per book. It may be anywhere from $2.50 to $20.00 or more, depending on options you pick -- probably coser to the low end.
    On that first page, where it says "Create," there is a calculator that will figure roughly what your book will cost (printing costs), so you can plan your options around that calculator.
    So you order as many books as you want, pick shipping, pay with a credit card, and in a few days, the books are on your doorstep.
    I hope that helps.

  • I need help understanding how the Apple components integrate to create a system across all my devices?

    I need help understanding how the Apple components connect to create a whole system across all my devices?
    Is there a resource that describes current system and associated functionality?
    For example:
    Buy A, B, C to achieve "X" 
    You will need:
    an internet provider which supports <specs>
    add D to achieve "Y"
    You will need:
    an internet provider which supports <specs>
    add "E" to achieve "Z"
    You will need:
    an internet provider which supports <specs>
    For example, I am looking at the Gen 6 Airport extreme.  For intended performance do I need broadband? if so what are the specs, or will basic internet service suffice?  Do I need the internet provider's modem or does the Airport extreme replace that?  And then I think, if I am doing this, I should also look at Apple TV....What do I need and Why?  Then I look at the New Desk top coming out in the fall, and I think well, if I wait and get this, what does this component do for the system, and what becomes redundant? What does this awesome desktop do for my ability to sit and use a new macbook air when I travel  or sit on the couch in my PJs?
    If there was a place that plainly stated "if you buy the new dektop you can configure a system including only these components and achieve <this result> and by adding <additional components> you will achieve this result.
    I have been to the genius store a few times, but I come out of there more confused unless I have SPECIFIC questions or already know what to buy. 
    A "System Configuration App" would be a really great sales tool--Just saying.

    I have no idea what "fully optimized" means.
    No Apple device will let you watch broadcast TV. The Apple TV is a good option for watching streaming TV from iTunes, NetFlix and Hulu. If you want to watch from other sources, you may need to look at other devices.
    Any Mac computer or iPad will allow you to surf the web.
    What business software?
    Time Capsule is a good option for back ups.
    Update what across all devices?
    For accessing documents from all devices, a service like Dropbox is your best bet.
    I have no idea what "step as far away from an internet provider as possible" means. If you want Internet access, you need an Internet provider.
    Lighting fast speed for what? Processor? The specs are listed for all devices in the Online Store. Internet? We're back to the service provider.
    Technology changes. The only way to keep pace with it beyond a couple of years is to buy new stuff.
    The bottom line is you need to look at the specs for devices availble and at your budget and decide what best meets your needs. If you are unable to do that on your own, there are lot of technology consultants out there who will, for a fee, look at your exact situation, make recommendations and even handle the purchase and set up. Perhaps that would be the best route for you.
    Best of luck.

  • Need Help Understanding How To Use iMessage Between Two iPhones

    I have an iPhone 4 and my wife an iPhone 3GS.  We both have iOS 5, but I have discovered something about iMessage I need to make sure I understand correctly.  As I understand it iMessage can send text even if our voice carrier service is unavailable.  I tend to loose signal inside the building I work in.  I usually can get texts in and out, but sometimes not.  But in testing the two phones sending iMessages, I've noticed is that if I have one of the phones with iMessage turned on and the other with iMessage turned off, the two phones will not be able to exchange text.  Is that how it's supposed to work?  Even though one of these phones can receive an iMessage doesn't mean the other one send one back.  Can't the system detect when one phone is connected and another one not, and the one that is not gets sent SMS messages instead?  I don't want to try to send my wife an iMessage because I can't get a voice signal in my building, but her have iMessages turned off and not able to get any messages from me, iMessage or SMS.  I guess I need help better understanding how this actually works between the two phones so I can always get texts back and forth between my wife and I.  My other misgiving is that this iMessage thing consumes my data limit.  My wife gets unlimited because she had her phone before the limits were imposed, but I got on board after, so I am hesitant to use iMessage all the time because of it.  I have no intention to send picture mail through iMessage, but the thing is if I wanted to switch to SMS to send picture mail to save data, but my wife's phone is set to iMessage, she won't get it.  If this is how this thing is supposed to work, I'm not really impressed.  Some insight would be appreciated

    I think you are making this way too complicated. Why are you turning iMessage off? If you are at your office connect to the WiFi there and send your wife messages that way (unless your office is blocking the port iMessage uses). When possible the two phones will use iMessage but will revert to SMS is iMessage is not available if that option is set that way.
    I would not worry about using up your data plan if you have the 2GB, text iMessages are going to be very small and MMS (picture) ones are not very large either. Unless you are sending hundreds of picture iMessages a day you will have a hard time using up your data.
    If you are near an Apple Store you should explore signing up for an intro iPhone course and have them run through iMessage options.

  • How much does this cost? & I still can't understand how this work

    How much does this cost? & I still can't understand how this work

    Hello mkopti,
    ePrint is a free feature include on most of our wireless printers that are e-all-in-one enabled. It allows you to register your printer on HP's website http://www.eprintcenter.com and create an account. Once an account has been created you can enable the web services feature, after connecting to a valid network with internet access, which will print off a registration code you can use to add the printer to your account and customize an email address for the printer. This allows you to print to the printer from virtually anywhere simply by sending an email to the printers email address and when it is received it will print.
    Most of these printers are also Airprint enabled meaning you can print locally from the same network on the iPad, iPod, and iPhone (version 4.3.2 and higher) by using the built in "Print" command in the idevices.
    If you have any other questions or need clarification feel free to reply to this post and I will try to answer any questions you have.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • I really dont understand how this works

    alright first off this isnt for a school assignment so please dont feel guilty about "giving it away"
    alright so this has to do with something called gridworld, if you ever seen it you know what it is, if you havents its basiclly a java built world that has bugs, rocks, flowers, and other things.
    (here is a video showing the basics of gridworld http://www.youtube.com/watch?v=ZnWGOT5Bd2E&feature=related). i program in JCreator btw not greenfoot.
    alright getting to the point i have the code for a bug someone build called a "chameleoncritter". what the bug does is change colors depending on what it is next to, so if it is next to a pink rock it changes pink, ive been reading the code and can honestly not figure out how this method changes its color depending on what it is next to. here is the code
    * AP(r) Computer Science GridWorld Case Study:
    * Copyright(c) 2005-2006 Cay S. Horstmann (http://horstmann.com)
    * This code is free software; you can redistribute it and/or modify
    * it under the terms of the GNU General Public License as published by
    * the Free Software Foundation.
    * This code is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * @author Chris Nevison
    * @author Barbara Cloud Wells
    * @author Cay Horstmann
    import info.gridworld.actor.Actor;
    import info.gridworld.actor.Critter;
    import info.gridworld.grid.Location;
    import java.util.ArrayList;
    * A <code>ChameleonCritter</code> takes on the color of neighboring actors as
    * it moves through the grid. <br />
    * The implementation of this class is testable on the AP CS A and AB exams.
    public class ChameleonCritter extends Critter
         * Randomly selects a neighbor and changes this critter's color to be the
         * same as that neighbor's. If there are no neighbors, no action is taken.
        public void processActors(ArrayList<Actor> actors)
            int n = actors.size();
            if (n == 0)
                return;
            int r = (int) (Math.random() * n);
            System.out.println(n);
            Actor other = actors.get(r);
            setColor(other.getColor());
         * Turns towards the new location as it moves.
        public void makeMove(Location loc)
            setDirection(getLocation().getDirectionToward(loc));
            super.makeMove(loc);
    }if anyone can explain to me how this works it would be excellent.
    one more thing, here is a link to the gridworld api (list every method and class and its function).
    http://www.horstmann.com/gridworld/javadoc/
    Edited by: vouslavous on Apr 17, 2009 8:51 PM

    public void processActors(ArrayList<Actor> actors)
            int n = actors.size();
            if (n == 0)
                return;
            int r = (int) (Math.random() * n);
            System.out.println(n);
            Actor other = actors.get(r);
            setColor(other.getColor());
    }Randomly selects a neighbor and changes this critter's color to be the same as that neighbor's. If there are no neighbors, no action is taken.
    Mel

  • SMTP Banner mismatch - still not understanding how this works?

    I have a new Exchange 2010 install.  
    My outgoing email is getting flagged as spam.  MX Record test shows SMTP banner mismatch.
    I understand that you don't change the FQDN on the receive connector using the GUI.
    I have created an additional Receive connector so I have the following:
    Receive Connectors:
    Client Comm
    Default Comm
    My question is how to I change the smtp banner and which connector do I set it on.  The syntax needed for the Set-ReceiveConnector is kicking my butt.
    It sure is frustrating that the new Windows World is so centered around Powershell command lines. Very frustrating and backwards technology.
    The documentation on the Set and Get-Receiveconnectors is very poorly written. IMHO.

    My reverse DNS is setup correctly.
    This is an issue with the receive connector banner page.  Some email hosting services, AOL, Hotmail etc.  are flagging my outbound email as junk.  So they must be doing a test to see that my receive connectors have the wrong SMTP banner.
    My send connector is ALSO setup correctly.  
    I need help with the syntax in using the Set-receiveconnector cmd.
    Follow:
    http://technet.microsoft.com/en-us/library/bb125159(v=exchg.141).aspx
    Create a Internet type custom receive connector. My assumption is that you receive internet messages directly to the hubs. When you create an Internet Receive Connector it will allow anonymous senders to connect to it so it will work for internet messages. 
    In the Specify the FQDN this connector will provide in response to HELO or EHLO field, type the name advertised in response to the SMTP HELO or EHLO verb. If you leave this field blank, the fully qualified domain name (FQDN) of the Hub
    Transport server or Edge Transport server is automatically added when the connector is created
    Twitter!:

  • Need help understanding how DNS should be set up...

    Some time back I was advised to switch my network settings such as to start using the OpenDNS servers rather than the ISP (Comcast) servers that were setup by default... I did so, at least I did so in the Network/DNS settings on my MacBook Pro... But I just noticed today that my Airport Extreme Router has its own DNS settings and those are still set to the Comcast settings...
    How does all this work??? Which DNS settings matter, the ones in the Network setup for each Mac or PC in my home network??? Or do the Router settings win over everything else???
    I need a brief tutorial on how to properly set up the DNS settings not just for a computer but for an entire home network... Any feedback???? thanks...

    I do appreciate the help... One other interesting thing I encountered recently... I was in Oakland airport where they have free wifi... I found myself unable to connect though I had been successful in other earlier visits there.... I got curious and played for a while... What I discovered (after an hour of trying but I had time) was that I had to change my DNS settings on my computer to an address very similar to the home page IP of the airport website... I don't recall now how I came to finally figure that out but it was happenstance more than anything... I vaguely recall me stumbling upon some message where the airport was suggesting a DNS value to use. It popped up on the screen or inside the Network settings or somewhere.. I think it was when I was walking through the connection wizard which I did several times before I had success...
    But I've never had that experience in airports before... All of this shows how my ignorance of DNS keeps finding ways to impact my ability to "get connected" when here or there... Again, just another interesting DNS issue I stumbled upon recently... thanks...

  • Need help understanding how ipv4 and ipv6 co-exist

    I'm trying to understand something that happened in our network recently. Current, we're all ipv4 based, but a few machines here and there have ipv6 enabled by mistake. Everything has been working ok, but recently we had some dhcp issues. I'm trying to understand how exactly ipv6 and ipv4 work together.
    Questions:
    - if we have workstations with ipv6 enabled but no dhcpv6 servers, does the ff02::1:2 multicast address exist on the network? If something starts up a dhcpv6 server somewhere, would that explain why several workstations have started sending out dhcpv6 solicit messages?
    - If workstations attempt to get an address via dhcpv6 and get no response, will it try dhcp with ipv4, or will it just assign a 169.254.*.* address?

    Muse allows you to create websites without knowing HTML / CSS etc...
    If you can use Indesign you'll be able to use Muse.
    A site created in Muse can be published with just a couple of clicks to Business Catalyst.
    However Business Catalyst can do much more ~ it can allow you to create and manage the website of almost any kind of business.
    Here is a short blurb from the BC / FAQ:
    "Once your clients log in, they will have immediate access to their contact database, orders, web form submissions, products, catalogs, web pages, and email marketing campaigns from one central location — all built to work together."
    find out more here: http://www.adobe.com/products/business-catalyst/faq.html

  • Transitions still screwy. Can somebody help me understand how this works?

    I'm struggling to understand why my transitions and/or titles aren't working right when exporting.
    On the video I'm currently putting together I'm using the scrapbook theme.
    When I preview the video it looks perfect but when I export it I get this:
    During the yellow "title" sequences, the video is supposed to be running inside a "photo frame" graphic and then at the last 1/2 second or so zoom right into the remainder of the video. What happens instead is that the video gets to the point where the title graphic is supposed to zoom gracefully into the video and instead it just cuts right to the video. The inverse happens at the beginning of the title sequence as well.
    I have two links that illustrate this. One is a screenshot of the section of the project in question and the other is a video of the preview with the quicktime .mov running underneath it.
    Sorry for the crappy quality of the video with the watermark. It's clearly not worth the price their asking to get rid of the watermark since it's nowhere near that jerky on my screen.
    Any help you can give me would be great. This is happening on almost all these titles in this project and has happened a lot in the past.
    http://www.mvlawn.com/screenshot/Screen%20shot%202009-11-16%20at%206.25.36%20PM. png
    http://www.mvlawn.com/screenshot/iShowU-Capture.mov
    (Ignore the exclamation triangles, I didn't have my external drive plugged in when I took the screenshot)
    THANKS!!
    Message was edited by: Kevin Berube

    One thing to keep in mind is that when you have a transition (it looks like you are using Fade Through Black), it takes half the frames from the preceding clip and half the frames from the following clip. Si if you have a 1/2 second fade through black, it needs 8 frames from the preceeding clip and 8 frames from the following clip.
    But you have the photo album title also contending for those same eight frames.
    I think you would get better results if you either
    1) removed the fade through black transition, or
    2) moved the start of the title to the right so that it started on the 9th frame or later.

  • Need help understanding how to resolve this XMLP Report Definition error

    Getting error on only 1 database but is of course is the one for an important deal. Going to Reporting Tools>XML Publisher>Report Definition and querying for Report Name HRS_INT_LET we get errors.
    File associated with template definition is not found in the database. (235,77)
    File object associated with template defintiion is not found in the database, therefore the report and/or template definition is not valid.  Please check consistency of objects.
    Next error message:
    Error in PeopleCode ScrollSelect processing. (2,213) PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula  Name:LoadTemplateDefn  PCPC:37323  Statement:542
    Called from:PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula  Name:LoadReportDefn  Statement:601
    Called from:PSXPRPTDEFN_WRK.FUNCLIB.FieldFormula  Name:SelectReportDefn  Statement:740
    Called from:PSXPRPTDEFN.GBL.PostBuild  Statement:36
    A SQL error occurred during processing of the PeopleCode ScrollSelect (or ScrollSelectNew, RowScrollSelect, RowScrollSelectNew) built-in function.
    This error may have been described by a preceding message.
    Examine the error messages and the PeopleCode program containing the ScrollSelect call to determine the cause of the error.
    Edited by: user702257 on Feb 3, 2010 8:24 AM

    Hey did anyone reply or have a similar problem.. ??
    but with 3 Error Messages, the first one is:
    1st Error:
    SQL error.stmt#:651 Error Position:2010 Return:904 - ORA-00904: "CUSTMERNAME":invalid identifier
    2nd Error:
    SELECT T1, T2, ETC........
    3rd Error:
    Error in PeopleCode ScrollSelect processing. (2,213) At INV.TRANS.FieldChange trans_qry PCPC:1719 Statement: 67
    A SQL error ocurred during processing of the PeopleCode ScrollSelect (or ScrollSelectNew, RowScrollSelect, RowScrollSelectNow) built-in function.
    This error may have been described by preceding message.
    Examine the error message and the PeopleCode program containing the ScrollSelect call to determine the cause of the error.
    does any one know or had this error in particular?
    Thanks
    George

  • I need help to get this working I can't get anything to load in my SWF.

    // drop shadow filter class import
    import flash.filters.DropShadowFilter;
    // transitions imports
    import fl.transitions.*;
    import fl.transitions.easing.*;
    // Determine where on the stage we want to have the thumbnail images start
    xStartPos = 40;
    yStartPos = 20;
    // Create our XML object
    var imageList:XML;
    // Setup our XML loader and tell it the file path to our XML file.
    // Also, add an event listener to call the loadComplete() function
    // when the loading of our XML file is complete.
    var xmlURLLoader:URLLoader = new URLLoader();
    xmlURLLoader.load(new URLRequest(xmlURLRequest("loadImages.xml")));
    xmlURLLoader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void
    try {
      // Build new instance of XML object (imageList) and copy into
      // it the data from e.target which is the xml_loader object (which
      // contains the data loaded from our XML file).
      var imageList:XML = new XML(e.target.data);
      // Grab all of the file_type elements (tags) from our imageList
      // XML object (which now contains all of the data from our XML file)
      // and store them in an XMLList object (somewhat like an array).
      var imageList:XMLList = imageList.file_type;  // our image file locations
      var imageArray:Array = new Array();
      var i:int = 0;
      numImages = xml.ImageList.length;
      // Place all of our image filenames into our imageArray by
      // stepping through the xmlImageList XMLList object one element at a time
      for (i = 0; i < numImages; i++)
       // push the filename text from each element of our XMLList object
       // (xmlImageList), which contains all the file_type elements (tags)
       // from our XML file, onto our array one element at a time.
       // Note: we created a property called our_source in our imageArray
       //       which we will access again in function stageImages().
       imageArray.push({our_source:xmlImageList[i].text()});
      // Call stageImages() function which will put the images on the stage
      stageImages(imageArray);
    catch (error:Error)
      // ignore errors for now - could put trace() statements here
    }  // end function loadComplete()
    function stageImages(imgArray:Array):void
    // Build a loop that creates the image movie clips and puts them on the stage.
    // When we say the image movie clips we really mean the movie clips that hold
    // the images.
    for (var i:int = 0; i < imgArray.length; i++)
      // Begin the image loader
      var imgLoader:Loader = new Loader();
      imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadCompletes);
      // Reference our image array
      imgLoader.load(new URLRequest(imgArray[i].our_source));
      // Create a movie clip called pic_mc which is the instance name
      // of ALL of our images.  This will allow us to apply effects like
      // drop shadows or whatever we want to our image movie clip instances
      // all at once.
      var pics_mc:MovieClip = new MovieClip();
      // Now, tell our movie clips what their x and y positions will be
      pics_mc.x = xStartPos;
      pics_mc.y = yStartPos;
      // Add the just-added image movie clip as a child of our pics_mc movie clip.
      //     So, another way of saying it is we are throwing each loaded image
      //     movie clip inside our pics_mc movie clip as we load each image in the loop.
      // imgLoader is an array of images (our entire list of images) and it is
      // being loaded here INTO our pic_mc movie clip AS A CHILD.
      pics_mc.addChild(imgLoader);   // pics_mc is a container for our images
      // Here is how we set the number of columns for our thumbnails (based
      // on 7 columns).  CHANGE THE 7 TO HAVE DIFFERENT NUMBER OF COLUMNS
      if (((i + 1) % 7) == 0)
       // Let's set the x and y positions...
       // This is how we separate the amount of space we want in between
       // images as they slide out or stack up.  Change these values if you
       // wish to have more or less columns.
       xStartPos = 10;    // CHANGING THIS VALUE WILL PUSH THE COLUMNS LEFT/RIGHT
       yStartPos += 40;   // CHANGING THIS VALUE WILL ALTER VERTICAL SPACING OF PICS
      else
       // CHANGE THE 100 TO DRAMATICALLY CHANGE WIDTH BETWEEN COLUMNS
       // AND THE 46 TO CREATE MORE SUBTLE DISTANCE BETWEEN COLUMNS
       xStartPos += 100 + 46;
    }  // end function stageImages()
    // Define what happens once our images are loaded...
    function imgLoadCompletes(e:Event)
    // Get access to our image loader object we were using when this
    // function was called.
    // Type-cast e.currentTarget (our imgLoader object from above) as
    // a LoaderInfo object and access its loader property which is the
    // loader object associated with this LoaderInfo object (in our case
    // the imgLoader object which the event listener was listening on above
    // in the stageImages() function).
    // We are now calling it by the name image_loader.
    var image_loader:Loader = e.currentTarget as Loader;
    // Access the parent movie clip of our image loader object.  We called this
    // pics_mc above in the stageImages() function.
    var pics_mc:MovieClip = image_loader.parent;
    // Begin our fill and drawing of graphics - the Polaroid Effect - did this LATER
    var imgWidth:Number = image_loader.width;
    var imgHeight:Number = image_loader.height;
    var spacingFillWidth:Number = 15;
    var totalSpacing:Number = spacingFillWidth;
    var totalSpacingFillWidth:Number = imgWidth + (totalSpacing * 2);
    var totalSpacingFillHeight:Number = imgHeight + (totalSpacing * 2);
    // TRY THIS and then COMMENT IT OUT as we'll be using drop shadow rather than stroke
    // Set a stroke width value and place a stroke around our parent_mc movie clip
    //var strokeWidth:Number = 1;
    //parent_mc.graphics.lineStyle(strokeWidth, 0x000066, 100);
    // Begin drawing art for the fill
    pics_mc.graphics.beginFill(0xCCCCCC, 100);
    // Draw rectangle (add 100 to height to get Polaroid background look)
    pics_mc.graphics.drawRect(-totalSpacing, -totalSpacing, totalSpacingFillWidth, totalSpacingFillHeight + 100);
    // End fill
    pics_mc.graphics.endFill();
    // Create drop shadow instance (shadow) and set its parameters (same as
    // you would if you were manually adding a drop shadow filter
    // DO THIS AFTER COMMENTING OUT STROKE LINESTYLE ABOVE!
    var shadow:DropShadowFilter = new DropShadowFilter();
    shadow.alpha = .5;      // alpha of 50%
    shadow.distance = 15;   // distance of drop shadow from movie clip
    shadow.angle = 90;
    shadow.blurX = 15;
    shadow.blurY = 15;
    // Apply our drop shadow to our movie clip
    pics_mc.filters = [shadow];
    // Scale the image clips down as thumbnails for the initial display of
    // images on the stage.  Set this according to your own image sizes
    pics_mc.scaleX = .05;
    pics_mc.scaleY = .4;
    // optional - rotate our fake_mc movie clip in a random fashion.
    // CAN PLAY WITH THE  3 TO ALTER ROTATION
    pics_mc.rotation = Math.round(Math.random() * - 10) + 3;
    // set up dummy placeholder properties to hold a copy of our
    // x and y position values.
    pics_mc.origX = pics_mc.x;
    pics_mc.origY = pics_mc.y;
    pics_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick);
    pics_mc.addEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
    }  // end function imgLoadCompletes()
    // Called if user clicks on one of the thumbnail images
    function onMouseClick(e:MouseEvent):void
    // Make each separate movie clip its own target
    var thumb_mc:MovieClip = e.currentTarget as MovieClip;  // cast it as a MovieClip object
    // Expand thumbnail that was clicked so it scales to full size
    thumb_mc.scaleX = 1;     // note 1 = 100% for scaling in AS 3.0
    thumb_mc.scaleY = 1;
    // Last thumbnail image clicked on will be on top -- this part is optional
    // Each item on stage has a childIndex number which defines its depth (z-axis)
    // in the stacking order of items on the stage (or within another object).  The
    // higher the childIndex number of an object the closer the object will be to the front.
    // numChildren is a property that contains the number of children in an object (in
    // our case the stage).
    setChildIndex(thumb_mc, numChildren - 1);
    // Set location of thumbnail image on the stage.  Note that these
    // values are based on the bottom of where our images line up and
    // our stage dimensions of 1000x700.
    thumb_mc.x = 250;
    thumb_mc.y = 250;
    // Set transitions once thumbnail images are clicked
    //var showImage:Object = {type:Fade, direction:0, duration:1, easing:Strong.easeOut};
    // Blinds has a problem letting us select larger image and move it back to thumbnail
    //var showImage:Object = {type:Blinds, direction:0, duration:1, easing:Strong.easeOut};
    // PixelDissolve doesn't always allow us to easily select larger image either
    //var showImage:Object = {type:PixelDissolve, direction:0, duration:1, easing:Strong.easeOut, xSections:30, ySections:30};
    var showImage:Object = (type:Photo, direction:Transition.IN, duration:1, easing:Strong.easeOut);
    TransitionManager.start(thumb_mc, showImage);
    // For more info on Transitions, search for Transition class in Help docs
    }  // end function onMouseClick()
    function onMouseRelease(e:MouseEvent):void
    // Get reference to the larger image that was "moused up" on.
    var big_mc:MovieClip = e.currentTarget as MovieClip;
    // Tell the image to return to its starting location as a thumbnail image
    big_mc.x = int(big_mc.origX);   // Typecast origX and origY properties to int
    big_mc.y = int(big_mc.origY);
    // Scale the larger image back down to thumbnail image
    big_mc.scaleX = 0.2;
    big_mc.scaleY = 0.2;
    }  // end function onMouseRelease()

    Here it is without comments.  No didnt do any tracing.  I only get one error saying Scene 1, Layer 'Actions', Frame 1, Line 236 1084: Syntax error: expecting rightparen before colon.  I know there has to be more wrong with the code please help me find them.
    import flash.filters.DropShadowFilter;
    import fl.transitions.*;
    import fl.transitions.easing.*;
    xStartPos = 40;
    yStartPos = 20;
    var imageList:XML;
    var xmlURLLoader:URLLoader = new URLLoader();
    xmlURLLoader.load(new URLRequest(xmlURLRequest("loadImages.xml")));
    xmlURLLoader.addEventListener(Event.COMPLETE, loadComplete);
    function loadComplete(e:Event):void
    try {
      var imageList:XML = new XML(e.target.data);
      var imageList:XMLList = imageList.file_type;
      var imageArray:Array = new Array();
      var i:int = 0;
      numImages = xml.ImageList.length;
      for (i = 0; i < numImages; i++)
       imageArray.push({our_source:xmlImageList[i].text()});
        stageImages(imageArray);
    catch (error:Error)
    }  // end function loadComplete()
    function stageImages(imgArray:Array):void
    for (var i:int = 0; i < imgArray.length; i++)
      var imgLoader:Loader = new Loader();
      imgLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadCompletes);
      imgLoader.load(new URLRequest(imgArray[i].our_source));
      pics_mc.x = xStartPos;
      pics_mc.y = yStartPos;
      pics_mc.addChild(imgLoader);
      if (((i + 1) % 7) == 0)
       xStartPos = 10;
       yStartPos += 40;
      else
       xStartPos += 100 + 46;
    }  // end function stageImages()
    function imgLoadCompletes(e:Event)
    var image_loader:Loader = e.currentTarget as Loader;
    var pics_mc:MovieClip = image_loader.parent;
    var imgWidth:Number = image_loader.width;
    var imgHeight:Number = image_loader.height;
    var spacingFillWidth:Number = 15;
    var totalSpacing:Number = spacingFillWidth;
    var totalSpacingFillWidth:Number = imgWidth + (totalSpacing * 2);
    var totalSpacingFillHeight:Number = imgHeight + (totalSpacing * 2);
    pics_mc.graphics.beginFill(0xCCCCCC, 100);
    pics_mc.graphics.drawRect(-totalSpacing, -totalSpacing, totalSpacingFillWidth, totalSpacingFillHeight + 100);
    pics_mc.graphics.endFill();
    var shadow:DropShadowFilter = new DropShadowFilter();
    shadow.alpha = .5;
    shadow.distance = 15;
    shadow.angle = 90;
    shadow.blurX = 15;
    shadow.blurY = 15;
    pics_mc.filters = [shadow];
    pics_mc.scaleX = .05;
    pics_mc.scaleY = .4;
    pics_mc.rotation = Math.round(Math.random() * - 10) + 3;
    pics_mc.origX = pics_mc.x;
    pics_mc.origY = pics_mc.y;
    pics_mc.addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick);
    pics_mc.addEventListener(MouseEvent.MOUSE_UP, onMouseRelease);
    function onMouseClick(e:MouseEvent):void
    var thumb_mc:MovieClip = e.currentTarget as MovieClip;
    thumb_mc.scaleX = 1;
    thumb_mc.scaleY = 1;
    setChildIndex(thumb_mc, numChildren - 1);
    thumb_mc.x = 250;
    thumb_mc.y = 250;
    var showImage:Object = (type:Photo, direction:Transition.IN, duration:1, easing:Strong.easeOut);
    TransitionManager.start(thumb_mc, showImage);
    }  // end function onMouseClick()
    function onMouseRelease(e:MouseEvent):void
    var big_mc:MovieClip = e.currentTarget as MovieClip;
    big_mc.x = int(big_mc.origX);
    big_mc.y = int(big_mc.origY);

  • Need a Little Help with Understanding How Layers Work in PSE

    I have PSE version 5 and I am using it on a PC with Windows XP.
    As I get more into editing photos, I am enjoying it, but confusion is also starting to set in.  My question is about layers.  When I go to edit a photo for web/email use only, I start by resizing it to 72 ppi and then reducing the pixel dimensions quite a bit.  Then after that I normally go through this process of editing the photos by using normally about three different commands.  One is Levels, then I may go to Shadows/Highlights, and then my last command is always sharpening.  I used to do this all on one layer, but then finally learned to put each one of these editing features on their own layer so I can make changes/deletions without too much trouble.
    When I started doing the separate layers, I was just making a copy of the background layer each time and then touching that particulay layer up with Levels, Sharpen or Shadows/Highlights.  But I noticed that depending on the order in which the layers were placed, some changes would be obscured.  If I put the Levels layer on top, and then the Sharpen layer and the Shadows/Highlight layer below that, the sharpen effect and the shadows/highlights effects were no longer there.  I could only see the levels effect.  The photo was still not sharp and so on.  If I put the Sharpen level on top, then the photo showed the sharpen effects, but now the Levels and Shadows/Highlights effects were no longer visible.
    So then I started to make a copy of the background initially, do a levels adjustment here, then, instead of making a copy of the original background layer again, I would make a copy of the layer that now has the levels changes on it.  Then do the sharpen effect on this layer.  This way I had all the changes on one layer as long as I put that layer as the top layer.  But then I realized that I once again fI didn't have a layer with only one fix on it.   Finally, I started to use an adjustment layer for Levels, put this as the top layer, make a copy of the background layer, do shadows/highlights, copy background layer again, do sharpen, and this seems to work a little better.  But even with this way, depending on what order I place the sharpen and shadows/Highlights layers, one of them still seems to get obscured by the layer above it.
    Can someone help me to understand how layers work in this regard.  I am obviously a little confused here.
    Thanks,
    Lee

    You really aren't working efficiently. First of all, do your editing on a full sized version of the photo, since you have more data for PSE to work on and will get better results. Use save for web to make your web/email copy when you are totally done. You can resize it down on the right side of the save for web window.
    Duplicating a regular layer makes an opaque layer that obscures the layers below it. It's best to start off by not working on your original image, so that you don't have to worry if you mess up. If you're working on a copy, you can work right on the background layer, or only duplicate the layer once and apply your changes to that. So you'd apply both shadows/highlights and sharpening to the same layer.
    Finally, you should use an adjustment layer for levels. Layer>New Adjustment Layer>Levels. This will put levels on a transparent layer above your image, but you will need to click the layer below it to get back to a pixel layer to apply other changes (you can't sharpen an adjustment layer, for example).

  • All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though.

    All of my apps on my new ipad2 are not working. I had this iPad about 4 months and nothing bad has happened before this. I need help on how to make my apps stop crashing. All my built in apps are fine though. WHATBCAN I DO TO MAKE MY APPS STOP CRASHING. I ALREADY TURNED IT OFF THEN ON AGAIN AN IT STILL CRASHES. HELPPP!!!!

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.

  • I really can't understand how this recursive works??

    Hi all,
    I have got a recursive function that checks for palendrome string. But it is confusing. I know that a string is palenromme if it is empty or has a char or first char and last one are same and middle is palindromme too.
    but can't understand how this function works.
    class Palindromme
         boolean palindrom(String s)
              if (s.length() <= 1 || s.equals(null) || s=="") //this is the stopping point
                   return true;
              else
              {                    //recursive definition
                   return ( s.charAt(0) == s.charAt(s.length()-1) ) && palindrom(s.substring(1,s.length()-1));
    specially i don't know how palindrom(s.substring(1,s.length()-1)); is working cause it has to be increased for each loop.
    abdul
    PS: actually i don't know how recursion works from Data structure point of view

    Hi,
    ok your palindrome is : "otto"
    return ( s.charAt(0) == s.charAt(s.length()-1) ) && palindrom(s.substring(1,s.length()-1));
                  o                     o                                   tt
    so first part is true                                        
    in the second part palindrom is called again but with the remaining tt
    so second time :
    return ( s.charAt(0) == s.charAt(s.length()-1) ) && palindrom(s.substring(1,s.length()-1));
                   t                     t                                 ""
    Third time:
    if (s.length() <= 1 || s.equals(null) || s=="") //this is the stopping point
    return true;after all for otto the recusion is:
    return ( s.charAt(0) == s.charAt(s.length()-1) ) && s.charAt(1) == s.charAt(s.length()-2) ) && nothing left of otto);
    Phil

Maybe you are looking for