Rotating .FLV files within a movie

Hi all,
I'm new to Flash 8 and mostly interested in the IMporting and
linking to .flv files within a .swf movie. My question is:
Is there a way to have the .swf file randomly rotate a number
of .flv files? In other words - like being able to upload several
.flvs into a directory and the .swf randomly selects and plays one
of them per page refresh?
I hope I was clear - I'm not up on the lingo yet.
Thanks
Dodge

Dodge,
> I would be interested in knowing the method, David.
Happy to oblige.
> I'm puzzled that you chose to exclude this information
> from your reply. Have I broken a posting rule breached
> an ettiquette of some sort?
Dodge, you're absolutely fine. You haven't done a thing
wrong. I was
just being silly. I'm in here almost every day, and sometimes
I get a
chuckle out of answering exactly the question asked. I should
have been
more clear that I was teasing. Honestly, my apologies if I
caused any
headache.
So let's take a look at your goal. You have x-number of
external FLVs
available and would like your SWF file to choose one of those
at random to
display it. We can break this goal down into two parts: a)
loading
external FLV files and b) choosing an item randomly from a
list. Let's
start with the second part -- which you can use, by the way,
to choose
randomly from a group of JPGs, too, or even to jump to a
random frame label.
You'll need a bit of ActionScript for this, but I'll try to
make it
straightfoward. One of the many objects in ActionScript is
something called
an array. An array is essentially a list. Objects are defined
by something
called classes, which dictate the functionality of the object
in question.
The Array class defines all array objects, and we can produce
one to meet
our needs by using the following code. Put this in frame 1 of
your main
timeline.
var videos:Array = new Array();
The term var creates a variable. Our variable is arbitrarily
named
videos, of type Array. We use the expression "new Array()" to
produce an
Array instance (an object). The videos variable basically
points to this
object -- thing of it as your "handle".
The Array class defines a number of methods (things the
object can do).
Because our object is an instance of Array, our object has
available to it
all the methods described in the Array class. (You can read
about all these
classes in the ActionScript Language Reference, by the way --
excellent
reading!)
One of the methods is called Array.push(), which "pushes"
something into
the array.
videos.push("uno.flv");
videos.push("dos.flv");
videos.push("tres.flv");
So ... by invoking Array.push() on our object, we have added
the names
of three FLV files to the first three "slots" of our list.
These can be
retrieved later by uses square brackets and the desired slot
number. Arrays
start at zero, so the first element, uno.flv, lives here ...
videos[0];
... the second lives here ...
videos[1];
... and so on.
Next, we'll use the Math.random() method to generate a
random number
between zero and however many elements are in our array.
We'll get that
upper limit by using the Array.length property. Properties
describe the
characteristics of an object.
In our case, so far, videos.length returns 3, since there
are three
elements in our array.
Math.random() returns a random decimal number between zero
and one, so
if we multiply that by videos.length, then round the number
down to the
nearest integer, we'll have a random number that will choose
one of the
three slots in our array. To round down, we'll use the
Math.floor() method.
We'll store our chosen number in another variable.
var randomNum:Number = Math.floor(Math.random() *
videos.length);
This always returns either 0, 1, or 2, because of the number
of elements
in our array.
Now we can use the number stored in randomNum to access a
particular FLV
name.
videos[randomNum];
Makes sense, right?
Now, there are several ways to load an external FLV. The way
I
prefer -- though, of course, your needs may differ -- is to
forego any of
the Media playing UI Components and use a Video object as
described here ...
http://www.quip.net/blog/2006/flash/how-to-load-external-video
.. then use the expression videos[randomNum] (which returns a
string;
namely, the name of an FLV file) to describe the desired FLV.
Give this a shot and write back with specific questions, if
you have
any. The ease of this approach depends entirely on your
comfort level with
programming, so if you run into snags, don't hesitate to come
back.
I tease, but I don't bite.
David
stiller (at) quip (dot) net
Dev essays:
http://www.quip.net/blog/
"Luck is the residue of good design."

Similar Messages

  • How to Convert a .flv file to a .mov file with audio

    I want to convert a .flv file to a file that can be used on Youtube.  The .flv file runs fine (audio and video) in the adobe Flash player, but everything I try to conver the .flv file to a usable file on YouTube excludes audio.  The audio simply does cot convert.
    Suggestion greatly appreciated!!!!

    My suggestion is to ask your question in the right place.
    See the notice at http://forums.adobe.com/community/robohelp/robohelp_flash
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Saving files within a movie

    Hi,
    I am creating a movie that contains a gallery of thumbnail
    images. Hi-res versions of the images are in a folder on the CD. My
    client wants to be able to click on a given image & be able to
    save the hi-res version to a location on the harddrive. Is this
    possible? If so, how would I go about it? Is there a way (through
    lingo) to have the movie open a Windows explorer-type window
    accessing the images folder so the client could do a 'save as'?
    Thanks!

    There are a few xtras that can handle this sort of thing.
    FileIO is
    built in and free, but a tad difficult to use. My absolute
    recommendation is to use BuddyAPI which is freeto use up to 2
    functions,
    though you may need more depending upon what you want to do.
    You can
    download it here:
    www.mods.com.au/budapi
    There is a function called baGetFileName which will bring up
    the
    standard Windows dialog to get a filename. There are also
    commands to
    copy or move files.
    If your images are Director members, as opposed to external
    files on the
    computer, then you can easily make them into an external
    image with
    the free Sharp Image Export xtra:
    http://www.sharp-software.com/products/index.htm#sharpexport

  • How do I convert my .fla file to a .flv file?

    I guess the subject says it all. What I am trying to do is
    "insert>media>flash video" and it appears the only extension
    it will accept is .flv.
    Thanks!

    motleyscrewed wrote:
    > Ya know.. this makes no sense to me?? Isn't .flv an
    Adobe file format. Why the
    > need to jump through hoops... creating a .mov file from
    the original .fla file,
    > then creating a .flv file from the .mov file?
    >
    > Not only does it seem to make no sense that Flash CS3
    can't just make a .flv
    > file from the original, you also lose some video
    integrity & the file size
    > ended up larger then what I started out with. (or at
    least that's what happened
    > to me with my first shot)
    > I understand you are correct with your info... it just
    doesn't make sense at
    > all that Flash can't output a .flv file.
    >
    Well, Flash originally did not produce video. It's a vector
    based application which
    creates small size internet content. What it does tho, due to
    popular user demand, is
    allowing us to create Flash based video compatible file
    format, out of some other video
    source, which we can then be run within SWF file w/o the need
    of implementing other browser
    based players.
    Imagine if Flash was actually capable of producing video, all
    the tools it would require,
    editing abilities etc... and all possible export settings
    etc... every one would have different
    idea of what kind of video you could output. This would
    defeat the purpose of buying After Effects
    or Adobe Premiere. And yet it wouldn't be fully video
    dedicated tool so all of use would complain
    about the lack of some kind of features here or there. Best
    if the video is done else where and
    Flash only converts it to FLV. Adobe just want to protect
    other applications and not to worry about
    pleasing everyone.
    They have enough of trouble trying to move Flash back into
    Animators market because the last two
    versions are very programmers oriented, with very minor, if
    any, improvement on the timeline
    animation. CS4 is the first in long time that has some new
    stuff like Bones (kinetics) , 3d transforms
    etc...
    Does it make sense? I might not phrase too well what's in my
    head but it make sense to me :)
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Flash flv file problems

    I don't know if this is a fault on my part or not, it probably is though. I have been at this for over two days now, trying to figure out a way to do convert quicktime to swf.
    I managed to create a flv file of the movie, the audio and video works with it. However when brining it into flash, the video time stretches so much that it's incredibly slow. Oddly enough the audio stays the same. I can export it as a swf after publishing it, but I don't like how messed up the audio and video are.
    Is there a way to restretch the video in Flash? Or any other solution you can think of. I really need help as I have exhausted all resources that I can possibly think of. I am an amateur at best with these programs. Thank you for any help...

    The biggest issue with out of sync audio/video when "embedding" an flv into the main timeline is that the frame rate of the Flash doc is not set to exactly the same frame rate as the video. So if the video was shot at 29.97 frames per second, you need to set the Flash doc to exactly that, 29.97. And unless there are some Internet download connection speed issues, it pretty much keeps the audio/video synced.
    It only makes sense that playing a 29.97 video file in a 15 frames per seond Flash doc will slow the video display way down, since one frame of video equals one frame in Flash... but the audio part just plays at normal speed... otherwise it would be way distorted, like playing a tape/record in slow motion.
    Here's a short sample video embedded directly into the timeline in a Flash doc set to 29.97 frames per sec:
    http://www.cidigitalmedia.com/tutorials/sync.html
    That being said, I would still not recommend embedding video into the main timeline except under special circumstances. Use the FLVPlayback component or NetStream to play an external video.
    Best wishes,
    Adninjastrator

  • HT4527 I recently moved my files from windows xp to a new windows 8.1 pc using PCMover Express. When I open up a file within itunes, the music doesn't start in itunes, it starts in xbox music player. How do I move my itunes file so it opens in itunes?

    I recently moved my files from a windows xp pc to a new widows 8.1 pc using PC Mover Express. When I open up a file within the itunes folder, it opens to the default player xbox 360 media player. How do i transfer my itunes folder so it opens up in my itunes account?

    Hi kozzie17,
    If your music is no longer opeing in iTunes by default on your Windows machine, you may find the following article helpful:
    iTunes for Windows: How to make iTunes the default application for music and audio files in Windows Vista and Windows 7
    http://support.apple.com/kb/HT3202
    Regards,
    - Brenden

  • Why cant I import M4V or FLV files into my I-Movie video? Please HELP!

    I just got the new Mac Desktop and REALLY hate that I cant drap and drop videos into the newer (i-Life11) -Imovie like I was used to since 2010. Seems to only work for photos. Is there a way around that?
    So I am making a church youth group video where I have spent HOURS trying to get parts of Youtube videos into the video to show them.  I have 2 forms saved on my desktop thanks to the software -   i have a FLV video and a M4V - both converted.  The Imovie already has plenty of clips that are M4V in them so I know it will take that form.  It just wont let me import them..they are there but are not accesible (they are 'faded') under the File/Import/Movies/Desktop  or File/Movies/RealPlayerDownloads.  They aren't darkened and  and I cant do anything with them.
    What am I doing wrong?
    HELP please.   Thanks for input. 
    Frustrated volunteer who has spent too many hours on this!!!
    Keri

    Use MPEG Streamclip to convert them to DV. In the case of the FLV file, this requires installing Perian.
    (71091)

  • Can you manually move files within a folder to put them in a specific order?

    I am new to mac, I was wondering if there is an app maybe that you could move files within a folder (ie photos) to make them in a specific order and then rename them, I used to be able to do this with my windows xp..... cant seem to make it happen with my new macbook pro and from what i can gather it cant be done? can it? Thanx in advance.........

    Thomas, I have set the view to maunally but when i move the icons they return to where they were sitting..?
    In the Finder? You probably have a sort selected in the Sort By submenu in the View menu. However, the order of icons in icon view won't have any influence on the order of the images in the slideshow, I think. Use iPhoto, this is one of the things it's made for, the Finder is not.

  • Can't move image files within Bridge

    I recently bought an iMac and got the CS5 license transferred over to the Mac platform. Got CS5 loaded and everything works except for one critical thing: I can no longer move image files within Bridge. When I do the right click on an image file to select that command, the command is "grey" and won't let me to choose it.  So I am forced to rearrange my image files through the Mac's Finder/Pictures feature.  Drag and drop doesn't work either.  I have looked everywhere for a setting that would allow movement of files to different folders and rearrangement within Bridge, and can't find one.  I have Bridge set as my default for photos and not the lame iPhoto program on Macs.  I previously was to be able to freely use Bridge for organizing my photos on a PC and now sorely disappointed that I can't do this with my new iMac.

    I previously was to be able to freely use Bridge for organizing my photos on a PC and now sorely disappointed that I can't do this with my new iMac.
    No need for disappointment because you can move all files freely within Bridge.
    First check if you have read and write permissions for your files/folders/disk (try move the files using finder) If Finder allows you to drag the files to the location you previously wanted in Bridge then the problem lies in Bridge.
    First select a file and with right mouse click menu choose purge cache for selection. If the problem is gone you could do so for the whole folder using menu tools/cache/purge cache for folder while having Bridge pointed to that folder.
    If not restart bridge holding down option key and choose reset preferences.
    could you report back?

  • How do I convert my iphone videos (.mov) to .flv files?

    How do I convert my iphone video (.mov) to .flv files?

    Or try to search in the App Store.
    I am using ifunia media-converter, the one that got from Mac App Store, successfully converted dvd and HD video for me, seems it support converting mov to flv.

  • How to place a Flash swf file with a movie FLV file embedded in DW

         My hair is getting shorter by the hour or maybe missing.  I have created a SWF file with Flash 8 that has an embedded FLV file that was created from a MP4 file.   The SWF file works perfectly in FLASH including my Flash nav buttons, and the movie with soundtrack and the buttons for control of volume and start stop.  Now I am ready to place it on the web using DW to make the html page.  What happens when I test the page on FireFox or IE is the background loads, the buttons load but do not work properly anymore but worse than that:  The slide show and the control buttons do not even show up. 
         I am also having trouble defining my site locally.  I select new site and tell it where every thing is but no luck. All in the same directory, right now I have a image directory but I have not used them on the page as the only image is a jpg and flv file and they are embedded in the swf file.
         I know this is 2 different programs but the Flash files need to be placed in a HTML file to be uploaded, and I have to text them first.
    HELP
    Randy

    from the Premiere Pro Help section about importing SWF files:
    " Interactive content and scripted animation are not retained. Animation defined by keyframes in the main, top-level movie is retained."

  • How to convert .flv files to .mov?

    Source file = .flv downloaded from Twitch TV
    Need = to convert the .flv file to a format that I can edit in Final Cut Pro 10.0.6
    End Result Desired = to posted editted version in format that will play on YouTube
    OS = Mac 10.8.2
    When I download the .flv file, the audio and video play fine in Adoble Flash Player 1.8.   I have tried just ablout every Mac  .flv converter I can find and all convert the .flv video to other formats, but the Audio is never included.  I cannot figure out why the audio does not come over.
    Any suggestions would be greatly appreciated

    I've been reading so many different forums on how to convert FLV to MOV. Finally, I summarized three solutions:
    First one: HandBrake . This tool is a free and open-source multi-threaded transcoding app.
    Cons:
    1. HandBrake is too professional to handle for most people;
    2. It doesn't support MOV as output format.
    Second one: there are many third party software which supports converting FLV to MOV.I highly recommend iDealshare VideoGo which can batch convert FLV to MOV much easier, faster on Mac or Windows Cons:
    1. Most of them are not free.
    Third one: Online-Converter . This kind of converter does a great job on file conversion.
    Cons:
    1. Like most online converters, the free version of this tool only allows you to convert videos smaller than 100MB. It's too small for video conversion;
    2.Your MKV video should be upload to the internet to be converted. This means the risk of pravite information leak is possible.

  • On my mac I have both Quicktime X and Quicktime 7 pro. Both applications seem to be crashing quite often lately. This happens when playing all files types. I notice it more with .flv file. It usually happens when i grab the time slider bar and try to move

    On my mac I have both Quicktime X and Quicktime 7 pro. Both applications seem to be crashing quite often lately. This happens when playing all files types. I notice it more with .flv file. It usually happens when i grab the time slider bar and try to move it. The apps will freeze and I have to "force quit" to get them to close. Sometimes putting the computer to sleep and waking it up helps. Is there a way to remedy this?

    Oops, I needed to update my profile. I have snow leopard now

  • HT3775 is there a player that will play a 2.flv file movie on my macbook pro with system os x lion 10.7.5

    Is there a player that will play a 2.flv file movie on my macbook pro with os x lion 10.7.5

    http://www.videolan.org/ 's VLC

  • How to convert a .flv file into a Youtube sharing .mov file via Compressor?

    I'm trying to convert a .flv file into a Youtube sharing .mov file via Compressor but every time I submit it, it fails due to error code -50. It worked two hours ago (albeit, very slowly) with another .flv file but now it refuses to even try. Please help!

    Sorry you're having problems, but it's not surprising. The error code is invalid media.
    The easy way is to forget about Compressor and upload the Flash file directly to You Tube with their uploader.
    You'll also save a generation of compression loss.
    Good luck.
    Russ

Maybe you are looking for

  • Is it possible to call a custom method in App Module from a backing bean?

    I would like to know if a custom method in App Module can be called from inside a backing bean. I am not sure if it is logically right to call, from a backing bean, a custom method in App Module. But would like to know if that makes sense or if it is

  • APEX Dicom Sample zip file is corrupt.

    The File dicom-1-133417.zip of DICOM samples in APEX packed applications is CORRUPT! This is the page (DICOM sample) http://www.oracle.com/technetwork/developer-tools/apex/application-express/packaged-apps-090453.html#DICOM Please , somebody from ora

  • Adhoc query selection issue

    Hi, When I use Adhoc query if "switch on object selection", found there's no selection option for IT2011(refer to screenshot), who do you know why, how to correct it?

  • Command line for Acrobat Reader

    Hello In an application in VB.NET, I throw open a PDF file using the reading program by default in Windows Is there a command line that can be open it without the left column? Thank you for your response Claude Azoulai

  • Now that 10.4.6 is out, let's review the upgrade steps

    Every update ever made for Mac OS X has basically been troublefree for me and many others who followed these steps. I am posting this here in the hope of avoiding people posting as many 10.4.6 has killed my computer posts. 1. Backup your data. If uns