Selecting a random movie clip from array

I know this should be easy, but I can't seem to make it work. All I want is for the variable currentPage to select randomly from an array so that every time the page loads, it displays a different currentPage.
This is what I have so far:
var myImages:Array = new Array("outsource_mc","solutions_mc","staff_mc");
var randomImages:Array = [];
var randomCount:Number = 1;
var r:Number;
for (var i = 0; i<randomCount; i++) {
r = Math.floor(Math.random()*myImages.length);
randomImages[randomImages.length] = myImages.splice(r, 1);
trace(randomImages);
currentPage = the random movie clip;
Thank-you for any help!!

Anytime you want to see what something is, use the trace() function... it is an essential code design tool that outputs whatever you ask it to in the Output window....  trace(currentPage);
For the code I showed currentPage would have been one of the instance name String values from the array.  If you had taken the quotes off of the names in the array, it would be a reference to the actual instance.
As far as the new code you show, I don't know what you are trying to do, nor what it is not doing that you expect it to, but the last two lines have no relationship to the lines preceding it.

Similar Messages

  • How do I move clips from one Event to another?

    How do I move clips from one Event to another?
    As soon as I got the new iMovie, I started importing clips and making video's. Unfortunately, I hadn't fully understood the Events feature, so all of my clips are in a single "New Event" Event. I have now created several other Events and named them properly and would like to sort all of my clips into their proper "Event" folders. How do you do that?

    Ahh, Ok. I actually had to go to Lynda.com to watch a training video of this highly bassackwards maneuver, but now I have it. In other words, while the intuitive thing is to make a new event to hold the clip you want and then open the old event and drag the clip into it's new event, the only way to accomplish this maneuver is to NOT create a new event, but rather, go to the clip AFTER the one you want to move, select it and then Right-Click on it and select SPLIT EVENT BEFORE SELECTED CLIP (or go to FILE>SPLIT EVENT BEFORE SELECTED CLIP). Then you wait a few seconds while the program thinks a bit (no feedback it is doing this - just a pause) and then it automatically creates a new event with the clip you wanted. Now just double-click the new event and name it something meaningful.
    Thanks for your help!

  • How do i move clips from home video to roll?

    how do i move clips from home video to roll?

    Ahh, Ok. I actually had to go to Lynda.com to watch a training video of this highly bassackwards maneuver, but now I have it. In other words, while the intuitive thing is to make a new event to hold the clip you want and then open the old event and drag the clip into it's new event, the only way to accomplish this maneuver is to NOT create a new event, but rather, go to the clip AFTER the one you want to move, select it and then Right-Click on it and select SPLIT EVENT BEFORE SELECTED CLIP (or go to FILE>SPLIT EVENT BEFORE SELECTED CLIP). Then you wait a few seconds while the program thinks a bit (no feedback it is doing this - just a pause) and then it automatically creates a new event with the clip you wanted. Now just double-click the new event and name it something meaningful.
    Thanks for your help!

  • Dragging movie clip from Event pane to Project pane

    When I drag a movie clip from Event to Project the top part of the clip is cut off. On body pictures I am losing people's heads! The movie clips play perfectly in the Event panel, so I know they were imported correctly.

    There are two things to look at.
    First, what is the aspect ratio of your project, and is it the same as your camera is shooting?
    If your camera is standard (4:3), set your project to 4:3. If your camera is wide-screen (16:9), set your project to 16:9. You can do this in FILE/PROJECT PROPERTIES.
    Second, if your project contains a mix of 16:9 and 4:3, that is OK. You just pick the aspect ratio that you prefer. Then on each clip, go into the Rotate, Crop, Ken Burns Tool and select FIT or CROP.
    FIT will letterbox (black bars). CROP will cut off the top and bottom. You can decide which you prefer.

  • My desktop IMac OSX 10.6.8 : IMovie '11: Trying to upload a home movie clip from my Panosonic camera model PV-DV203D. I've had this camera several years, and used it with Windows desktop. Now trying to work with my Mac. I have a USB cable, both ends fit,

    My desktop IMac OSX 10.6.8 : IMovie '11: Trying to upload a home movie clip from my Panosonic camera model PV-DV203D. I've had this camera several years, and used it with Windows desktop. Now trying to work with my Mac. I have a USB cable, both ends fit, but iMovie '11 does not recognize it. Is there a driver fix for this?

    What kind of Mac to you have?  This camera is a tape based DV one that connects best with firewire and I cannot tell if your Mac has firewire.  If your mac *does* have firewire, get a camcorder firewire cable and try again.
    ETA:  Oops, I am pretty sure that all the "desktop iMacs" have firewire, so you should be good to go.  You will probably need a cord that goes from FW800 to your camcorder.

  • Trouble Copying and pasting a movie clip from another flash scene

    Hello,
    I have been trying to copy a movie clip from the library of one flash and paste it into the library of another.  But when I do this, it always gives me, "One or more library items already exist in the document.
    I have tried finding and renaming those items, renaming the existing movie clip, and even changing it into a graphic instead.  Still it always replaces these certain movie clips in my main flash file.
    I even tried the following:
    Creating a new movie clip in the new file.  Then going into the movie clip of the other file I wish to copy over, and trying to copy its frames and put it into the new movie clip i created in the main file.  Even then, it says I'm replacing library items!
    Can someone help me?
    Thanks

    The easiest way to be sure you are renaming everything is to probably to copy the movieclip into a new empty file's library and then rename each symbol in there.  Unless I am missing something, when you do that, each isolatable symbol inside that movieclip will appear as a separate symbol in the library, making it easier to be sure you have renamed them all.

  • HT2518 I am trying to move across & view my home movie clips from my PC to Mac, but I can't view them.  What do I need to have installed on the MAC to view such files? (Originally put onto the MAC from a Canon video camera)

    I am trying to move across & view my home movie clips from my old PC to my new Mac but I am unsure what software I need to view them.  They are from a Canon video camera originally.  Please advise how this is done!

    Do they have a file extension?
    How about anything on the camera which might indicate what it is, like AVCHD?

  • Loading Movie Clip from a button

    Hi,
    How do I load a movie clip from a button? So far on my button
    (b1), I have this AS: and I want the button to load the movie clip
    "char1." My button already has some AS:
    b2.onRollOver = function() {
    _root.captionFN(true, "Hi!", this);
    this.onRollOut = function() {
    captionFN(false);
    How would I go about adding more script to load a movie clip
    to my button b2?
    Thanks

    Hey - Unfortunately I'm going to be in meetings for most of
    the day, so
    it'll take me a while before I can go through this in any
    detail. One thing
    that struck me though is that your two functions (captionFN
    and
    hoverCaption) are in the main1_mc not on the main timeline.
    Then the
    buttons are calling _root.captionFN(); which refers to the
    main timeline.
    I would expect that they should be calling
    _root.main1_mc.captionFN(),
    because that is the path to where the function is. Does that
    make any
    sense?
    One thing that I do when I'm writing code is to always keep
    all functions on
    the main timeline. That way you are sure that they are being
    registered
    (i.e. if you call a function before the playhead reaches
    where that function
    is written, the function won't work. If the function is in
    the first frame
    of the main timeline, you know that the playhead has reached
    it). What you
    might want to do is to move all your functions to the very
    first frame of
    your movie. Then you can call them with the path:
    _root.myFunction() and
    you are sure that they will be found.
    Maybe give that a try and let me know if it helps. In the
    meantime, I'll
    try to go through your code, but like I said, today's a bit
    of a gong show
    for me.
    Sorry - I don't mean to just sluff you off or anything.
    Cheers,
    Brock
    "respondplease" <[email protected]> wrote in
    message
    news:[email protected]...
    > Hi Brock,
    >
    > Thanks again, your sample file really helps but I'm
    still having problems.
    > What it boils down to is that my buttons don't fully
    function properly. It
    > works correctly sometimes, but not consistently enough.
    So if I fast
    > forward
    > too much or rewind and then FF, the buttons aren't
    either isn't clickable
    > or
    > the hover text and caption box doesn't show up, etc.
    This usually happens
    > when
    > I press FF too many times or too fast. But regardless of
    how many times I
    > press
    > FF I would like my buttons to work
    >
    > Your sample file is very useful but unlike mine I have
    perhaps too many
    > MC's
    > w/in MC's, etc. I will try to clarify my setup in hopes
    of finding a
    > (better)
    > solution to my problems. My main timeline has my "prev",
    "next", and
    > "pause"
    > buttons which also has the actionscript for my NEXT
    BUTTON, PREV BUTTONS.
    > And
    > now I've added your SHOW BUTTONs function as well. I've
    minorly modified
    > your
    > showButtons function adding a couple of more lines and
    actually deleting
    > the
    > _root because I found that it doesn't work sometimes.
    Anyhoo, here it my
    > entire
    > code in one frame on my main timeline:
    >
    > // ===== NEXT BUTTON ===== \\
    > next.onPress = function() {
    > _root.screen.showButtons();
    > _root.createEmptyMovieClip("controller_mc", 1);
    > controller_mc.onEnterFrame = function() {
    > _root.screen.gotoAndPlay(_root.screen._currentframe+10);
    > if
    (_root.screen._currentframe+10>_root.screen._totalframes) {
    > _root.screen.gotoAndStop(_root.screen._totalframes);
    > }
    > };
    > };
    > next.onRelease = function() {
    > controller_mc.removeMovieClip();
    > _root.screen.showButtons();
    > };
    > next.onReleaseOutside = function() {
    > controller_mc.removeMovieClip();
    > _root.screen.showButtons();
    > };
    >
    > // ===== REWIND BUTTON ===== \\
    > prev.onPress = function() {
    > _root.createEmptyMovieClip("controller_mc", 1);
    > controller_mc.onEnterFrame = function() {
    > _root.screen.gotoAndStop(_root.screen._currentframe-10);
    > if (_root.screen._currentframe-10<1) {
    > _root.gotoAndStop("screen");
    > }
    > };
    > };
    > prev.onRelease = function() {
    > controller_mc.removeMovieClip();
    > };
    > prev.onReleaseOutside = function() {
    > controller_mc.removeMovieClip();
    > };
    > // ===== SHOW BUTTONS ===== \\
    > function showButtons() {
    > for (i=1; i<=6; i++) {
    > _root["b"+i]._visible = true;
    > _root["char"+i].removeMovieClip();
    > chars._visible = true;
    > cap.desc._visible = true;
    > cap._visible = true;
    > }
    > }
    > Still from my main timeline, my main1_mc is called from
    the frame labeled
    > "screen." My main1_mc has the b1 - b6 buttons which has
    the HOVER CAPTIONS
    > and
    > HIDE BUTTONS FUNCTION coding. And each button calls each
    movie clip ie.
    > char1_mc, char2_mc, etc. Here's all my code on one frame
    (in my main1_mc):
    > // ===== HOVER CAPTIONS =====
    > b1.onRollOver = function() {
    > _root.captionFN(true, "pick me!", this);
    > //display the function (true) or to hide the function
    (false)
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char1_mc", "char1",
    _root.getNextHighestDepth(),
    > {_x:595,
    > _y:345}); //this attaches movie to the _root timeline,
    and renames it to
    > "char1".
    >
    > _root.char1.swapDepths(_root.cursor_mc);
    > //swaps the depth that the cursor is on and the new
    movieClip is on. So
    > the
    > cursor will stay on top.
    > };
    > };
    > b2.onRollOver = function() {
    > _root.captionFN(true, "Hi!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char2_mc", "char2",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b3.onRollOver = function() {
    > _root.captionFN(true, "Get Jac'd Up!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char3_mc", "char3",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b4.onRollOver = function() {
    > _root.captionFN(true, "Boo!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char4_mc", "char4",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b5.onRollOver = function() {
    > _root.captionFN(true, "I'll be your guide", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char5_mc", "char5",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > b6.onRollOver = function() {
    > _root.captionFN(true, "Welcome!", this);
    > this.onRollOut = function() {
    > captionFN(false);
    > };
    > this.onRelease = function() {
    > hideButtons();
    > _root.attachMovie("char6_mc", "char6",
    _root.getNextHighestDepth(),
    > {_x:605,
    > _y:345});
    > };
    > };
    > _root.captionFN = function(showCaption, captionText,
    bName) {
    > if (showCaption) {
    > createEmptyMovieClip("hoverCaption",
    this.getNextHighestDepth());
    > cap.desc.text = captionText;
    > // cap._width = 7*cap.desc.text.length;
    > cap._alpha = 75;
    > if ((bName._width+bName._x+cap._width)>Stage.width) {
    > xo = -2-cap._width;
    > yo = -17;
    > } else {
    > xo = 2;
    > yo = -17;
    > }
    > hoverCaption.onEnterFrame = function() {
    > cap._x = _xmouse+xo;
    > cap._y = _ymouse+yo;
    > cap._visible = true;
    > };
    > } else {
    > delete hoverCaption.onEnterFrame;
    > cap._visible = false;
    > }
    > };
    > // ===== END OF HOVER CAPTION ===== \\
    >
    > // ===== HIDE BUTTONS FUNCTION ===== \\
    > function hideButtons() {
    > for (i=1; i<=6; i++) {
    > this["b"+i]._visible = false;
    > }
    > chars._visible = false;
    > cap.desc._visible = false;
    > }
    > Sorry for copying and pasting all my code - I know it
    must be annoying,
    > but I
    > can't seem to find what's wrong. Again, ANY help would
    be greatly
    > appreciated.
    > Thanks for your patience. Your talent is very much
    appreciated and I'm
    > very
    > grateful for all your help.
    >
    > Kindest regards
    >

  • Preventing a movie clip from resizing

    Hello:
    How can I prevent a movie clip from resizing while continuing
    to allow the main movie to resize.
    If this is impossible to do, knowing that would also be
    helpful information.
    Thank you in advance for any assistance offered,
    MyMorgaine

    Make an Album of the Photos and Videos and put them in the order you want. Then make a slideshow of that album.
    Regards
    TD

  • Random Movie Clips loop

    Hey there.
    I have a question about randomizing Movie Clips:
    I am attaching an example where 12 movie clips will be called
    into stage.
    (movieA1, movieA2, movieA3....)
    I am trying to create a situation where instead of triggering
    "movieA1" and so on, the code will trigger:
    movieA1 OR movieB1
    movieA2 OR movieB2
    movieA3 OR movieB3 and so on......
    can anyone help here with how to apply it?
    Thanks!
    note that the attached code triggers AllMovies (MovieA's),
    MovieB's are not in code yet, only in the library, because I am not
    sure how to code such a thing.
    adamlewen

    All I posted was a replacement to the corresponding
    attachMovie portion of your code... as you had in your first post.
    If I've made a correct allowance for the wrapping it should be in
    the 6th line of code beginning with
    var Movie:MovieClip = _root["Movie"+i] =holder.attachMovie
    etc
    What I suggested is only making a change to the first
    parameter to include a
    B or no B in the library ID that's requested by the
    holder.attachMovie part.
    The way its set up (if you use this changed attachMovie) it
    will randomise each time that makeAllMovies is called.
    If I was doing something like this I'd be inclined to set up
    the holder clips once. And then load the randomised content clips
    inside on the setInterval call to something like your makeAllMovies
    function. I also think you'd need to use removeMovieClip for
    previously attached content clips before attaching each time as I
    don't think it just replaces ("overwrites") the old one. I've seen
    other posts where if you attachMovie the same library item with the
    same name in the same holder clip, you end up with 2 instances
    (flash apparently appends a number to one of them each time). If
    this is indeed the situation and happened each time, it would
    probably cause some problems.
    Don't know if that helps. Kglad or others may have more
    insight in this area where I've indicated uncertainty.

  • Importing movie clips from internet

    I am trying to import some movie clips from the internet. Any suggestions? I tried saving on MAC HD and adding to iSquint, but when I import into iMovie, there isn't anything there. I have the same problem when I try to import clips from a movie (not video, a real movie) I have saved in iTunes. Any suggestions there?

    Try this great free, open source software.
    You can get it from the site or from Apple downloads.
    http://www.squared5.com/svideo/mpeg-streamclip-mac.html
    Run MPEG Streaqmclip.
    Click File > Open URL.
    Copy/Paste the URL of the video into the box.
    Click on File > Export to QuickTime.
    Use 'Apple Intermediate Codec'.
    Convert the movie and save to a folder on your desktop.
    Open iMovie and click File > Import Movies...
    Navigate to the folder.
    Create a new event, name it and import.

  • Accessing movie clip from flash swf file

    I have the situation where in flash i created a simple
    animated movie clip with few stop() commands on timeline. Movie
    clip consists of simple animatio played on roll over and on roll
    out which is controlled using actionscript. I loaded movie clip
    into flash using [embed] tag but actionscript code is stripped,
    there is no stop() action so movie clip loops continously. I guess
    that's normal behaviour for embedded flash swf files but i would
    like to know is there a way to still achieve that? Can i load swf
    some other way with its actionscript and then control movie clip
    from flex?

    You need the FLA's to open in Flash.
    You could download the free trial of a flash decompiler
    (www.sothink.com). The free trial won't give you actionscript, but
    it will give you all of the art in the swf.

  • Import home movie clips from DVD

    Hi all -
    I've been trying to wrap my non-computer brain around the process of importing a previously burned home movie clip from DVD back into iMovie so I can add to it. (I messed up the first burn, but because of limited space, I deleted the original clip.)
    I'd be happy to get it back to tape on my camcorder if that is the only way to do it, but I fear losing quality.
    I've downloaded Mac the Ripper and Streamclip, but I don't want to pay extra money for any software (I'm a poor, starving student mom).
    Can anyone help out?
    Christine.

    Your burned DVD uses MPEG-2 file format. You'll need more software:
    MPEG Streamclip (free).
    Apple's MPEG-2 PLayback Component ($20).
    Use Streamclip to open the DVD contents and export to DV Stream (huge file). Use the .dv file in iMovie.

  • How do I transfer movie clips from iPhoto to iPad?

    How do I transfer movie clips from iphoto on my iMac, to my iPad?

    You can use a USB flash drive & the camera connection kit.
    Plug the USB flash drive into your computer & create a new folder titled DCIM. Then put your movie/photo files into the folder. The files must have a filename with exactly 8 characters long (no spaces) plus the file extension (i.e., my-movie.mov).
    Now plug the flash drive into the iPad using the camera connection kit. Open the Photos app, the movie/photo files should appear & you can import.
     Cheers, Tom

  • How do I move Movie clips from iPhoto to I movie

    how do I move Movie clips from iPhoto to I movie

    I've found dragging & dropping onto desktop & then drag & drop into iMovie works okay

Maybe you are looking for