Array Question: Action Script

All I am trying to do is start 4 movie clips one after
another using an array to store the clips instance names and then a
loop to trigger each clip to play.
The code below isn't working. Check it out:

You setting the instance names as strings, take the quotes
off.

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 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);

  • 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

  • Advanced Data Grid in Action Script

    ok so I am now generating an AdvancedDataGrid in Action script as I will have dynamically created columns based on specific user
    My grid code looks like this
    private function generateGrid():void
    var clms:Array; 
    myADG.dataProvider=gridData;
    myADG.width=
    this.parentApplication.adgPanel.width-20;myADG.height=
    this.parentApplication.adgPanel.height-39;myADG.visible=
    true;myADG.x=0;
    myADG.y=0;
    myADG.designViewDataType=
    "flat";myADG.horizontalScrollPolicy=
    "on";myADG.verticalScrollPolicy=
    "on";myADG.lockedColumnCount=6;
    myADG.sortExpertMode=
    true;myADG.headerWordWrap=
    true;
    My question is this, in my MXML Grid that preceded this I hand this line
    click="{populateChildren(adg.selectedIndex)}"
    How do I add this functionality to my new AS Advanced Data Grid??
    populateChildren is a function that allows me to set the specific row as an object and share amongst other other modules based on the grid selection.
            private function populateChildren(loc:int):void
              selected = Object(gridData.getItemAt(loc));
              this.parentApplication.populateChart(selected);
    Thanks in advance for any help.

    The complete sample code contains 5 WebService calls that populate List collections views.
    Given these services are not exposed externally, I can't see how that would be more helpful it would actually cause more errors.
    But as usual with being new to Flex and AS I have found the root of the problem....ME     it's always something so silly and easily overlooked.
    myADG.addEventListener(MouseEvent.CLICK,populateChildren());
    should read:
    myADG.addEventListener(MouseEvent.CLICK,populateChildren);
    and for completeness my function needed to look like this
    private function populateChildren(e:Event): void
    selected = Object(gridData.getItemAt(myADG.selectedIndex));
     this.parentApplication.populateChart(selected);
    completely back to operational again.
    Thanks for taking the time to look into this a bit, sorry for the trouble, but at least I will recognize that error, I had never seen it up till now.
    Thanks again.

  • 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.

  • I am trying to reinstall Flash CS4 professional as the action script is not working but now I am getting an error: 2 message when I use the original CD to try and reinstall

    I can't get the original disk to work on a reinstall.  I get the message
    AdobeColorCommonSetRGB
    Error:
    Error 2.
    I teach a class using this program on Macintosh computers running 10.9.5 and the action script is not working.  It will work on any program designed using the 10.8 but if you design any animation on 10.9.5 the action script will not work for the buttons

    You would have to manually delete the color profiles in question... Run the cleaner tool and see if it gets you started.
    http://www.adobe.com/support/contact/cscleanertool.html
    Mylenium

  • Action Script to add MC as sub-pages ??

    Alright please help.. I have tried everything, been fooling
    around with this in the past 5 hours and its not going anywhere :(
    . Here is what i have. :
    I have 6 menu buttons... Button 4 is what i am concentrating
    on.
    at the moment here is the current action script of button 4 :
    --CODE---
    //-----this first few lines just controls the button
    animation --
    on (rollOver) {
    if (_root.link<>4) {
    gotoAndPlay("s1");
    on (releaseOutside, rollOut) {
    if (_root.link<>4) {
    gotoAndPlay("s2");
    //-----end of button animation-----
    on (release) {
    _root.scroller.scroller.gotoAndStop(3); // I understand this
    calls for fram 3 in an mc within an mc.
    if (_root.anim==true) { // not really sure where this means
    if (_root.link<>4) { // if value of _root.link
    <> 4 then activate the following code
    _parent["but"+_root.link].gotoAndPlay("s2"); // I kind of
    understand this part, i know it has to do with playing the button
    animation, but i am stuck where it says "but" + _root.link .
    _root.link = 4; // value of root.link
    _root.all.play();
    ok so basically, from what i can figure out what this action
    script does is : somehow it calls out a mc called "all action page"
    and the contents inside this mc are two layers. one layer is just a
    stop frame, and the other layer has multiple frames, each frame in
    the layer are each different mc's .. the _root.value is the value
    of each frame, for example if i change the value to 2 or 3 it will
    load frame 2 or 3 within the "all action page" mc..
    now my question, is is there any way i can replicate this
    script for the use of button 4 ?? i know i can just keep adding new
    frams and mc's to the current "all action page" and just keep
    changing the value that corresponds to the frame number, but i
    would like to make it more neater and structured incase if i need
    to change anything. any suggestions ??
    -Steph'

    This package contains two scripts the use EXIF meta data. The one you want is StampExif the other GoogleMapGPS....
    Crafting Actions Package UPDATED Aug 10, 2014 Added Conditional Action steps to Action Palette Tips.
    Contains
    Action Actions Palette Tips.txt
    Action Creation Guidelines.txt
    Action Dealing with Image Size.txt
    Action Enhanced via Scripted Photoshop Functions.txt
    CraftedActions.atn Sample Action set includes an example Watermarking action
    Sample Actions.txt Photoshop CraftedActions set saved as a text file.
    More then a dozen Scripts for use in actions
    Download

  • Maths Problem in Action Script 2.0

    Hi surfers,
    We have a problem in Action Script 2.0 to solve the maths equation given below:
    write a code in Action Script 2.0 to solve these two equation.
    Aim: To know the value of "a" in both different equations.
    1. 2a + 5 = 3a + 1
    2. 4a + 3 = 11
    Thanks in Advance.
    Pls give me ASAP, i'm struggle here.

    Hello, you are at the wrong forum. for AS 2.o questions, hop on there: http://forums.adobe.com/community/flash/flash_actionscript
    BTY, people answer when they can, not when you want...

  • 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()

  • Newbie here, with button action script issue

    I have just started to scrach the surface with actionscript
    and I have attempted to assign it to buttons. Much to my supprise,
    it worked, sort of... All my buttons require a double click the
    first time you click on them. I was able to put
    this together, by
    using the following action script for all my buttons:
    on (release) {
    ybutton.onRelease = function() {
    gotoAndStop(28);
    So I have 2 questions. What actionscript will give me the
    single click that I am looking for? Also, is there any shortcut to
    making a broad change? In other words, will have to switch out the
    code for every button on 37 frames?
    Thank you

    1: // You needed two clicks because you have 2 onRelease.
    on (release) {
    gotoAndStop(28);
    2: Yes, it'll go fast I would copy the above and paste where
    needed then just change the frame #.

  • Where do I put my Action Script?

    So, I created a small Flash site with no loading of external
    swfs. I am strictly using the timeline using labels. I have a layer
    for my main buttons (home, portfolio and timeline). I have selected
    AS3 for the file and I have those buttons working fine.
    I have a button for my portfolio where thumbnails will pop up
    after being pressed. I want to link those thumbnails to the URL's
    of the actual websites. Where do I put the action script?
    I also want to have my email at the bottom of the screen so
    you can click on it to email me. I am used to using AS2 whwere you
    simply put the code on the button.
    Thanks,
    Gabe

    Hey, so thank you for the fast reponse. I totally agree with
    you on learning AS3, I don't want to go back to AS2.
    I already have the code you supplied so I understand what it
    is doing but my question is where do I put it in this case? I
    always create an action layer as you mention. In my action layer, I
    have frame 1 with my preloader code and then frame 2 with my code
    for my main buttons. They call to the labels. So, when I press
    portfolio for example, it goes to that label.......a shape tween
    starts and my portfolio thumbs appear. I then want those thumbs to
    link to the URL of those sites.
    So, where do I stick your code?
    Thanks again for all your help. I am NEW to AS3 and this is
    great learning.
    Thanks,
    Gabe

  • Action Script value Validation

    HI Guys,
    I hope this email finds everyone well on this 'hump day.'
    I just have a question on actions scripts.
    Sometimes, my attributes have list values, but in doing some quality checking, some actions scripts I have loaded contain values not specified in the list for that attribute.
    What is the best way to prevent this? Validation after upload?  Looking for suggestions.
    Thank you, everyone.

    DRMRocks,
    Thank you for your reply.
    What if I DONT check off the overide function.  Would an action script fail that way if the action script inlucded a value NOT in the list of values for that attribute?
    Thank you.

  • Is somebody developing in Action Script under Arch?

    Hi!
    Not sure it's the right place to post this, but at work I had all the pain in the world to set up an Action Script development under Debian (that's the distro I am using at work) and finally had to work under Windows. There was no free IDE and it was impossible at least for me to install a debug version of flash.
    Now I am finding the possibilities of Action Script interesting, and would like to use it for some personal projects at home (where I run Arch). I am curious to know if someone else is using Action Script under Arch, and in which case, what are their setups and if they had any problem to install everything they need.
    Thanks!

    I used to code in ActionSrcipt.
    I never had any real problems with it and I have workded for over 15 years in Linux only OSes.
    I always used my prefered editor ( at the time it was vim I  think ) and then did all my testing in the browser by running the flash movie.
    The question you have to ask yourself is: Is it really worth for me to spend time with it?
    ActionScript is tyied to Flash ... and Flash is in it's "way out". Sure it will not disappear tomorrow but it's just a matter of time. Heck even Adobe acknolledge that...
    To me, if you just like coding ActionScript, then go to JavaScript. AS is just JS with adaptations to the movie playing engine of Flash.
    Hope this helps.

  • Mapping action script object to mx:model object

    Hi all,
    I am having an action script class and an mx:model element
    with same elements. I want to assign an action script object to
    this mx:model. How can I do that one?
    Let me state it clearly.
    Say, my action script class contains two elements - user and
    rollno with required getter and setter methods.
    And I am having an mx:model element with the following
    format.
    <mx:model id="data">
    <data>
    <user/>
    <rollno/>
    </data>
    </mx:model>
    I want to assign an instance of action script class to this
    model object.
    I tried extending action action script class from Objectproxy
    and used data=actionscriptinstance.
    But it's not working properly.
    Is there anyway I can do this one?
    Thanks in advance

    The quick answer:
    <mx:model id="data">
    <data>
    <user>{ myASObj.user }</user>
    <rollno>{ myASObj.rollNo}</rollno>
    </data>
    </mx:model>
    The bigger question might be, "Why have the mx:Model?"
    The Model tag is all Strings, so you lose data typing.
    Why not just create a value object (VO) for your user data
    and pass that around?
    package samples.user {
    [Bindable]
    [RemoteClass(alias="samples.user.User")]
    public class User {
    public var user:String;
    public var rollNo:int;
    Then when the result data returns, cast to the VO.
    public var user:User = (eventObj.result as User)

Maybe you are looking for