Actionscripting problem

I've tried everyway I can think of to modify the following
script so that it counts up instead of down with out
success....could you please tell me how to modify it so that it
counts up?

i'm struggling to understand your code. your function
maincountxx doesn't have a closing parenthesis so it won't actually
work. also this function is never called...? so it appears as
though the first few lines of your code is all that is currently
working and making it count down perhaps by looping frames or
something? i don't know, but find attached some code to do what
you're after - count down. it puts the countdown text into a
textfield called countdown.

Similar Messages

  • Mapping ArrayList in java to Actionscript Problem

    Hi Guys,
    This is wrecking my head. Had this issue for the last two days and cannot for the life of me understand why. I have a service defined as with the following method;
    public List getIngredients(){
              List list = null;
              List ingredientList = new ArrayList();
              SandwichDAOFactory fac = SandwichDAOFactory.getDAOFactory(1);
              IngredientDAO ingDao = fac.getIngredientDao();
              IngredientDTO ingDTO = new IngredientDTO();
              Ingredient ing = new Ingredient();
              list = ingDao.getAllIngredients();
              for (Iterator it=list.iterator(); it.hasNext();) {
                   ing = (Ingredient) it.next();
                   ingDTO.setIngredientID(ing.getIngredientID());
                   ingDTO.setName(ing.getName());
                   ingDTO.setPrice(ing.getPrice());
                   ingDTO.setDescription(ing.getDescription());
                   ingDTO.setType(ing.getDescription());
                  ingredientList.add(ingDTO);
              System.out.println("Calling Service");
              System.out.println(list.toString());
              return list;
    Now I have defined a remotes object in my flex app;
    I call this service method when I first load the application;
    retrievalService.getAllIngredients();
    then handle the result as follows;
    private function getAllIngredientsResultHandler(event:ResultEvent):void
                     ingredientsListData =  event.result as ArrayCollection;
                     var arrList:Array = event.result as Array;
                     trace("event.result.toString = "+event.result);
                     trace("ingredientsListData = "+ingredientsListData);
                    trace("arrList = "+arrList);
    I would expect to see the object references delimited in some way for all the trace methods. But when I run the example I get the following output;
    event.result.toString = [object IngredientDTO],[object IngredientDTO],[object IngredientDTO],[object IngredientDTO],[object IngredientDTO]
    ingredientsListData = null
    arrList = null
    I dont understand why this is happening. Surely the variables should contain the same info. I did some debugging and found that the event.result object did in fact contain the data as an ArrayCollection. In addition all the elements were objects of the type IngredientDTO and contained all the relevant fields and data. So again I don't understand for the life of me why its not working.
    Can you not caste an ArrayList in java to an Array or an ArrayCollection?
    Its like the data isn't being mapped or cast properlu from the ArrayList in java to either the Array or the ArrayCollection in actionscript.
    This is driving me insane. Has anyone else had this problem and lived to tell the tale?

    I figured it out. Silly, silly mistake. I was using the wrong import declaration.
    import flex.messaging.io.ArrayList;
    instead of
    import java.util.ArrayList;
    Silly silly...

  • CFGRID/CFSELECT/ActionScript problem

    I have CFGRID "onchange" code below that allows me to click
    on a CFGRID row and correctly display (in a separate CFFORMGROUP)
    the correct column value in via a CFSELECT object. The field name
    is
    priority and the grid name is
    tasks_grid.
    Works fine, but my problem is that I've been unable to get
    this to work on non-integer fields. If the field contains a text
    string, no matter how small, the ActionScript "if" statements don't
    seem to produce results. Could it be incorrect use of the ==
    operator? I'm not an AS programmer, so I'm unfortunately on the low
    end of the learning curve here.
    I hope the above makes sense. Any thoughts would be greatly
    appreciated.

    So far the best solution seems to be to create an array for
    each such field that creates a new query column containing the text
    data. I then reference the new "text" column ("priorityText", in
    this instance) via CFGRIDCOLUMN and use the original "integer"
    column (i.e., the actual field data) for the ActionScript matching
    code in the child form. The array code is from another post, in the
    Rich Forms forum, I believe.

  • Actionscript problem

    Hi everyone, my first post one here so i hope someone can be of assistance.
    I have been using CS4 with no problems for a couple of months, but i suddenly encountered a problem that i can't get beyond now.
    when i click on 'actions' my timeline collapses. This happens whether from right clicking on my timeline or selecting it from the top menu.
    Since this has happened i can't find a way of bringing up the actionscript screen.
    Has anyone had this problem before?
    I hope this makes sense!
    Thanks very much in advance.

    This forum is for suite specific issues only. I can only assume you're looking for Flash help.
    If so, please post in the Flash forum.
    Bob

  • Preloader Actionscript problem

    As a relative newcomer to Actionscript, I came across a
    preloader tutorial (from a trusted source) which reveals a cut out
    photograph as the movie loads. I decided to use it, but although I
    have checked and double-checked the Actionscript, Flash 2004 keeps
    reporting an error and the preloader is not working.
    The problem is obviously in line 6 and I just thought that
    someone might be able to look at the Actionscript and see the
    problem (which I can't!).
    Here's the Actionscript;
    stop();
    mask_mc._height = 1;
    this.onEnterFrame = function() :Void {
    var loadedData:Number = this.getBytesLoaded();
    var allData:Number = this.getBytesTotal();
    var percent:Number = Math.round(loadedData/allData=100);
    mask_mc._yscale = percent;
    if (loadedData>=allData) {
    gotoAndStop(10);
    delete this.onEnterFrame;
    Here's the error report from Flash;
    **Error** Scene=Scene 1, layer=Actions, frame=1:
    Line 6: Left side of assignment operator must be variable or
    property.
    var percent:Number = Math.round(loadedData/allData=100);
    Total ActionScript Errors: 1 Reported Errors: 1
    Many thanks for any help.

    you have an assignment operator (=) where you should have a
    multiplication operator (*) at the END of that line.

  • Actionscript Problems....  HELP

    Ok so heres the thing. I am kind of new to actionscript 3.0
    and I am trying to figure out what I am doing wrong with my coding.
    I have used this code time and time again and up until I got CS3 it
    worked just fine. If there is anyone that can take a look at this
    code and tell me what I am missing or what I might have done wrong
    I would greatly appreciate your help. below is my coding I am using
    to call the outside swf files and also call text documents that
    hold my info. Thank you so much for looking and helping if you can
    figure out what I messed up.
    this.rootcontainer.onLoad = function ()
    heightscale = 270.45;
    this.btn_news.onRelease = function ()
    if (_root.currMovie == undefined)
    _root.currMovie = "news";
    rootcontainer.loadMovie("News.swf",
    this.getNextHighestDepth());
    else if (_root.currMovie != "news")
    if (rootcontainer._currentframe >=
    rootcontainer.midframe)
    _root.currMovie = "news";
    rootcontainer.play();
    } // end if
    } // end else if
    this.btn_band.onRelease = function ()
    if (_root.currMovie == undefined)
    _root.currMovie = "band";
    rootcontainer.loadMovie("Band.swf",
    this.getNextHighestDepth());
    else if (_root.currMovie != "band")
    if (rootcontainer._currentframe >=
    rootcontainer.midframe)
    _root.currMovie = "band";
    rootcontainer.play();
    } // end if
    } // end else if
    _root.currMovie = "news";
    rootcontainer.loadMovie(_root.currMovie + ".swf");
    stop ();

    I tried using that code and it came up with Duplicate
    function definition, function onPress_but(event:MouseEvent). do you
    know why this might be showing up or did I just place this script
    in the wrong spot? I have added a few more lines of code but I
    didnt change anything till I added this to it and thats when it
    came up with that error.

  • Simple Actionscript problem

    Just received my new CS3 Web Premium in the mail yesturday
    and have been playing around with it, specially with flash. Do need
    some help with it though while I my trying to learn it. I have C++,
    VB, and PHP experience but have never really played around with
    actionscript as far as programing (used it to do basic event
    actions back in MX 2004). Anyways, to the point. I can't get this
    code to work. I am assuming I need to change the string to an
    integer, but not sure how.
    Here is the code:
    import fl.events.*;
    import flash.events.*;
    btnCalc.addEventListener(MouseEvent.CLICK, calculate);
    function calculate(e:Event):void {
    var Num1:Number = txtNum1.text;
    var Num2:Number = txtNum2.text;
    lblOutput.text = Num1 + Num2;
    }

    int and uint (and void) are not object types, they are
    primitive type
    associations. Values with the type int in Flash are still
    based around the
    Number class (being capitalized, there is an actual Number
    class in Flash),
    but benefit from integer optimizations at a lower level.
    "WebmastaDj" <[email protected]> wrote in
    message
    news:f0q66n$p2p$[email protected]..
    >I have noticed that. Actionscript is very case sensitive
    and not very
    >consistent. But I am sure there is a reason why they do
    that not sure what
    >though.

  • Javascript-actionscript problems

    I am trying to set up a test app to get a grip on communications between
    javascript and action script. I have successfully registered a call back function
    with action script to be called by javascript, But a second registered function
    is not getting recognized by javascript. <object/embed object>.callBack()
    javascript error (FireFox on Mac)
    <object/embed object>.callBack is not a function
    The page is posted at
    http://www.jekillen.com/jekillen/content/web_design/player/FLSHDev.html
    javascript sourced file
    http://www.jekillen.com/jekillen/content/web_design/player/dev.js
    buttons labeled 'TEST' and 'TEST 1'
    There is a link to the swf source code (text file). Notice the compatibility note.
    Thanks for advice, suggestions.
    JK

    I think I found the problem here;
    I have to clear the browser cache occasionally to
    get changes in code to show up.
    That became obvious when things were happening that I
    had eliminated from the swf source code, in the browser.
    The sample I posted may actually work. The browser I
    use to contact internet does not have Flash player 10
    so I have not tested the posting.
    JK

  • ActionScript Problems

    ActionScript is a very bad language because its every year
    change and it's changing in base that's very hard for me and very
    bad thing I learn action script in 2 years and then sudden change
    it.
    action script very hard for me that I am working animation it
    must very easy to use not hard component and database and xml
    and.... is very hard for use.

    Yes yes yes, ActionScript is a very BAD language, Flash is a
    very BAD software, Adobe is a very BAD company, this is a very BAD
    forum, I'm a very BAD guy, so I love all these BAD things.
    I learned flash for over 5 years, from a little bad AS1 to
    some bad AS2 and now going to a very bad AS3. The world keep
    changing, new technologies growing, we learn to adapt it. If you
    think you are not able to follow the trend, you can stay on AS2
    (AS1 perhap), nobody will force you to use AS3.

  • External .swf Intro ActionScript Problem

    I have used a loader component to load to an external .swf
    file (an intro animation). Once the external movie finishes playing
    I want my parent movie to move to a certain frame on my parent
    timeline. Nothing I try seems to work.

    So I could use the code that you provided in the timeline of
    the intro movie that I am loading into my main timeline?

  • Problem with window.close and window.open

    I am having two suspected Actionscript problems which only seem to be happening with Flash player 9 and later.
    BACKGROUND:
    I have a client who needs browser-launched swf files to play from a CD-ROM (I do not want to use the Flash projector).  These files were created a few years ago using Actionscript 1 & 2 code and everything has worked perfectly until now.
    Here is the setup:
    First, an autorun file on the root of the CD runs and writes a 'trust file' to the 'Macromed' directory.  The autorun next launches 'index.htm' which is simply an html page containing a series of links (topic1.htm; topic2.htm; and so on). Next, let's assume the student clicks the 'topic1.htm' link from the 'index.htm' page.  The 'topic1.htm' link launches a web page (also located on the CD) which contains and displays 'topic1.swf'.  So far, everything works fine.
    Here is where the two problems happen.
    Problem 1:
    I have an 'Exit' button within each swf (remember each swf is contained inside an html page).  The 'Exit' button has always worked properly, but suddenly does not work in Flash player 9.  I am using the following Actionscript 2 code on the 'Exit' button:
    on (release) {
    getURL("javascript:window.close()");
    The 'Exit' button has always worked using this code (and still works in Flash player 8 and lower).  However, it does nothing when played using Flash player 9.
    Problem 2:
    There are links to html popup windows within the 'topic1.swf' file (remember 'topic1.swf' is contained inside 'topic1.htm').  Each popup window contains a swf file that is used to present a demonstration.  When the student clicks the 'demo1.htm' link from 'topic1.swf', an html popup window SHOULD load and display 'demo1.swf' inside the 'demo1.htm' window.  The main ('topic1.htm') window stays open so that the student can return to the topic after completing the demo.  This has always worked properly until Flash player 9.  Here is the Actionscript 2 code
    which I am using on the button inside 'topic1.swf' to launch 'demo1.htm':
    on (release) {
                getURL("javascript:launchWin2('webpage2.html');");
    ADDITIONAL INFO:
    'topic1.htm' contains the following code which is used to support the Actionscript code listed under 'Problem 2' above.
    <SCRIPT LANGUAGE=JavaScript>
    <!--
    var padvar="";
    var childwind;
    function launchWin2(arg) {
    openWin2(arg);
    function openWin2(arg) {
    childwind = window.open(arg,"padwind2","menubar=no,location=no,status=no,scrollbars=no,width=750px,he ight=500px,left=0,top=0");
    //-->
    </SCRIPT>
    I would appreciate any help anyone can offer.  I am wondering if the problem has to do with a need to use ONLY Actionscript 3 code from Flash player 9 onwards.
    Thanks!
    Terry

    You may have '''Switched ON Caret Browsing'''. press '''F7 (on Mac: fn + F7)''' to toggle '''Caret Browsing ON/OFF'''
    * click '''Firefox''' button and click '''Options''' -> Advanced -> General -> remove
    Checkmark from '''Always use the cursor keys to navigate within pages'''
    * http://kb.mozillazine.org/Scrolling_with_arrow_keys_no_longer_works
    * http://kb.mozillazine.org/Accessibility_features_of_Firefox
    Check and tell if its working.

  • Air for Ios doesn't compile actionscript

    Hi guys,
    I'm having a big problem... I'm developing a game to be published to web, ios, android. If I export the swf for the web or the apk for android everything is ok but when I try to package the swf using air for ios the swf doesn't contains any actionscript, the compilation is very fast and the swf is smaller, also if I try to debug the fla nothing happen because no code is compiled. This is started in the last two month, before I was able to package also to ios and I was able to create an ipa that I sent to apple store but now I need to modify the app and I can no more compile it. I have browsed the forum and read something about the umcompiled actionscript problem but I didn't load any external swf, I just use urlloader to load an xml and some images. I'm using flash cs5.5. Someone have some suggestion?

    If you are using Flash Professional.. I would just create a new FLA .. copy over your library assets, etc.   Make sure to point to your certificates and provisioning files, etc.. and recompile.
    Were you using an old version of AIR previously and have the new AIR SDK installed now ?
    I have found that compiling the IPA with ADT from the command line is much better than compiling from the IDE and allows you to use the iOS5.1 SDK instead of iOS4.

  • Problem with huge movies.

    I made movies using camera and created clips using sony
    vegas. Movies have around 5 minutes. I created intro and embedded
    it into flash (not progressive download, just embeded to timeline,
    cuz i'm not creating this for www). So it's working fine, i made
    skip intro function and menu. So when you click on "Gallery" it's
    going to frame "gallery" where the movie is embeded. The problem
    is, that the player has an error i think, it's stopping in middle
    of the movie (it's not an actionscript problem, i'm sure, because
    sound from movie is playing, but movie not). I really need help
    atm, please!

    If you are using FLVPlayback component...
    if you load the swf through html, make sure the value for
    contentPath parameter is relative to the directory where the html
    is located.
    if you upload the files to a web server, make sure your web
    server support both swf & flv MIME type.

  • Why would a URL not be formatted as a clickable link?

    I run a service that sends A2P SMS messages that provide a link to weekly content. This week, a user reported to me that the URL was displayed but it was not a clickable link. AFAIK, there was no difference in the message except the exact link. I've attached a screenshot the user provided me.
    Why would this be the case?
    Justin

    You may have ActionScript problems that affect the link.
    You need to ask in the Flash Professional forum.
    Or, the users may not be able to see the Flash Container.
    Considering the number of users these days on SmartPhones, who can't access Flash content, the worst thing you can possibly do for navigation and links is to put them in a Flash container and render them invisible to such a larg portion of your visitors.

  • Help with smooth scrolling (masked movie clip)

    Ok, I really need help here, and I'll be very grateful for
    help before Monday.
    Someone has made a movie with a different set of text on each
    frame, the text goes out of the viewable area.
    I have been asked to make these frames appear in a pop-up on
    another flash and be scrollable.
    i thought this would be easy...just cut and paste them into a
    movie clip, then using a mask to hide the rest of the text.
    However, it is going painstakingly slow.
    Seems to be a performance issue, but it might be my code.
    Any help with the code, or optimisation elsewhere would be
    helpfully.
    Heres a simplified version of the flash;
    www.darkflame.co.uk/flashwork/Flash_popuptest.fla
    Code for the scrolling;
    _global.MoveUp = function(text) {
    _root.ITproduct.IT_productlist._y =
    _root.ITproduct.IT_productlist._y+6;
    updateAfterEvent();
    //trace('press');
    Called and stopped by;
    on (press){
    //this._parent.IT_productlist._y =
    this._parent.IT_productlist._y +10;
    //_global.scrollon = "yes";
    clearInterval(IntervalID);
    IntervalID = setInterval(MoveUp,100);
    updateAfterEvent()
    //updateAfterEvent();
    //MoveUp();
    //scroll on
    on (release) {
    //this._parent.IT_productlist._y =
    this._parent.IT_productlist._y +10;
    clearInterval(IntervalID);
    updateAfterEvent();
    //scroll off
    which is linked to a button.
    I dont know if this is a actionscript problem, or the way the
    page is made, or both.
    Any help would be appreciated.
    Thanks in advance,
    Thomas Wrobel

    you have extraneous graphics on-stage that are slowing the
    scrolling (and even causing problems in the authoring environment).
    here's your file with those graphics removed:
    http://www.gladstien.com/Files.popupTest.fla

Maybe you are looking for