Very Basic Functions Question

Hi,
apologies for this being a very basic question, but I rarely
use Flash. About once a year, however, I am called upon to do some
sort of (usually very simple) Flash-based project for the students
I assist. This time it's a simple random slideshow.
The setup is this:
* I have a movieClip called 'slides_MC' containing all the
slide photos, on consecutive frames.
* This movieClip is placed inside another movieclip named
slideshowRand_MC.
This is given an instance name of topslide_mc, and faded up
and down with alpha keyframes.
The idea is that, when the slides mc is faded right down,
some Actionscript causes the slides movie to jump to, and stop
playing on a random frame, so random slides are faded up, then down
again, then swapped.
I need to apply some actionscript to particular keyframes so
that the swap is performed at the correct time.
This is my attempt at a reusable function to do the swapping.
It's placed in a keyframe on the root timeline:
// Go to and stop at random frame in slides movieclip
function goRandom(mc) {
// Number of slides in slides movieclip
var slides = 22;
// Random number between 1 and number of frames in slides
movieclip
var randFrame = Math.ceil(Math.random() * slides);
mc.goToAndStop("slide_" & randFrame);
This function is called from keyframes in slideshowRand_MC:
_root.goRandom(this.slideshow_rand_mc.topslide_mc);
I know this is really basic stuff, but can anyone tell me why
this isn't working.
I've tried adding a breakpoint in the goRandom function, but
it doesn't look like it ever gets called.
Any assistance very gratefully accepted.
Alex

Hi Bob, thanks for getting back to me.
quote:
Originally posted by:
Bob Pierce
"_root.goRandom(this.slideshow_rand_mc.topslide_mc);"
There's a typo in that line - if it's in your code, it won't
work!
Ah, true. The typo actually happened when I was re-writing
the code in post. The actual code in the movie is
_root.goRandom(this.topslide_mc);
This is attached to a keyframe of the container movie-clip
containing the slides MC.
I've put the fla file on our server.
slideshow_random.fla.zip
If you, or someone else could download it and help me find
out what I'm doing wrong, I'd be ever-so grateful. I'm sure it's
something really obvious. Without being very familiar with Flash
and Actionscript, it's hard to explain things, and much easier to
show you the actual Flash file.
The 2 functions are on a keyframe on frame 1 of the root
timeline. The 'goRandom' function is supposed to be called from a
keyframe in 'slideshowRand_MC'. I envisaged calling the random
pause function from another keyframe in the same movieclip.
Thanks again,
Alex

Similar Messages

  • Very basic function question from numbers virgin

    I have been working on a numbers table sent to me and adjusting data, need to calculate column totals but the function key on the toolbar is not 'highlighted' so I can't click on it to caluculate the sum. can't work out how to do this or find another way round it. don't want to create a new table. any advice? thanks

    photogogirl, if you haven't given up yet, here is another suggestion.
    Looks like that toolbar menu named Function also is not available if you have a range of cells selected that include a footer cell. The person that sent the file to you may have activated the footer row. If so, and since you said you are trying to sum columns, I would select ONLY the footer cell in the column you want to sum and then select Sum from the toolbar Function menu. Also, notice as you select single cells, you can see the underlying formula (if it exists in the selected cell) right under the toolbar. You can select any single cell and type the formula there directly if you like.
    gluck.
    Rob

  • Very Basic Flash question

    I apologize for this, but I can't seem to figure out this
    very basic function:
    I select a certian number of frames and I'd like to see at a
    glance how many frames I have selected. if I select 42 frames is
    there somewhere I can look that tells me I have 42 frames selected?
    Thanks,
    D.

    Quickest way to do this is to select the amount of frames you
    want in the timeline then hit F6 on your keyboard to turn them all
    into keyframes. Now if you look at the toolbar below it (where the
    frames per second(fps), onion skinning, etc) you will see the
    Current Frame displayed.
    Undo to get rid of the keyframes

  • Very basic loop question

    Hi everyone, I´m somewhat new with programming and I have a very basic loop problem, that I can´t solve.
    I have 3 ArrayLists:
    A has the project information, ordered by client, identified by a projectId, clientId and businessId
    B has the client information, ordered by business, identified by a clientId and businessId
    C has the business information, identified by a businessId.
    I need to show all the projects of a client, then the client information of a certain business, and at last the business information in a format like this:
    A -- Project1
    A -- Project2
    A -- Project3
    B -- Client1
    A -- Project4
    A -- Project 5
    A -- Project 6
    B -- Client2
    C -- Business1
    A -- Project7
    A -- Project8
    B -- Client3
    A -- Project9
    B -- Client4
    C -- Business2
    How should I program my loops? I've been trying different ways but everytime it doesn't print what I want. Help, please!

    OK, here's my code:
    for(int bussCounter= 0; bussCounter< bussArray.size(); bussCounter++)
       ValueObject bussVO = bussArray.get(bussCounter);
       String bussId = bussVO.getBussId();
       for (int clieCounter = 0; clieCounter < clieArray.size(); clieCounter++)
          ValueObject clieVO = clieArray.get(clieCounter);
          String clieId = clieVO.getClieId();
          String bussIdClie = clieVO.getBussId();
             for (int projCounter = 0; projCounter < projArray.size(); projCounter++)
                ValueObject projVO = projArray.get(projCounter );
                String clieIdProj = projVO .getClieId();
                String bussIdProy = projVO .getBussd();
                if (clieIdProy == clieId && bussIdProy == BussIdClie)
                   out.println("<tr>");
                   out.println("<td>" + projVO .getBussId() + "</td>");
                   out.println("<td>" + projVO .getClieId() + "</td>");
                   out.println("<td>" + projVO .getProjId() + "</td>");
                  out.println("<td>" + projVO .getTotal() + "</td>");
                  out.println("</tr>");
              if (bussIdClie == bussId)
                 out.println("<tr>");
                 out.println("<td>" + clieVO .getBussId() + "</td>");
                 out.println("<td>" + clieVO .getClieId() + "</td>");
                 out.println("<td>" + clieVO .getTotal() + "</td>");
                 out.println("</tr>");
       out.println("<tr>");
       out.println("<td>" + bussVO .getBussId() + "</td>");
       out.println("<td>" + projVO .getTotal() + "</td>");
       out.println("</tr>");
    }

  • Very basic Balance question

    Hi, as I said in the title, this is very basic. How can I set the pan on a stereo track to 9:15 or anything other than full left/right?
    Thank you.

    Thanks. Let me see if you got it right. When I have a stereo track and I move the pan knob to left, at at 9 o'clock, is the right channel moving in the same exact opposite direction (:15) so I have a narrower stereo panning?
    Or to do this I need what Bee Jay said?
    Thanks.

  • Very Basic actionscript question

    Hi,
    This is very basic but for some reason cant get it to work.
    Basically I have a movie that plays and at the end I have a button that comes on screen but once the button stops I want the user to press the button then it goes to the url.
    I have
    stop() {
    on (release) {
            getURL("http://google.co.uk","_self","blank");
    but this doesnt work.
    Thankyou for any help.

    I have now sorted it, I had my movie on actionscript 3 and needed to put the url code onto the actual button.

  • Help with Applescript: very basic functions

    Hi guys, my first post. I'd very much like to switch from Excel to Numbers but not until I find an Applescript replacement for my stuff.
    I wrote basic Excel Applescript just fine but I'm tearing my hair out just to perform simple scripts in Numbers!!!
    Basically I need to do:
    PART 1: Import External Data
    - I think I got this covered, using a GUI copy script via the "System Events" application
    - but since you guys are the experts: how do I make this process 'invisible'? i.e. each time the script runs, a Safari window appears. I don't want that to happen.
    tell application "Safari"
    activate
    open location "http://www.whatever.htm"
    end tell
    tell application "System Events"
    tell process "Safari"
    keystroke "a" using command down
    keystroke "c" using command down
    end tell
    end tell
    PART 2: Paste It Into Numbers
    - How hard can it be, right? Apparently I have the mental IQ of Gump I need Numbers to:
    - clear data from an existing pre-defined/named table
    - paste the data (from clipboard) onto this table (paste starting on cell A1), using the "Paste and Match Style" function
    - hide certain columns <-- I realize if Numbers paste onto a table with hidden columns, it treats them as non-existent i.e. won't paste the same. Therefore I suppose before the paste script I'd need an unhide script
    ... and that's it!!
    Help please I really hate Excel but can't move on till I figure this out... it's crucial to my livelihood.
    Thank you all in advance!

    There is no paste function in the Numbers AppleScript's dictionary.
    We may mimic it as I did during one year and a half with Numbers '08.
    Go to my iDisk:
    <http://idisk.me.com/koenigyvan-Public?view=web>
    open the folder "For_iWork:iWork '08:for_Numbers:"
    and download one of the items whose name starts with "paste".
    This use of GUI scripting is interesting because it creates automatically rows/columns when required.
    One draw back is the resulting font.
    Yvan KOENIG (from FRANCE samedi 17 janvier 2009 21:12:52)

  • Basic Functionality Questions - Is a computer required to serve content, etc?

    I'm sorry if these are no-brainers. I ask them because I thought I had understood how an AppleTV worked, and had planned on buying one, until a friend who owns one insisted that the device functions differently than I had understood it to. I think he's wrong, but I was hoping you guys could clear up a few things for me.
    1) Does an AppleTV require that I have another device (iPad, Computer running iTunes, etc) on and connected to watch content purchased from my iTunes account, or will it stream directly from the 'net?
    2) If I've converted video content from a source other than the iTunes store (for example, ripped a DVD and imported it to my computer's iTunes library) can I stream it to my AppleTV (assuming the source computer is on?)
    3) Assuming #2 is true, the content in question must be served by a computer - ie, I can't move it to the cloud, and viewing it is dependant on having my computer on and running. Is this correct?
    Thanks in advance guys!

    1- it will stream purchased items such as TV shows, not music unless you have the  iTunes match subscription. You need another device if you want to do "home sharing" (share your iTunes library with other devices, If you have already bought movies, music, etc.)
    2- You will have to import it to iTunes if you want to see it on your ATV.
    3- Yes, you need to have a computer act as a server with iTunes running all the time...

  • Very basic compiling question: multiple c files

    Hi,
    I've been playing with alchemy for a few days, and hit a road block. I'm sure there is an easy answer, but I can't find it...
    I have a .c file "alchemy_project.c" that lets me call 3 functions from actionscript. I have the basic main() function that sets up the functions and calls
    AS3_LibInit(result);
    It is working well. However, I want to add another c file "support_functions.c" with a function I can call from "alchemy_project.c".
    int testFunction(){
         int i;
         i = 2;
         return i;
    I made a header file "support_functions.h":
    int testFunction();
    I included this header in "alchemy_project.c" by placing it after my AS3.h include:
    #include "AS3.h"
    #include "support_functions.h"
    I compile with:
    alc-on
    gcc alchemy_project.c support_functions.c -Wall -swc alchemy_project.swc
    When I run my flash file, it gives:
    Undefined sym: _main
    If I add a main function to support_functions.c:
    int main(){
        return 0;
    I get:
    [object AlchemyExit]
    Any tips?
    Thanks for the help!

    This helped me a little bit:
    http://forums.adobe.com/thread/465926
    I now compile the 2 c files with:
    gcc -c file1.c -o file1.o
    gcc -c file2.c -o file2.o
    then link them with
    gcc file1.o file2.o file3.o -O3 -Wall -swc --combine lib.swc
    I don't get any errors about main(), but actionscript gives me the error:
    Undefined sym: _testFunction
    when alchemy_project.c tries to call the testFunction() function in support_functions.c

  • Very basic code questions

    Hi,
    I'm pretty new to dealing with this so please bare with me. I come from a PHP background so I got alot to learn here ;) Anyway, to my question then. I've got a book that im reading and following examples from but also try to evolve those examples into something more, to try and learn even more. I haven't come very far yet but I've stumbled across a little thing that I woulld like some help with. I'll post the complete code just in case.
    import java.io.*;
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    import javax.wireless.messaging.*;
    import javax.microedition.io.*;
    public class quiz
         extends MIDlet
         implements CommandListener {
      private List mList, longList;
      private Command mExitCommand, mNextCommand, longExitCommand, longNextCommand;
      public quiz() {
        String[] stringElements = { " Game 1", " Game 2", " Game 3", " Game 4", " Game 5", " Game 6", " Game 7", " Game 8" };
        Image[] imageElements = { loadImage("/1.png"),
         loadImage("/2.png"),
         loadImage("/3.png"),
         loadImage("/4.png"),      
         loadImage("/5.png"),
         loadImage("/6.png"),
         loadImage("/7.png"),
         loadImage("/8.png") };
        mList = new List("Quiz v1.0", List.IMPLICIT, stringElements, imageElements);
        mNextCommand = new Command("Choose", Command.SCREEN, 0);
        mExitCommand = new Command("Exit", Command.EXIT, 0);
        mList.addCommand(mNextCommand);
        mList.addCommand(mExitCommand);
        mList.setCommandListener(this);
      void HowMany() {
        String[] stringElements = { " 1 question", " 2 questions", " 3 questions", " 4 questions", " 5 questions" };
        longList = new List("Quiz v1.0", List.EXCLUSIVE, stringElements, null);
        longNextCommand = new Command("V�lj", Command.SCREEN, 0);
        longExitCommand = new Command("Avsluta", Command.EXIT, 0);
        longList.addCommand(longNextCommand);
        longList.addCommand(longExitCommand);
        longList.setCommandListener(this);
      public void startApp() {
        Display.getDisplay(this).setCurrent(mList);
      public void commandAction(Command c, Displayable s) {
        if (c == mNextCommand || c == List.SELECT_COMMAND) {
          int index = mList.getSelectedIndex();
         if ( mList.getString(index) == " Game 1") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 1 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 2") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 2 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 3") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 3 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 4") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 4 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 5") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 5 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 6") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 6 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 7") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 7 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
         if ( mList.getString(index) == " Game 8") {
              HowMany();
              Alert alert = new Alert("Your Choice", "Your choice: Game 8 with X questions.", null, AlertType.INFO);
              Display.getDisplay(this).setCurrent(alert, mList);
        else if (c == mExitCommand)
         notifyDestroyed();
      public void pauseApp() {}
      public void destroyApp(boolean unconditional) {}
      private Image loadImage(String name) {
        Image image = null;
        try {
         image = Image.createImage(name);
        catch (IOException ioe) {
          System.out.println(ioe);
      return image;
    }I know that the IF parts pretty much suck, will improve those later on (or when my book does hehe) so that's not the issue. Anyways, I've included a second choice for the user which is what I call "HowMany", so first the user gets to choose between a few options (Game 1, Game 2, etc etc) and then the idea is for the user to choose how many questions, I get to that menu allright but when i try to choose that option nothing happens. I need to include some kind of listener or something to make something actually happen right? If someone would be so nice to show me how it's done it would be just super.
    Thanks in advance!

    I get to that menu allright but when i try to choose that option nothing happens.The form of javax.microedition.lcdui.Display.setCurrent you use ispublic void setCurrent(Alert alert, Displayable nextDisplayable)Which List do you want to be the nextDisplayable? mList or longList?
    Once that works, you will need to add suitable condition checking in commandAction(...) for doing stuff when the Command-s added to longList are selected.
    db

  • Very basic modules questions (ath_pci, etc)

    Hello! (I'm sorry, I posted this one in another forum first, thinking I was posting it in this one :oops: )
    I have a very simple question:
    Where can I find modules (e.g., ah_pci for my Atheros mini PCI wireless card), and where and how do I install them?
    For example, when I do:
    modprobe ath_pci, I get a message saying something like:
    can't find ath_pci module;
    although I've seen a directory with this name on my system (IIRC, under /sys/drivers???).
    Other example:
    I have a 855GM Intelchipset. How do I find the module for it and how do I install it?
    Thanks a lot.

    Thanks for the reply, and for deleting the other thread.
    I looked for /lin/modules, and I don't have a /lin directory... Is it normal?
    Or maybe you meant /bin/modules...? Anyway, I looked for this too and there is no /modules directory under /bin.
    I found some modules under /sys/module. There is one named ide_cd that I put in the MODULES array of rc.conf (just for a test, I don't know why it is for...), but I get a message at bootup:
    [/code]FATAL: module ide_cd not found[code]
    Is this normal too? Or it has to be compiled with the kernel to work. And BTW, if I compile the kernel (I don't think I'm at this point in Linux yet!), do I loose my installation or if everything stays in place in my system?
    Thanks a lot![/code]

  • Very basic noob question about understanding class creation

    After learing some procedural scripting I just started with understanding OOP and have a problem with a basic stuff like this. Why my Try.as below is not working when I type Try(1); in the main file. Output says: Type Coercion failed: cannot convert 1 to Try
    package {
        public class Try {
            public function Try(some:Number) {
                some += 1;
                 trace (some);

    use:
    var s:Try = new Try(3);

  • Very basic String + @ question

    Hello all.
    I'm trying to use the "BitmapMetadata.GetQuery(String query)" method. I've found a few examples online where the argument string is specified as follow:
    string iptcRegion = @"/app13/irb/8bimiptc/iptc/Province\/State";
    As I understand it, the use of "@" is so that I don't have to specify "//" everywhere...but what is the meaning of "\/" at the end just before "State"? Thank you in advance.
    -L

    Thanks Armin, but if it has no special meaning why is it being written that way? I understand that the "@" is specifying a literal string, but something is just not clicking here. I'm sourcing the above strings from two places:
    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/371f5e90-1a59-412d-8ae0-de7814da6158/iptc-query-using-bitmapmetadatagetquery-method-?forum=windowswic
    and
    http://www.dustyfish.com/blog/basic-editing-of-photo-metadata-using-windows-imaging-component
    I've read and re-read these the two above posts but I just cannot make sense of their use of "/" and "\" and "@". There seem to be 3 different ways being shown and I can't figure out which one is correct. Can anyone clear this
    up for me? Thank you very much.

  • Web Service With Dynamic URL (Very Basic Conceptual Question)

    Hi everyone,
    I would like to employ JAX-WS to generate and publish a web service along with a web-based client which uses the service. The problem is: I want to deliver both the server (with its service) and the client to a customer, who will install the server on an internal machine, and who will have to configure the client to look for the web service at the IP of that internal machine, ideally by just putting the IP into some configuration setting. Both the services' path (on the server) as well as the services remain constant.
    From everything I have found so far, it appears as if one fixes the service's IP during compilation, i.e., when generating the WSDL and stubs using wsgen/wsimport. I guess that's fine when the server remains with me & a fixed IP, but doesn't this approach break down as soon as you need some flexibility in the server's IP, as, e.g., in my above scenario? I guess I am missing something, but unfortunately all the documentation I have found so far either neglects this issue or comes up with rather complex solutions indeed. - Or would one not use SOAP+WSDL in the above scenario in the first place? Any other best practices?
    I'd very grateful for any hints,
    Cheers
    equitone
    Message was edited by:
    Equitone

    Hi,
    thanks for your reply. Of course, I agree I could alter the generated code, but, as you say, I would not want to do that, since it will make automatic builds and deployment rather complicated.
    I guess my expectations on the "flexibility"/"design" of some of the generated artifacts is just a bit skewed, and I'll have to find a compromise between my expectations and the Java 6 way of web services. For instance, I also find it somewhat annoying that wsgen will apparently only generate the service against an implementing class, not an interface. E.g., when I have the following web service interface MyService and an implementing class MyDummyService:
    @WebService
    public interface MyService
        @WebMethod
        public String getString();
    @WebService(endpointInterface = "com....MyService")
    public class MyDummyService implements MyService {
       public String getString() {
          return "Just a dummy.";
    }Then the service in the WSDL specifies its Port as "MyDummyServicePort", so if I ever change the implementation---without actually changing the (web service) interface, I will also have to regenerate all client stubs. I would have hoped that wsgen's "service" option would help in this regard, but apparently it doesn't. Unfortunately, the documentation on the whole issue is in a pitiful state, IMHO.
    Cheers
    Equitone

  • Very basic comps question

    Logic Express 8.02. I have four bass takes. Various parts of each are needed. I've read the manual and there is no explanation about how to select just a small section of a take. The only way I see to do it is to go to the beginning, drag all the way to the start point and go all the way to the end and drag left to the end point. After that, however, I see know way to use a later or earlier part of that take again without duplicating the track. I know how it should work. I should be able to "lasso" part the part of the take I want as I go through the song and make the lassoed parts active. The manual touches on this, but when I try to "select the desired take sections by click-dragging over them with the Pointer tool" nothing happens. I'm sure this is really easy, but not easy to figure out. What's the trick? Thanks for any help.

    OK. It seems to be working now. That figures right after I post a question. I hit "revert to saved" and now I see how it works...I think.

Maybe you are looking for

  • Connecting Fax - PC

    Hello to the community! I want to get a fax machine that will keep the faxes at its memory and will then be able to send them to my PC. Is this possible? I'm thinking of some model like HP Officejet Pro 8600 e-All-in-One Printer - N911a. I tried to f

  • What multifunction(all-in-one) printers work with Mac OS 10.9 and 10.8? - Printing, scanning and faxing!

    What multifunction (all-in-one) BW laserjet printers work with Mac OS 10.9 and 10.8? - Printing, scanning and faxing! I had a HP3052 whith a scaner message error 5 which can't print anymore. Anyway scanning with this HP is not supported anymore. So l

  • Stock transports of vendor consigned inventory

    Hello.  I have a question with regard to doing a stock transport order (from one plant to another) where the inventory is in vendor consigment stock.  I have a stock determination rule set on both the materail and item category (NLN) but it appears I

  • How to install Oracle Essbase

    Hello! I would like to install Oracle Essbase and then using OBIEE to designing Dashboards I can download from: http://www.oracle.com/technology/software/products/bi/performance-management/111130/hyperion_essbase_111130.html and I have downloaded thr

  • System Freezes when trying to copy GL Budget Scenerio

    All- I have a Business One 2007 PL 4 customer that is trying to copy a budget scenerio. After hitting 'execute', no message is displayed, but the user gets stuck showingthe same GL account number on the bottom left of the screen. (where the error lin