How do I Action Script buttons, so the objects lay on the prior object clicked on, in Flash?

Here's my idea but having problems with the actions scripting:
Accessories and build your car application in Flash.
I'm new to the Action Script 3 and I am trying to Action Script my custom graphics for a “build your own car”. Something similar to the Harley Davidson motorcycle builder https://www.harley-davidson.com/en_US/Content/Pages/H-D1/Bike-Builder.html#/locale__en_US/ model__FLD/year__2013
I have all the graphics (multiple photos, photoshopped and cut out for the different car body colors. I'm doing the same with the car rim choices, etc) All the graphics are sized so they will lay on top of one another seamlessly but I don't know how to Action Script 3 the buttons so you can click on (ex: rim1, or rim2 , etc and see how it looks on car by pulling up the photo on top of the existing background car photo) .
How would I Action Scrip my "color button" to come up with 10 color swatches I’ve designed and then when you click on the color swatch (ex: red). It will then put the graphic red of the car body that I have already made on top of the existing background photo of the car and so on for each color button?
Thanks for the help in advance!

I'm not sure if I do know how to correctly create the Wheels classes and use action scripting. Are the classes you're referring to the parts I labeled btn1, btn2 below? Here's what I have under the main Timeline labeled actions:
stop() ;
// Color button code //
colorbtn.addEventListener(MouseEvent.CLICK, btn1);
function btn1 (event:MouseEvent) :void{
    gotoAndStop (2);
// Rims button code //
rimsbtn.addEventListener(MouseEvent.CLICK, btn2);
function btn2 (event:MouseEvent) :void{
    gotoAndStop (3);
//rim1 button code //
rim1.addEventListener(MouseEvent.CLICK, btn3);
function btn3 (event:MouseEvent) :void{
    gotoAndStop (4);
I'm not sure how to fit your code in that you said in your first comment. The //rim1 button code // doesn't currently work.
I think if I had a sequence of the action script 3 with a button/movie clip layed out for me, I could organize accordingly for my buttons and movie clips. Since they would work the same just would have to have different labels.

Similar Messages

  • How do I create a button in a selction screen of the report ??

    how do I create a button in a selction screen of the report ??

    See sample Program :
    REPORT ZLPRWINSPC_TMP .
    tables : mara,
             sscrfields.
    select-options s_matnr for mara-matnr.
    initialization.
    sscrfields-functxt_01 = 'Clear Selection'.
    selection-screen function key 1.
    AT SELECTION-SCREEN.
    case sscrfields-ucomm.
    when 'Clear Selection' or 'FC01'.
    clear s_matnr.
    refresh s_matnr.
    endcase.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Action Script Buttons Heirarchy Help

    This is my first post and im hoping someone out there will be able to help I am a developer in JS and ASP but never learnt actionscript and am completely stuck.
    Basically I am using the sliding code from a tutorial i found online, what i want to do is have buttons inside the Content 1, content 2 etc which are basically the pages which are then put into a holder then added to the main scene called CONTENT.SWF, I also have an index.swf which uses a swf loader to bring the CONTENT.swf in, confused yet i am......
    The buttons work if i add them to the main scene in Content.swf but not in each of the content1, content2 etc. So i am sure its to do with hierarchy of buttons layers going down or something.
    var currentPosition:Number = contentHold.content1._x;
    var startFlag:Boolean = false;
    menuSlide = function (input:MovieClip) {
                    if (startFlag == false) {
                                    startFlag = true;
                                    var finalDestination:Number = input._x;
                                    var distanceMoved:Number = 0;
                                    var distanceToMove:Number = Math.abs(finalDestination-currentPosition);
                                    var finalSpeed:Number = .3;
                                    var currentSpeed:Number = 0;
                                    var dir:Number = 1;
                                    if (currentPosition<=finalDestination) {
                                                    dir = -1;
                                    } else if (currentPosition>finalDestination) {
                                                    dir = 1;
                                    this.onEnterFrame = function() {
                                                    currentSpeed = Math.round((distanceToMove-distanceMoved+1)*finalSpeed);
                                                    distanceMoved += currentSpeed;
                                                    contentHold._x += dir*currentSpeed;
                                                    if (Math.abs(distanceMoved-distanceToMove)<=1) {
                                                                    contentHold._x = maskMovie._x-currentPosition+dir*distanceToMove;
                                                                    currentPosition = input._x;
                                                                    startFlag = false;
                                                                    delete this.onEnterFrame;
    nav.b1.onRelease = function() {
                    menuSlide(contentHold.content1);
    nav.b2.onRelease = function() {
                    menuSlide(contentHold.content2);
    nav.b3.onRelease = function() {
                    menuSlide(contentHold.content3);
    nav.b4.onRelease = function() {
                    menuSlide(contentHold.content4);
    nav.b5.onRelease = function() {
                    menuSlide(contentHold.content5);
    nav.b6.onRelease = function() {
                    menuSlide(contentHold.content3);

    Thanks, but that didnt work for me I did manage to get one button working from within the content1 movieclip  by using the script below.
    on(release){
    this._parent._parent._parent.container.loadMovie("video.swf");
    Just trying to get the code i posted in my first message to work with a button in content 1. I have tried amending the code on the root page from:
    nav.b1.onRelease = function() {
        menuSlide(contentHold.content2);
    TO
    this._parent._parent._parent.nav.b1.onRelease = function() {
        menuSlide(contentHold.content2);
    STILL NO LUCK the button instance is b1 , I have even tried adding the script directly to a button.....its driving me crazy...thanks for all your help so far..
    on(release){
    this._parent._parent._parent.contentHold.content2.b1.menuSlide(this._parent);

  • How do you make multiple buttons link to specific paragraphs within the destination page?

    Hi
    The best way i can describe this is I want to link four buttons on my homepage to a page named 'services'. Each button refers to a different section on the 'services' page.
    So what I want to happen is when I link each button, i want the user to be able to click on one and then be transferred to the 'services' page, but halfway down the page at the relevant paragraph or wherever the relevant section is.
    How do you do this people?
    Thanks for your time
    J

    Take a look at this tutorial and see if it helps

  • How do I add a button for a custom task on the List Accounts page in 5.5

    I'm trying to add a button to the bottom of the List Accounts page that launches a custom task. I thought this would be easy - just modify UserActionsConfig. I've already added the task to context menus. The problem is there are only options to add buttons for the Find User results page and the context menus. Is there a missing attribute key that needs to be included? Is there a different config file that I need to modify? Any help would be appreciated.

    Sorry not possible in 5.x. You will have to use 6.0 and the new HTML based tree browser.
    WilfredS

  • How to stop my Preview button from auto putting files to the server?

    Hi, I just had a tech guy to my house helping me with dreamweaver and when he left my program is working differently.  It did not automatically put files when I previewed them.  Now I can't preview anything without it putting the file to the server.  I created a contact form as a php file.  Could that have anything to do with this change?  I appreciate your assistance!

    Hi, I actually had to turn off the test button to the server to stop it.  In preferences nothing was changed.  I have checked "prompt on put" and "prompt on get".
    It only stops putting my files while I have the testing unchecked.  Thanks for your reply.  I really appreciate it.

  • Difference in using the same component made in mxml or action-script

    Hi,
    I made a sample project to show a kind of bug in the SuperTabNavigator component of FlexLib
    In this sample you can see that using the same component (made in both mxml or action-script) can make a difference
    I'm just wondering why ?
    Thanks
    Here is what i've posted :
    What steps will reproduce the problem?
    1. Create a button to dynamically add new tab with icon on a SuperTabNavigator
    2. Click on this button to add new tabs
    What is the expected output?
    - The expected output is tabs added without abnormal behavior
    What do you see instead?
    - Every time a new tab is created the one who had the focus has its content
    (icon + label) moving from the top-left of the tab to its original position
    Please provide any additional information below.
    Configuration:
    - Flex Builder 3 in Eclipse
    - FlexLib 2.3
    Sample:
    (see attached file)
    There is two type of tab, one in action-script and one in mxml
    They both are equal
    - Adding a new action-script tab to SuperTabNavigator works fine
    - Adding the same tab but an mxml one doesn't
    - Adding a new action-script or mxml tab to TabNavigator works fine
    -> meanings that the issue comes with SuperTabNavigator
    - Adding a new mxml tab to both SuperTabNavigator and TabNavigator at the
    same time makes TabNavigator to get the same bad behavior
    Remarks:
    - Tried everything but i'm really stuck
    - Weirdly, removing the PopUpButton correct the issue
    - In the same way if you keep adding action-script tab it automatically scroll to the
    last tab. And if you do the same with mxml tab then it add the tab at the end and
    scroll to the first one.
    => what could be the difference between using action-script or mxml object ?

    Here is one possible solution:
    You can use the ExternalInterface (
    http://livedocs.macromedia.com/flex/2/langref/flash/external/ExternalInterface.html)
    class to communicate with JavaScript. JavaScript can then popup the
    media player very easily like this:
    http://www.webreference.com/programming/javascript/jf/column5/index.html
    The documentation on the ExternalInterface class has a nice
    example (in the bottom of the page) on how to communicate with
    JavaScript in a browser. Hope this helps,
    -george

  • How to use default cftree icons in action script?

    How do you reference the default cftree node icons from an
    action script? I found this information in the flex documentation
    but I can't figure out how to reference the icons from my
    <cfformitem type="script">. Is this possible?
    http://www.flex2doc.com/projects/framework/asdoc/mx/controls/Tree.html
    defaultLeafIcon="TreeNodeIcon in assets.swf"
    disclosureOpenIcon="TreeDisclosureOpen in assets.swf"
    folderClosedIcon="TreeFolderClosed in assets.swf"
    folderOpenIcon="TreeFolderOpen in assets.swf"

    CROSS-POSTED to: ColdFusion and Flash Integration

  • FLASH MX 2004 action script question

    Hi!
    I need to create an script for a basic function; when mouse goes over a moveclip, that works also link, I want it to trigger an invisible red dot on a nerby map. I have created a movieclip and named it "red", it's a 1 sec clip with nothing in the beginning and a red dot in the end. I want this dot to trigger and show only when mouse goes over this specific link, otherwise it must be invisible.
    I know this is pretty basic stuff and I have done this before few years back but I have forgotten how to do it and need help now.
    Any help would be very much appreciated :-)
    Kim

    I still need help, this problem is little more complicated;
    I can manage making the red dot visible and invisible by triggering roll over and roll out on a button.
    The problem is, I have a navbar which is line of flags made to a movie clip, with 5 invisible buttons. These buttons are configured to do three different actions; get URL, trigger a light effect and a movement effect.
    Now I need this invisible button to trigger my red dot also so that when mouse is over a certain flag a red dot appears on a map on the correct location.
    I have the red dot on a new layer. It has instance name "redDot" and on the very first frame of this red button layer, I have action script that says: redDot._visible = false;
    This works as it should and the dot is invisible when the movie has loaded.
    I need to make this invisible button to trigger the visibility of my red dot, and I have tried to add the code:
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    to this invisible button, but it dosent work, furthermore it affects the other functions of the button/movie clip, which were working fine before.
    Here is the code attached to this invisible button so far:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    I have the URL:s on an external text file.
    So my question is; where do I add the action script to make it visible when moving the mouse over this invisible button? To my understanding, it should go in the same place as the other code that is working, but I'm doing something wrong...
    I tried to do this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2)
            redDot._visible = true;
    on (rollOut) {
    gotoAndPlay("sec")
    redDot._visible = false;
    But it is wrong, I also tried like this:
    on (release) {
    getURL(/:url1);
    on (rollOver) {
    gotoAndPlay(2);
    on (rollOut) {
    gotoAndPlay("sec");
    on (rollOver) {
    redDot._visible = true;
    on (rollOut) {
    redDot._visible = false;
    But it makes the other functions that worked to stop working.
    I also tried to give the invisible button an instance name and do it like this:
    invisible.on (rollOver) {
            redDot._visible = true;
    invisible.on (rollOut) {
    redDot._visible = false;
    And put them in the actions layer of button movie clip but nothing works.
    Flash is really giving me a headache now...
    To conclude, I made a simple test button, put it on the scene somewhere and and attached the rollOver and rollOut codes, targeting the "redDot" and it works fine, the button didn't need a instance name to work. I don't understand why I can't make it to work with the invisible button where it should be.
    I hope this clarifies the point and I can get some help with this and sorry for bothering again with this problem.
    Oh and I use old Flash MX 2004.
    Thanks
    Kim

  • Action Script Import

    Hey Guys I love the idea and I know it is a daunting task to convert .fla into html5. I am working on removing any action script in any of my .fla files so that, 1: they may convert, but in doing so I realized that It may be possible to create a seperate stand alone action script...place it in the server, and the import said script into html5 the similar way you would when calling an image href, but the problem is... How if at all would I be able to import script into html5, and/or java for each individual scene related to a large .fla? My thoughts are I would need to create a new individual (Java class's) related to each individual action script scene and then import those into the html5 code! I am on track with the thought, or am I just crazy...
    In order to accheive this I would need to import the action script standalone into the root folder any recommendations?
    For example: stop(); frame 10 scene 1 layer Bck_Ground
    Then file name would be: layer 1 Bck_Ground.AS
    Java class  1Bckground. js
    .requires(
    bck_ground.as
    This only as an eample of thought not real code!
    and or the ssame ideal in HTML5?
    Could this work?
    Thanks James

    Then no offense to Adobe, but this to me is an intermediate way of creating an animated gif...Granted if I wanted to create a animated gif from.swf I have to go through several steps, but at least I don't get the annoyance of ".fla not supported"! My input to Adobe in your Wallaby creation is this...Please consider the creation of a re-write enging for pre-existing action script that will interpelate the data of each scene, and layer directly from the .fla, and then import it into several native languages that the user can select such as java, html5, possibly C, xml, and be compatible for Mobile Web, IOS, SDK, and Stand-Alone Java!, and export all media assets into a seperate file folder with the a fore mentioned extensions placed and housed with coresponding media...After-all none of us Flash Heads really want to re-write code the hours of code we spent developing for a product that can't or won't be seen by mobile applicatioins. If you can do that I would pay my top dollar for it...and I would think everybody else would agree with me! Thanks for your hard work...keep plugging along!
    James

  • Exporting action script in 2nd frame

    I have a preloader in frame one so I export frame for classes
    in frame two in the publishing settings. I have a scrolling
    component in the .fla and when I set up the linkage for the
    scrollable movie clip, it exports into the 1st frame. How do I tell
    Flash to export action script for component in 2nd frame? Because
    of the conflict with the publishing settings set at frame 2, the
    scroll bar won't work unless I publish export action script into
    frame one.
    Please help,
    Darryl

    Thank you for replying. I was instructed that it is better to
    have the action script load in the second frame if my preloader is
    in the first frame in order for the page to cache faster on the
    users PC. So in the Publish Settings, in the Flash Tab under
    Settings, I was informed to "export frame for classes in "2".
    The action script for the compenent in the Library only gives
    me the choice of it exporting in frame 1. And because they do not
    correspond, the scroll bar will not appear unless I change the
    Publish settings to export in frame 1 and I will get this error
    message Error opening URL
    "file:///D|/Flash%20Studio%208/nams/scroll".
    My goal was to increase the download speed of the Flash page.
    Is there a way to get the compenent Action script to export in
    Frame 2? The only option box through the Library Linkage is Frame
    1.
    Thank you again for responding,
    Darryl

  • CS4 Action Script display problems

    I've just used Flash CS4 for the first time after using CS3 for some time.  When using the Action Script window to write code I had the strangest problem.  When writing or pasting code in the AS window the last couple of letters or characters get cut off.  I checked my preferences and they were they same as they were in CS3 (just to be sure).  Both CS3 & CS4 both have the Monaco font as the default.  I solved the problem by changing the fint to Arial.  Now the AS displays properly.
    Wondered if anyone has seen this happen and if they knew if it was a bug or something?
    I'm using CS4 with a newer MacBook Pro and sing AS2 in this project.
    Thanks so much!
    BC

    first button is called Enter and it is btn1 in the libary, i would like that to navigate to scene 2 frame 1. this was a graphics and i converted it to a button have also tried making it a movie clip it still doesn't work. the second button is Autobiogtaphy and it is btn2, i would like that to be navigated to the frame 10 and the frame is called About. I have CS4 and i realised all the stop actions worked when i saved it in CS3 and opedned it back up so since then  i have been using that format. im also using AS3 if that makes any difference.
    So i realised i haven't been much help on details hope this helps

  • Action Script Master Required

    Can someone please help with this action script below.
    I have a flash banner similar to the one on this website
    www.grisoft.com except my script is setup to rollover the button
    and automatically go to the url. I would like to roll over the
    buttton, change the photo and then click to get url. I have attched
    the action script below, also where do I put the url information?
    If anyone can help, it would be greatly appreciated!
    THE ACTION SCRIPT IS BELOW
    function setSub(state)
    for (i = 0; i <= _global.menuCnt; i++)
    _root["sub" + state]["btn" + i].ii = i;
    _root["sub" + state]["btn" + i].onRelease = function ()
    getURL(_root["subURL" + state][this.ii - 1], "_self");
    } // end of for
    } // End of the function
    function control(num)
    if (num != 1)
    _root.subBar.gotoAndPlay(2);
    else
    _root.subBar.gotoAndStop(1);
    } // end if
    _root.createEmptyMovieClip("enter", 1);
    _root.enter.onEnterFrame = function ()
    _root.select._x = _root.select._x + speed * (_root["mainBtn"
    + num]._x - _root.select._x);
    _root.photo._x = _root.photo._x + speed * ((num - 1) * -800
    - _root.photo._x);
    _root.copyphoto._x = _root.copyphoto._x + speed * ((num - 1)
    * 800 - _root.copyphoto._x);
    TX = (num - 1) * -800;
    if (Math.round(_root.photo._x) <= TX &&
    Math.round(_root.photo._x) >= TX)
    subView(num);
    delete _root.enter["onEnterFrame"];
    } // end if
    } // End of the function
    function ini()
    var i = 1;
    while (i <= _global.menuCnt)
    _root["sub" + i]._visible = false;
    i++;
    } // end while
    } // End of the function
    function subView(num)
    _root["sub" + (num - 1)]._visible = true;
    } // End of the function
    function imgSort()
    num = 0;
    var i = 1;
    while (i <= _global.menuCnt)
    _root.photo["photo" + i]._x = num * _root.photo["photo" +
    i]._width;
    _root.copyphoto["photo" + i]._x = num * -1 *
    _root.copyphoto["photo" + i]._width;
    num++;
    i++;
    } // end while
    } // End of the function
    mainURL = new Array("", "", "", "", "");
    subURL1 = new Array("88.html", "88.html", "88.html",
    "88.html");
    subURL2 = new Array("88.html", "88.html", "88.html",
    "88.html");
    subURL3 = new Array("88.html", "88.html", "88.html",
    "88.html");
    subURL4 = new Array("88.html", "88.html", "88.html",
    "88.html");
    _global.menuCnt = 5;
    for (i = 1; i <= _global.menuCnt; i++)
    _root["mainBtn" + i].ii = i;
    _root["mainBtn" + i].onRelease = function ()
    control(this.ii);
    ini();
    setSub(this.ii);
    getURL(mainURL[this.ii - 1], "_self");
    } // end of for
    _root.onLoad = function ()
    ini();
    imgSort();
    speed = 0.300000;
    setSub(1);
    setSub(2);
    setSub(3);
    setSub(4);

    You could use Flash vars to pass in a URL, so you can specify what the URL should be for any particular page.
    //SET A FLASH VAR ON THE HTML PAGE
    <PARAM NAME=url VALUE="http://lakelawnmetairie.com/plan_ahead/preplanning.html">
    <EMBED src="your.swf" FlashVars="url=http://lakelawnmetairie.com/plan_ahead/preplanning.html"></EMBED>
    //SET A VARIABLE FOR THE FLASH VAR INSIDE OF FLASH
    linkURL = root.loaderInfo.parameters['url'];
    //TARGET THE SET 'LINKURL' VARIABLE AND SEND USER TO THE LINK
    whyPlanAhead_btn.addEventListener(MouseEvent.CLICK, whyPlanAhead);
    function whyPlanAhead(e:MouseEvent):void{
        navigateToURL(new URLRequest(linkURL),"_self");

  • Future in Action Script

    HI,
    I am new to the Action Script. I want to know about the career growth and future in the acion script.
    Thanks in advance
    Regards,
    MallapZ

    This helps. Getting there as a matter of fact. Thank you.
    I seem to still need a stop in frame 1 of the movie and I
    need to have the function read as follows to make things work:
    function over () {
    this.overThis = true;
    this.gotoAndPlay ("start");
    I thought I could remove the gotoAndPlay statement and the
    Stop() at the head of the movie, but I couldn't .
    The only problems remaining are that if you roll back over
    the button before the movie ends you jump to the loop section.
    I'd also like to be able to switch layers so the last button
    rolled over would always be on the top.
    Here's
    a link to my test project. I'm using buttons instead of rolling
    over the movie. You'll also find a link on the page to the .fla
    file.
    Thanks again for the help. I hope to get this completed
    tomorrow.

  • TLF on action script 2 ?

    Hi,
    I designed an animation with action script 2 in years ago. now how can I use TLF text in that animation without converting it to action script 3?
    if can't, how can I convert action script 2 to 3 easily?
    Best Regards.

    Seems you can not use TLF in action script 2 as TLF is an action script 3 library...
    We are not the experts about how to convert action script 2 to 3 but we'll post this question to our internal forums. If there is anyone answers this question. I'll let you know.

Maybe you are looking for