Layer manipulation in actionscript

Okay, this is something I've not found much material on, it's possible I'm looking for the wrong thing in the wrong places, so I'm posting here!
I'm creating a game-engine, which will add objects to itself as symbols, and I want to be able to choose how they are "layered". For example, say I decide to model things in a type of 3D, and the Z co-ordinate is used for depth (distance from front), how would I translate this into an object 1 unit away rendering in front of an object rendering 2 units away? The engine programming I've done fine in terms of calculating the values etc., as I have a strong javascript background so that was the easy what with actionscript's neat OO syntax, but getting it to do things visually is a bit problematic know, heh. So far all I've really managed is a nice little loading bar, which isn't really that hard =D
Also, the symbols I create are actually going to be comprised of multiple parts; a base-layer, a detail-layer, and a colour-layer. What is the easiest way to do this? Ideally I'd create the symbol with multiple layers of its own, and simply toggle the detail and colour-layers on/off as required, and tint the colour-layer independently of the rest of the symbol. Is this possible? Or will I need to use multiple symbols and move them in tandem myself?

Hmm, there must have been some way before the 3D features to control whether a symbol appears in front of or behind another symbol? The solution doesn't have to involve layers in the editor's sense; if I have to do it using three or four symbols that render on top of each other then I will, but there must be some way to do this as I've seen such effects but don't know what to look for in order to find out how myself =(

Similar Messages

  • Free Transform Manipulation through Actionscript

    Hi all,
    is there a way to manipulate the free transform x-wise and y-wise using Actionscript rather than the traditional design approach?

    yes, you can use the matrix class:
    var t:Transform = mc.transform;
    var m:Matrix = new Matrix()
    m.b=2;
    m.c=1.3;
    mc.transform.matrix = m;

  • Manipulating Embedded ActionScript

    I have another conceptual question:
    Is it possible to use Flex MXML (or another mechanism inside FlexBuilder) to manipulate variables and objects inside embedded ActionScript?
    If so, how is embedeed ActionScript code accessed? I assume dot notation because that's how ActionScript works but I'm vern new to Flex.
    -sage
    P.S. What I'd really like to be able to do is embed SWF files into FlexBuilder (easy enough) and be able to manipulate the ActionScript in those embedded SWF files using Flex via Plain Text or XML data (that I assume would be imported). Does this sound plausible?

    I believe the ActionScript in the SWF you load are accessible. See these links:
    http://livedocs.adobe.com/flex/3/html/help.html?content=controls_15.html
    http://blog.pixelingene.com/?p=216
    http://www.youtube.com/watch?v=bGMwAcAyE9Q
    If this post answered your question or helped, please mark it as such.

  • Best Practice - When to put things on a different layer?

    I'm designing a simple website that includes a FLVPlayer
    component, some ComoBox components that control the player, and
    some text. Is there a technical reason why the player, the
    comboboxes and the text should each be on different layers, or is
    it more a matter of housekeeping? Is there a rule of thumb that
    indicates when a new layer should be used for something?
    Thanks

    I use them for organization, most of the time. When tweening
    symbols on the stage there can only be one symbol on the layer or
    it will not work. There should be a layer specifically for
    actionscript as well.

  • Actionscript Ignores Layers...

    I have a movie that I created using actionscript that I want
    to fade in...
    I created a fade in movie clip on a layer above the
    actionscript....
    The fade in works (background images fade in) but everything
    that was created using actions doesn't....
    Is there a way to fix this problem? (using a
    this.onTopOfAllActionscript haha)
    Thanks

    mbrellisford
    > I have this whole movie that I created using
    actionscript and I
    > want it to fade in...
    Okay.
    > I created a movie clip on a layer above the actionscript
    and
    > placed the movie clip on that....
    Aha. Well, there's an important thing you should know. Once
    your SWF
    is compiled, those layers are gone. They're an organizational
    metaphor for
    authoring, but the concept of "layers" is translated, though
    a complex
    process, into "depths," so ActionScript doesn't really ignore
    layers, but it
    doesn't treat them the way you might expect.
    > The fade in work (background images fade in) but
    everything
    > that was created using actions doesn't....
    Target your ActionScripted work *inside* a movie clip, then
    use
    ActionScript to fade that movie clip in. I couldn't really
    tell from your
    post, so I'm not sure if you're already doing that (or trying
    to). You said
    > I created a movie clip on a layer above the actionscript
    ... then ...
    > placed the movie clip on that
    What movie clip? ActionScript doesn't create content that
    you can place
    on the timeline by hand, so I'm not sure which movie clip
    you're putting
    where. But in any case, you can either create an empty movie
    clip, give
    that an instance name, and aim your scripted visuals at that
    clip -- in
    which case its layer position will still work in comparison
    to other layered
    movie clips -- or you can create this empty movie clip with
    ActionScript.
    David Stiller
    Adobe Community Expert
    Dev blog,
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • What are the options for integrating the event catalog and event landing pages in our website?

    We'd like to integrate the event catalog and event landing pages into our website but would prefer not to use the standard iframe embed code. Are there other solutions available, like an API or something else?
    Reason for this is that when we tried it with the iframe embed code the event catalog seems to load quite slow in a webpage on our website. Plus it seems we can't change the width and height of the event catalog with the CQ5 editor, or have the event catalog embed dynamically change in size depending on the amount of events in the catalog.

    Keeping everything in one scene is the better way to go.  Scenes are useful for animators who do not use navigation, they just make movies that play frame after frame without stopping.  But for anything that involves navigating the timeline you will have less headaches if you just avoid them and keep everything in the one main timeline.
    There are primarily two approaches to implementing pages in a timeline.  Either spread them out along the timeline and navigate from frame to frame to access them, or create them as movieclips (all in the same frame) and manage their visibility.  The latter approach makes it easier to maintain the status of a one page if navigating to another is necessary.  And you might find it useful to mix these two approaches at times.
    When you have everything on one timeline, you can have a layer dedicated to actionscript that you extend the full length of the timeline, which makes shareable code, such as variables and functions, available to anything along the timeline.  This avoids any need to have duplicate function definitions since you can have the same single function available to multiple pages in the site.  I usually use two actions layers... one for the shared stuff which has all code in frame 1 only, and another for frame specific code such as timeline commands and other action coding that needs to happen at particular frames.

  • Adobe Acrobat Overlay PDF Help

    Is it possible to overlay specific pages within a PDF document?  For example, I have an Excel printout, which is then run through a printer again to print a report from access on the bottom of the same page.  It appears that Acrobat 9 can do this using the Background feature, but it is difficult to control.  Basically, I may have any number of pages, that may need different backgrounds within a whole document.  The problem I run into is if i make a mistake and use the wrong background PDF, when i remove it, it removes every background I may have used in document.  The goal is to streamline a yearly publication that includes pieces from word, excel, access, and visio.  The current situation causes many pages to be fed through the printer as many as 3 times for reports and page numbers.  At the end, I feed the whole paper version back though a copier to PDF it.  Does Acrobat X expand on this feature or is there another Adobe Product I should be looking at to compile this publication.  Thanks

    Acrobat X doesn't add anything to the optional content group (OCG, aka "layer") manipulation features found in earlier versions, so to do anything major with layers you need to use third-party plugins such as ARTS PDF Aerialist Pro.
    If you want to import one PDF page as an OCG on one page of another PDF, you can use the layers pane tools. Open the navigation tab on the left of the Acrobat interface and show the layers pane, then click the tools icon below the word "Layers" and select "Import as layer".
    This will only bring in one page at a time, and OCG operations cannot be undone in Acrobat without a plugin, as Acrobat doesn't recognize the actions of the layers tools as a step on the undo list, nor can you delete a OCG or move content from one OCG to another (aside from flattening them).
    To import the same page as an OCG on every page in a file (or a subset thereof) you should use the watermark or background tools (watermarks can add text too; but they both do the same as the tool on the layers pane, but don't list the new OCG in the stack). If you want to collate-merge two multi-page documents or merge pages of the same document into a stack, you'll need to use a plugin or automate the above steps using a script (though scripted solutions for this type of thing tend to result in a horrible mess).

  • Buttons and Action Script 3 in Flash CS4

    Hi, I am new to Flash. I am working on creating a photo gallery and I am having an issue trying to figure out how to add AS3 code to link buttons to a point in a timeline.  I have 5 buttons each with an alpha transparency change that works fine and now I want to establish an action on each button that on CLICK will bring up a particular photo in my timeline. Help!  Thanks

    I can't tell you what is involved with bringing up a photo on your timeline, but to code a button to do something, first you assign it an instance name via the properties panel.  Let's say you name it btn1.
    Then, normally in layer dedicated to actionscript, in the same frame as that button you assign an event listener and an event handler to go with it...
    function btn1Handler(evt:MouseEvent):void {
         gotoAndStop("framelabel"); // or frame number
    btn1.addEventListener(MouseEvent.CLICK, btn1Handler);
    For that example it shows how to have the button make things move to a different frame in the timeline.

  • Previous button

    Basic next, previous, back buttons - in Lingo I'm used to
    simple scripts like, well, 'go previous' - and, moreover, only
    writing them once! In Flash....how do you do it?? I've done a
    'home' button with gotoAndPlay for the known label, but even then
    because scripts aren't meant to be attached to buttons as such it
    seems i have to rewrite it over and over again in the actions layer
    keyframe for each scene? This is something I've found generally -
    even if you use target to respond to multiple buttons, you still
    need to write out a separate event listener for each and every
    clickable object. Which is incredibly tedious if you have a lot of
    them. I thought a proper OO scripting language would maximise
    reusability of code, but it seems less elegant than even the old
    verbose Lingo. Hopefully I'm missing something.
    Is it really as repetitive and difficult as it seems - or is
    there some neat way of doing these basic things in AS3?
    Oh, one other basic thing
    - is there an 'alert'command that pops up its string
    parameter in a message box? Or a command window to try out lines of
    code?

    In Flash, you can write one listener and one function for
    each button. Once.
    With your home button in the first frame of the timeline, add
    a new layer for the actionscript. Name your home button instance,
    possibly "homeButton". Then your code for that button would be:
    homeButton.addEventListener(MouseEvent.MOUSE_UP,homeUp);
    function homeUp(event:MouseEvent):void {
    gotoAndPlay("home");
    This should work throughout the movie's extent.
    In Lingo, go next and go previous will move the playback head
    to the next or previous marker in the timeline. In Actionscript
    there is a nextFrame and prevFrame method. These will move the
    playback in the current timeline one frame and stop. There is no
    built-in function or method to move to the next or previous frame
    label in Actionscript. In AS3, finally, you are allowed to know
    what frame labels are in any given timeline. You can use this
    information to find where you are currently in the timeline and
    then find the next or previous frame label.
    Actionscript is very different from Lingo. Trying to force
    one to emulate the other can be very frustrating.

  • Exporting in a Different Frame?

    Hello,
    I am using Flash CS3, and creating a game in AS2. Is there a way I can make a movieclip export in another frame other than 1st? Such as frame 3? I had to uncheck all of the movieclips exporting in frame 1, but now they don't work. Is it possible to export them in Frame 3?
    MrA615.

    What frame and layer must the actionscript be in be in? Because I keep on getting the undefined text in the output.
    Here's a screenshot. Does the movieclip have to be on the stage and same layer to be run by this?

  • Error #1009 !! Can't solve :(

    Hi, guys . I made an interactive movie ( or i'm making....)
    Check it out :http://mr-agu.deviantart.com/#/d2s1vfc
    The PROBLEM is that the Error #1009 comes up.
    Here is the actionscript I used.
    home_btn.addEventListener(MouseEvent.CLICK, home);
    function home(event:MouseEvent):void
        gotoAndStop(366);
    stop();
    I got a button with instance name home_btn in a layer below the actionscript layer on the same frame...ie. Frame number 365.
    And this error comes
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at test1_fla::MainTimeline/frame366()
    What should i do ?? Plz help. i'm a N00b in flash.

    Yes, the problem is whith the button. But i have given the button the same instance name " home_btn".
    Now error is :
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at test1_fla::MainTimeline/frame366()[test1_fla.MainTimeline::frame366:1]
    And the button and actionscritp are in the same frame(365). but it says error in frame 366 !
    Click on this pic and u will get a clear idea of my problem.

  • Statment must appear within on hanlder....

    when i keep this code on my button in action.. "statment must appear within on handler" erro is generating.....
    what should i do for this .,, my code is....
    nxt.onRelease = function(){
              newthumb();

    Do not put that code on your button.  Put it in the timeline that contains the button that has an instance name of "nxt" - you can create a layer specifically for actionscript and place it there so that it is easy to find.  If you do it correctly a lowercase "a" should appear in the timeline frame where you place it.  I deally the newthumb() function should also be in that same timeline frame.
    In AS2 you can place code on objects but it is written differently.  Doing that is considered bad practice though because it makes code harder to find and can confuse targeting things properly.
    The code you show is the timeline version which is better. 

  • Flash Banner linking

    I am in Dreamweaver CS3. I have a Flash animation in a div
    tag. I brought it into the site by dragging or
    Insert>Media>Flash. I would like my viewers to click on the
    banner when it has stopped, and go to another page in the site. I
    would like the banner or an area with in the banner to be hot, not
    an area on another line outside the Flash graphic. Am I asking too
    much?
    Thanks, Bobi

    In other words, HTML cannot add links to Flash objects. That
    must be done
    in Flash.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "poodle101" <[email protected]> wrote in
    message
    news:fqlo4t$6mf$[email protected]..
    > Hi,
    >
    > Add the actionscript below to a frame in your movie
    clip.
    >
    > Cheers
    >
    > Paul
    >
    > this.onMouseDown = function() {
    > getURL("www.yoursite.com");
    > };
    >
    > or maybe if your are linking to a page in your site say
    the homepage try
    > something like this
    >
    > this.onMouseDown = function() {
    > getURL("../index.html");
    > };
    >
    > In the same layer as your actionscript make a
    transparent box the same
    > size as
    > the
    > banner.
    >
    >
    >

  • Tweening assistance needed

    Hello
    I've been asked to re-design this website http://www.tandp-dancewear.co.uk/ but the client still wants to keep the tweening effect of the images merging into one another.
    Can anyone point me in the direction of a decent tutorial or some tips on the best way to go about it. I use Fireworks and Dreamweaver CS3 and I have very basic knowledge of Flash so I'm not afraid to use that application if I have to.
    Thank you!

    I'll walk you thru the process of tweening one image on one layer and try to explain how to mix the rest of the images in.
    With a new Flash file open, select the first frame in the timeline.  Then import an image to the stage using the main menu bar... File -> Import -> Import to Stage.
    You should now now see the image on the stage and the frame in the timeline that you selected should a darkened keyframe.  Right click on the image on the stage and select Convert to Symbol.  In the interface that opens, give the image a name of your choosing and select the Graphic option (you select any of the three, but Graphic is sufficient).
    Then, on that same layer in the timeline, right click on the frame 10 and choose Insert Keyframe.  Do the same for frames 30 and 40.  After this you should have the image extending from frame 1 thru frame 40 with 4 keyframes.  The keyframes will be used to set the end points of the transitions from fading in to fading out.  The keyframes from 10 and and 30 will be the duration of the image being fully visible.
    Right click on frame 1 and select Insert Motion Tween,  repeat the same for frame 30.  These frames mark the fade in and fade out starting points, respectively.  You should see blue frames from 1 thru 10 and from 30 to 40, with arrows across them... ths indicates valid tweens have been created... a dashed line would indicate something ain't right.
    Select frame 1 again and click on the symbol on the stage.  In the properties panel, in the color dropdown list, select "Alpha".  Either drag the slider that appears down to 0%, or enter 0% in the field there.  Repeat this for the frame 40.
    You should now be able to test the movie and see the image fade in, stay for a while, and fade out.
    To add another image that fades in while the first is fading out, add a new layer and insert a keyframe (right click -> insert keyframes) on frame 30 on that new layer.  Then repeat the process above using frame 30 as the first frame (keyframes ending up in frames 30, 40, 60, and 70).
    When you have all the images added into layers following the above directions, advancing further down the timeline for each image, you end up with an image at the end that you'll want to transition into the first image you added.  To do that, go back to that first image's layer and add two frames at the end of the timeline to coincide with the fade out of the last image and add a fade in transition there for the first image.
    Then you want to insert one more layer for some actionscript.  In the very last frame of the timeline of that new layer, insert a new keyframe, and with your actions window open (Window -> Actions) and that keyframe selected, type the following in the actions panel: gotoAndPlay(10);
    Hopefully I've explained it clearly enough.  Here's a link to a web page that might help a little, though the tutorial is tweening something different... position rather than color/alpha.  http://www.entheosweb.com/Flash/motion_tween.asp

  • Help the newbie

    I'm so new to Dreamweaver. I can only create static webpages
    but now I really have to create a page with dynamic contents (like
    get live data from a db), lots of layer manipulation(like layers
    changing sizes, etc) and javascript. Any recommendations on books
    that I should read to learn really fast? Any links?
    Please help. Thanks.

    newbiejane wrote:
    > I'm so new Dreamweaver. I can only create static
    webpages but now I really have
    > to create a page with dynamic contents (like get live
    data from a db), lots of
    > layer manipulation(like layers changing sizes, etc) and
    javascript. Any
    > recommendations on books that I should read to learn
    really fast? Any links?
    >
    > Please help. Thanks.
    >
    >
    >
    If you need to do it soon, the best advice anyone can give
    you is to
    hire someone already proficient in these things (not sure
    what you mean
    by "layer manipulation," though).
    Otherwise, you need to get a book, take a class, or sign up
    for online
    training videos, depending on your learning style, and
    depending on
    what your host supports, and learn PHP, ASP, or CF (there are
    others,
    these seem to be the most commonly mentioned these days). It
    also would
    help to learn some theory about constructing databases
    efficiently.
    I am only a beginner myself, and if I needed something like
    that in a
    hurry I would probably try to hire a PHP person I know from
    this ng
    (Steve Fleischer, Gary White, there are quite a few who
    answer PHP
    questions frequently here) to do it for me.
    In the long run, I have bought and started to study these two
    books:
    Database Design for Mere Mortals (don't remember author
    offhand but you
    can find in any online bookstore) and
    PHP for Dreamweaver 8 by David Powers (who also frequents
    these and
    other newsgroups).
    Still, unless you can devote hours a day to this, it takes
    time to
    learn, and you can mess up a lot more much more quickly using
    dynamic
    pages than you can with a simple html page.
    Another option, depending on your needs, would be to delve
    into an
    existing content management system such as Joomla, Website
    Baker, etc.,
    but from what I've observed with others' experience, these
    can be more
    or less difficult to customize depending on your level of
    expertise and
    the adequacy of the documentation.
    Bonnie in California
    kroko at
    sbcglobal dot net
    http://www.theanimalrescuesite.com/cgi-bin/WebObjects/CTDSites.woa

Maybe you are looking for

  • Netprice Picked up from last document-Open PO load using LSMW BAPI method.

    Hi Experts, I m doing Open PO load using LSMW BAPI method...(BAPI_PO_CREAT1). Inside the LSMW BAPI picks up the NETPR value from the last document and doesnt consider the value from load file... Please advice me how to handle this issue... I tried gi

  • Cannot update Acrobat Pro 9.3.0

    get the following message The patch has failed because the application has been modified since it was originally installed (for example, plug-ins may have been disabled). I went to the Adobe support website and found no solution.  Is this a Snow Leop

  • Inserting between two servers

    HI I am running below command on my local server to insert rows from a remote server.  INSERT INTO tblEvents(...) SELECT ... FROM [ODBC;Driver=SQL Server;SERVER=<ip address>;DATABASE=MyDB;UID=MyUser;PWD=MyPassword].tblEvents AS a WHERE a.[ID] = 11111

  • About save as reduced size pdf

    I noticed that saving as reduced size pdf shrinks a lot my pdf files. What does it do precisely? Is there a way, with Acrobat X or some other software, to do the same to a large collection of files in few steps? Any compatibility problem reading that

  • Woeful state of font management on windows

    anyone out there who has font managment software that autoactivates in indesign at least doesn't make your system slow or unstable even with 5000 fonts. doesn't slow down opening of documents I've now tried font agent pro (no auto activation in cs6),