Simple Action Script question

This is probably a very basic question, but going through all
my old Flash work didn't help me remember...
I have my animation starting on the main stage with an image
fading in. when that is done playing, at the end i want it to go to
a movie clip on the stage and play it from frame 2. what is the
action script for this?

Doesn't seem to be working... your_mc is the instance name of
the mc, correct? i placed this script in a frame - it's above where
my mc first appears and the initial animation on the stage ends. is
that correct?
stop();
tellTarget(mc_square-grid){
gotoAndPlay(2);
When I test the movie, the initial animation plays then
stops, but the MC does not start playing. and the following error
message appears:
Target not found: Target="NaN" Base="_level0"
quote:
Originally posted by:
ActionScripter1
tellTarget(your_mc){
gotoAndPlay(2);

Similar Messages

  • 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

  • Simple Shell Script Question.... [java related]

    Hey guys! This is my first post, as im new here :S
    I have a simple problem for a big program.
    We have a .sh to install it, but when I run the .sh in terminal like i should, It says the class is not found. I believe it has to do with the syntax, as the person who made it is not a linux pro. I don't know MUCH about shell scripts, but I'm pretty sure I know where the error lies.
    Our Script:
    java -classpath ./:./jars/tools.jar:./jars/nexus.jar impsoft.nexus.installer.Install
    chmod a+x run.sh compile.sh
    The Error:
    Exception in thread "main" java.lang.NoClassDefFoundError: impsoft/nexus/installer/Install
    What I think the problem is:
    ./jars/nexus.jar impsoft.nexus.installer.Install
    Thank you for ALL of your help!

    Hi Justin,
    Have you tried running the lines from the command line?
    The second thing you may want to try is changing the relative directory for the jar file from a relative one to a fixed directory. From the error, it appears that the install program is running but it is not able to locate a library mentioned in the program (which is probably the jar file listed in the classpath).
    Hope that helps.
    J. Haynes
    Denver

  • Help Quick!  Action Script Question

    The following code lets me use buttons to switch music. The
    music loops until I switch it.
    How do I make it so that the previous music doesn't stop
    looping. So you can have more then one music going at once.
    That is all...
    // initialize starting track
    var soundNext:String = "beats01";
    // set up dynamic sound object
    var dynamicSound:Sound = new Sound(this);
    dynamicSound.attachSound(soundNext);
    dynamicSound.start(0, 1);
    nowPlaying.text = soundNext;
    beats01.onRelease =
    beats02.onRelease=beats03.onRelease=beats04.onRelease=beats05.onRelease=beats06.onRelease =beats07.onRelease=beats08.onRelease=function
    soundNext = this._name;
    nextTrack.text = soundNext;
    // NEXT SOUND
    dynamicSound.onSoundComplete = function() {
    dynamicSound.attachSound(soundNext);
    dynamicSound.start(0, 1);
    nowPlaying.text = soundNext;
    stop();

    Hi Dan,
    Welcome to Apple Discussions and the AppleWorks forum.
    Are you sure you're asking a database question? From your terminology (rows, columns) and your description, it seems more like you're using a spreadsheet.
    If this is a database, you will have two Number type fields, 'A' and 'B'. To show the product, define a Calculation type field, 'C', using either of the two formulas below:
    'A'*'B'
    or
    PRODUCT('A','B')
    To define the new field:
    Open the database document.
    Go Layout > Define fields
    In the Define fields dialogue that opens, you'll see a list of your current fields, including 'A' and 'B'
         -if 'A' and 'B' are not identified as "number" fields, click to select each in turn, change the Type to Number and click Modify.
          OK the warning (your data in these fields is all numbers, and will be retained).
    Type "C" (without the capitals) in the Field Name box, set the Field Type to Calculation, then click Create.
    Enter either of the formulas above into the Formula box, then click OK, then Done.
    If your document is actually a spreadsheet, with the numbers in columns A and B:
    Enter either of these formulas into cell C1:
    =PRODUCT(A1,B1)
    or
    =A1*B1
    Press Enter.
    Select the cells C1..Cn (where n is the last row in which you want to calculate the product of the numbers in columns A and B).
    Press command-D to fill the formula down the cells in column C
    Regards,
    Barry

  • [SOLVED] Simple Shell Scripting Question - Echo and Execute?

    I've got a bash script which has many different commands it executes in a row. Each time the script executes one of the commands, it outputs what it is doing to the screen:
    echo "cp -r home new"
    cp -r home new
    echo "mv testfile new/."
    mv testfile new/.
    I am just wondering if there is a function to execute a command and output it at the same time. Something like...
    echoandexecute("cp -r home new")
    echoandexecute("mv testfile new/.")
    Last edited by tony5429 (2008-08-27 19:59:04)

    Otherwise you can define it yourself:
    echoandexecute() {
    echo $1
    $1
    echoandexecute "cp -r home new"
    Last edited by catwell (2008-08-27 20:57:16)

  • How do I use the button states in an action script?

    In my Captivate 8 project I use smart shape as buttons. The buttons have different images presented dependent on the state of the button. I have also created a simple action script that shows what happens when the button is pressed. When the button has been pressed the normal state of the button appear. I, however, want the down state of the button to remain visible util the user presses another button. How do I accomplish this? Is there variables for the buttons different state or how can I create that?
    BR,
    Madeleine

    When you talk about 'actionscript' do you mean advanced or shared actions? You cannot write actionscript within Captivate, only Javascript. If you use advanced/shared actions they'll be converted on runtime to either Actionscript (for SWF output) or Javascript (for HTML5 output).
    The states in shape buttons are the normal way buttons behave (not only in Flash). If you are indeed using shared/advanced actions, and you want the down state to remain until the next shape button is clicked, you'll have to go the way described by iFlashAppsToo. Create shapes that have the look of the down state, make them initially invisible and group all those shapes on one slide. Add two statements to the shared/advanced action (please do use shared actions, you'll save time):
    Hide Group   so that eventual down mimicked states on previously clicked buttons disappear
    Show Im_Downx    to show the down image for that button

  • Problem with action script calculations

    I have a simple action script 3 code that will not calculate the correct answer on my PC.  I'm running flash cs5 on Window 7 OS.  I can move the file to another machine running  flash cs4 and it works, but when I run it on my laptop, I get funky answers.  see cold below.  I have uninstalled and reinstalled cs5 , run the cleanscript for cs5 and cs4 to make sure everything was removed.  I have uninstalled and reinstalled flash player.  but nothing seems to work.  Any help will be appreciated.  It acts like Action Script 3 is corrupt or something else that related to Action Script 3.  Everything else seems to work.  I also have a preloader running with the same issue.  It is should be showing the percentage completed but it go 2 5 50 4 32 or something funky like that.  Please help.
    the code I'm using.
    function calculateTotal(evtObject:MouseEvent):void {
       var price:Number;
       var totalCost:Number;
       var numberOfJerseys:Number;
       if (jerseyType.text == "2") {
        price = 12;
          if (jerseyType.text == "1") {
        price = 10;
       if (playerNames.text == "Y" || playerNames.text == "y") {
        price += 1.50;
       numberOfJerseys = int(numberOfPlayers.text) +int(numberOfCoaches.text);
       totalCost = numberOfJerseys*price;
       total.text = String(totalCost);
    calc_btn.addEventListener(MouseEvent.CLICK, calculateTotal);     
    the preloader percentage is
    var percent:int = amtLoaded*100
    percent_txt.text = String(percent);

    HELLO,
                  just check       navigateToURL()

  • Transfer Action Script/Flash animation to DVD question

    I have created a countdown clock using ActionScript/Flash that counts down to a specific date when the .swf runs.
    My client has asked  if we can take  the Flash/Action Script clock and transfer it to a traditional DVD and have it work the same as if it were still flash on the desktop.
    Is this possible?

    No serverside script needed.
    If it helps (and you have the patience) here is the code:
    //onEnterFrame allows for a function to be called every tick this.onEnterFrame = function() { //Stores the current date var today:Date = new Date(); //Stores the Current Year var currentYear = today.getFullYear(); //Stores the Current Time var currentTime = today.getTime(); //Creates and stores the target date var targetDate:Date = new Date(currentYear,10,13); var targetTime = targetDate.getTime(); //Determines how much time is left.  Note: Leaves time in milliseconds var timeLeft = targetTime - currentTime; var sec = Math.floor(timeLeft/1000); var min = Math.floor(sec/60); var hours = Math.floor(min/60); var days = Math.floor(hours/24); //Takes results of var remaining value.  Also converts "sec" into a string sec = String(sec % 60); //Once a string, you can check the values length and see whether it has been reduced below 2. //If so, add a "0" for visual purposes. if(sec.length < 2){ sec = "0" + sec; } min = String(min % 60); if(min.length < 2){ min = "0" + min; } hours = String(hours % 24); if(hours.length < 2){ hours = "0" + hours; } days = String(days);  if(timeLeft > 0 ){ //Joins all values into one string value var counter:String = days + ":" + hours + ":" + min + ":" + sec; time_txt.text = counter; }else{ trace("TIME'S UP"); var newTime:String = "00:00:00:00"; time_txt.text = newTime; delete (this.onEnterFrame); } }
    It works by syncing the clock animation to the clock/time on the local computer and then beginning a countdown.
    Not sure why the clients want to have it work on a DVD but I am tasked with finding out if it's possible.
    Many thanks

  • Adding data to cfgrid using action script

    how can i add data to a grid row called name in action
    script. i have a cfselect control containing name of students and i
    want to add the values of the selected student from the list to
    grid.

    Did you add your instance of SpectrumCanvas to the stage with addChild()?
    If so, you should boil your posted code to a more simple example.
    If this post answered your question or helped, please mark it as such.

  • New to action script 3 and am really confused

    Hello and thank you in advance for helping if you can. I have a website banner that I made in flash. Everything works great and the last thing I need to do is add some script to it. One code is simple the stop action. So I added a new layer, called it actions and then clicked on the last frame inserted a blank keyframe and then opened the action window and typed in stop(); It worked great the banner cycled through once then stopped.
    Now here comes the part that has me stumped. I need to make this banner link to an external website. so this is what I did. On the actions layer I clicked the first frame and opened the actions window, Oh first I have a block of text converted to symbol (movie clip) and named the instance click_mc, then in the actions script window this is what I typed
    var link:URLRequest = new URLRequest("http://www.mojaveampworks.com/dirtyboy/DirtyBoy/Dirty_Boy.html");
    click_mc.addEventListener(MouseEvent.CLICK, onClick);
    function onClick(event:MouseEvent):void
    navigateToURL(link);
    click_mc.buttonMode = true;
    Now when I run the movie it doesn't run at all. Any help with this would be greatly appreciated as I'm ready to through this whole project out the window. Sorry if this question is redundant but I am new with action script.
    thanks

    Hi Ned and thank you for responding.
    I am not getting a compiler error but in the output I am getting this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at dirtyboybnr2_fla::MainTimeline/frame1()

  • Can FC put action script in a 'code behind'.

    Once of the practices I do in FB3 is to move all my action script into 'code behind' files instead of having all the code in the mxml files.  Does FC have the option to do that (as part of the gen process) and if not, does anyone else who 'codes' instead of 'designs' feel that is a benefit?  I know I'd prefer it to be in a 'separate' as3 file.  Also, if I DO move the code into code behinds (I've not tried it yet), does FC have any issues reading the code behind?  I'll be trying that on a 'simple' project to be sure but figured I'd ask just in case anyone else wants to know...

    The two references cited helped answer questions about Adobe's overall philosophy and approach that came up as I worked a simple example down the design/development stack of tools from Illustrator (AI) to Catalyst (FC) to Flash Builder 4 (FB).
    Other questions that arose were:
    Each application (AI, FC, FB) contains tools for design with some degree of overlap.
    Will FC eventually include from AI (or Photoshop, InDesign, etc.) and the FB design view all functionality needed for interactive storyboarding and skin generation?
    Is it the intent for FC to become the designer's tool and FB the developer's tool, at least for application design?
    The diagram in the Gumbo skinning spec shows that base components and their subclasses are typically implemented in AS and skins in MXML and recommends this as the preferred design pattern. Yet when I converted one of my groups (essentially a form) to a customized component, and exported the project into FB, I noticed that FC had generated a single mxml file (CustomComponent1 ...) and not a pair of files (an X.as file for the base component and an X.mxml file for the skins).
    For several reasons, wouldn't you want to generate separate files as depicted in the Gumbo diagram as a starting point for code customization?
    How does one develop custom components in FB (or using AI+FC+FB) and package them as a library so that they can be dropped into FC and used in the way that the current set of 5 components (button, hscrollbar, vscrollbar, text input and data list) are used?
    How will I integrate my hand-coded dynamic components for data visualization alongside more generic and static app components on an RIA page?
    How would I use AI+FC to design liquid layouts where children at each level often utilize constraints (i.e. top, bottom, left, right) between parent and child?
    For agile methodologies, how will refactoring the interaction or software design work in this new world where interaction designers are trying to maintain full control over appearance and interactive behavior?
    Finally, I would like to know what tools and steps Ely used to develop the component shown in the video. It would be instructive to turn that into a tutorial that we could walk through, step by step, in slow motion
    While I understand the arguments for separation of design and development as a workflow methodology, those of us with development and HCI/visualization backgrounds building research prototypes would like to see integration of the design and development tools (from the perspective of the workflow, not the architecture and code).
    As Jordan said, the direction you are heading is inspiring. Keep up the good work.

  • Email Action Script

    Simple question, is there a way to add an email link with
    Action Script? Sorry if this is basic, but it is all I need to
    know.

    quote:
    Originally posted by:
    mailingitin
    Simple question, is there a way to add an email link with
    Action Script? Sorry if this is basic, but it is all I need to
    know.

  • Simple button script not working

    I am using AS2 and need help figuring out why this simple button script is not working:
    stop();
    buttonWS1.onRelease = function(){
                        gotoAndStop("Stage1and2_Boss",4);
    buttonWS2.onRelease = function(){
                        nextFrame();
    //end
    My buttons are the square letter-puzzles below. They are images that I converted to "symbols" (specifically, buttons). I put their names as above (buttonWS1, buttonWS2, etc.) in the "instance names" boxes.
    I have no idea what is going on. Please help!

    Hi -
    1. Yes, buttonWS2 is the instance name
    2. The only code attached to it is the code I pasted above.
    3. onRelease does not execute because my trace statement does not appear in the output
    Here is the modified code for buttonWS2:
    buttonWS2.onRelease = function(){
                        trace("clicked!");
                        nextFrame();
    Question: It shouldn't matter if I have commented-out code within that set of codes should it?:
    buttonWS2.onRelease = function(){
              //if (puzzleschosenarray[0] == 2 || puzzleschosenarray[1] == 2) {
              // cannot be chosen -- make button non-functional
              //else{
                        //puzzleschosenarray[roundnumber-1] = 2;
                        trace("clicked!");
                        nextFrame();

  • Simple button scripts not working in AS2

    Hi there,
    I am at my wits end. I've tried about 2 dozen tutorials word for word and they don't work and I just keep getting lots of strange errors.
    I have a very simple 4 frame scent with a forward and backward arrow on each frame to link them together. I have an artwork layer, a button layer and an action script layer. The action script layer contains stop(); and the following script in the buttons layer. I adjusted the gotoAndStop frame number accordingly for each frame. Below is an example of one frame. I ran them from frame 5 to 9 as the stop feature wouldn't work on the first keyframe.
    leftButton.onRelease=function(){
    trace("gotoAndStop(9)");
    rightButton.onRelease=function(){
    trace("gotoAndStop(6)");
    When I test the movie (publish it) the buttons don't work at all. I've tried many times to no avail. It just remains frozen on frame 5 and the arrows do nothing.
    Here is a screen shot of my file.
    http://marthalodge.com/Picture2.png
    Thanks for any help.

    Regarding the numbers, I was referring to instance/variable names, not frame labels.
    As far as errors go, the following is errant in that it is missing a closing parenthesis, but it also doesn't make much sense.  What are you expecting it to trace?
    trace(gotoAndStop("eight");

  • (Click and move to next scene).  Need help with a simple action, just need a little guidance.

    I am building a simple flash movie clip in Flash cs4. All I want to do is run the play head through a one 5 frame scene and stop, and then you press a button that will send the play head to the next 10 frame motion tween scene.
    When I run the movie all I get is a movie clip that pauses for a millisecond then loops back around.
    I have three different books on flash action script, read all three still not doing so hot. I am using the navigational button concept maybe that is what I am doing wrong. Can someone show me the right method or lead me in the right direction.
    farosgfx ( [email protected] )

    You can just place an invisible button on the top layer of
    the flash time line and code it to getURL. When you said "hyperlink
    to another page", are you referring to an html page or another swf
    file? To make an invisible button in Flash, you can hit Ctrl+F8 to
    bring up the dialog box to create a new symbol, name your button,
    make sure you select the type of button, hit ok, now you are inside
    the button and need to create a "hit" area. Click on the "hit"
    state and press F7 to create a blank key frame. Using the drawing
    tools, select the square, no stroke, and any fill color you want,
    draw a square shape, click on the shape and in your Info Panel,
    change the size of this shape to match the size of your stage,
    lastly, make sure the registration point is (0,0) by using the
    Align Panel. Go back to your main time line, add a layer on your
    time line and make sure it's at the top, drag your new button from
    the library to the stage and align it to (0,0).
    There are two ways to code the button, so to make it easier,
    click on the button once to select it, hit F9 to bring up the
    actions panel and type this
    on(release){
    getURL("
    http://www.someWebsite.com",
    "_blank");// you can also use "_self" //
    If some of this isn't new to you, disregard parts of it. If
    you have any buttons in your Flash application, this will cause
    problems because the invisible button will counter-act anything
    below it. Let me know if this works for you. Of course, this all
    assumes you have access to the flash file.

Maybe you are looking for

  • Adobe Illustrator CC Typical System Requirement

    Hello everyone, I'm looking for a new computer for better working experience. I have difficulty to run AI CC on my current computer. It keep not responding all the time which cause me unable to do my work smoothly. It can't even save a file with size

  • Tiger vs DeLocalizer

    Hello, I would like to pass on my experience with Tiger and Delocalizer. I am not an expert in either, only a user of both. Details as follows: 28May06 Launch Tiger DVD Run Disk Utility from the DVD Verify/Repair Permission. Repair Disk Several discr

  • How to write a function block?

    Hi There, Does anybody know how to write a function block with LabVIEW?  Something like those in Real-Time VIs>>Function Blocks>>. Thank you very much in advance? Solved! Go to Solution.

  • V_V2 (Reescheduling)

    Hi gurus, We have a trouble with a particular situation in sales order. This is the situation: In Stock 10 qty Sales Order 1 10 qty Delivery date 31.12.2008 Purchase Order 50 qty Delivery date 01.06.2008 Sales Order 2 1 qty Delivery date 18.04.2008 S

  • SCC u2013 Sub contracting with Chargeable components

    we need to use SCC u2013 Sub contracting with Chargeable components. For that, Activated u2018SCCu2019 at Client level and Valuation area level. Any further config process required to use this process? I did not find any difference in postings betwee