Load random flv

This is my catch 22 ...
Im trying to load random flv's into my mc. I cant seem to figure out how to loop random flv's.  Currently, it plays a random flv the 1st time, plays a random flv the 2nd time around, but the 3rd time (and so on) it loops the same 2nd flv.  I need it to constantly loop random flv's every time.  Any suggestions? 
var randomNum:Number=Math.random();
var connection:NetConnection = new NetConnection();
var stream:NetStream;
var video:Video=new Video(stage.stageWidth,stage.stageHeight);
var metaObj:Object = new Object();
var isPaused:Boolean=true;
connection.connect(null);
stream=new NetStream(connection);
stream.client=metaObj;
metaObj.onMetaData=onMetaData;
function onMetaData(data:Object):void {
video.attachNetStream(stream);
mc.addChild(video);
//load background video
function videoInit():void {
     if (randomNum<=.333) {
          stream.play("clipA.flv");
     if (randomNum>.333&&randomNum<.666) {
          stream.play("clipB.flv");
     if (randomNum>=.666) {
          stream.play("clipC.flv");
videoInit();
function videoLoop(stat:Object):void {
     if (stat.info.code=="NetStream.Play.Stop") {
          if (randomNum<=.333) {
               stream.play("clipA.flv");
          if (randomNum>.333&&randomNum<.666) {
               stream.play("clipkB.flv");
          if (randomNum>=.666) {
               stream.play("clipC.flv");
     stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
Thanks in advance!

First, you can shorten code and remove function videoLoop altogether. As for random issue, you need to reset random number to a new one - I don't see other issues with it. See code below:
import flash.events.Event;
var randomNum:Number;
var connection:NetConnection = new NetConnection();
var video:Video = new Video(stage.stageWidth, stage.stageHeight);
var metaObj:Object = new Object();
var isPaused:Boolean = true;
connection.connect(null);
var stream:NetStream = new NetStream(connection);
stream.client = metaObj;
metaObj.onMetaData=onMetaData;
function onMetaData(data:Object):void {
video.attachNetStream(stream);
mc.addChild(video);
videoLoop();
function videoLoop(stat:Event = null):void {
     if (!stat || stat.info.code == "NetStream.Play.Stop") {
          randomNum = Math.random();
          if (randomNum <= .333) {
               stream.play("clipA.flv");
          else if (randomNum > .333 && randomNum < .666) {
               stream.play("clipkB.flv");
          else {
               stream.play("clipC.flv");
    stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);
Also, you may want to reconsider how you reference videos and put the into an array and choose from it - this is more scalable:
import flash.events.Event;
var videoArray:Array = ["clipA.flv", "clipB.flv", "clipC.flv"];
var connection:NetConnection = new NetConnection();
var video:Video = new Video(stage.stageWidth, stage.stageHeight);
var metaObj:Object = new Object();
var isPaused:Boolean = true;
connection.connect(null);
var stream:NetStream = new NetStream(connection);
stream.client = metaObj;
metaObj.onMetaData=onMetaData;
function onMetaData(data:Object):void {
video.attachNetStream(stream);
mc.addChild(video);
videoLoop();
function videoLoop(stat:Event = null):void {
     if (!stat || stat.info.code == "NetStream.Play.Stop") {
          stream.play(videoArray[Math.random() * videoArray.length]);
     stream.addEventListener(NetStatusEvent.NET_STATUS, videoLoop);

Similar Messages

  • Load random FLV with NetStream

    Dear Adobe members,
    I'm puzzeling for days on this one. I'm a bit of a noob so please help me
    I want to create a videowall in a grid of 7 x 7 flv's.
    In this grid, the flv's have to be loaded at random and when finished, a new
    random flv has to be loaded and played.
    I've come so far that I have a MovieClip that loads an flv at random and then
    loops it, but it loops the same video, not a random new one.
    Can anybody help me out please?!
    The code:
    var video:Video = new Video();
    addChild(video);
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.client = {onMetaData:ns_onMetaData, NetStatusEvent:ns_onPlayStatus};
    var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
    // Function that gets a random video from the array
    function getRandomVideo():String {
    return video_array[Math.floor(Math.random() * video_array.length)];
    video.attachNetStream(ns);
    ns.play(getRandomVideo());
    function ns_onMetaData(item:Object):void {
    // Resize video instance.
    video.width = item.width;
    video.height = item.height;
    // Center video instance on Stage.
    video.x = (stage.stageWidth - video.width) / 2;
    video.y = (stage.stageHeight - video.height) / 2;
    //loop the video
    function ns_onPlayStatus(event:NetStatusEvent):void {
    if(event.info.code == "NetStream.Play.Stop"){
         ns.seek(0);
    ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus);
    Thanks!

    For those who want to know how I solved it:
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.bufferTime = 0;
    ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
    var video_array = new Array("Scenes/001.flv", "Scenes/002.flv", "Scenes/003.flv", "Scenes/004.flv");
    // Function that gets a random video from the array
    function getRandomVideo():String {
    return video_array[Math.floor(Math.random() * video_array.length)];
    ns.play(getRandomVideo());
    var vid:Video = new Video(182,137);
    vid.attachNetStream(ns);
    addChild(vid);
    function asyncErrorHandler(event:AsyncErrorEvent):void{
    // ignore error
    // loop video
    ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus)
    function ns_onPlayStatus(event:NetStatusEvent):void{
    if(event.info.code == "NetStream.Play.Stop"){
    ns.play(getRandomVideo());
    ns.seek(0);

  • Please help me load an .flv video that has been embeded onto a web page

    Hello there,
    I was hoping someone on this forum could please help me with one specific problem that I am having. I would like to embed the a flash player into an html page, and load the video from a service that has the streaming video provided.
    This is the context of the situation...
    We have created a site that was to be used on a showroom floor (no internet connection) and loaded the .flv videos at the local root level for the site.
    Now however, we would like it to be an online site. I have been able to use the flash "jw player"to load videos to play using the shadowbox javascript, but when I try to embed it onto a page and have it play, it isn't working and I am not sure why.
    Below is the code that is currently working to load the videos on the local root level.
    Might someone have any ideas on what I need to replace to have it load the videos from the streaming service?
    I would greatly appreciate any assistance that could be provided.  I can also provide a URL if it would help.
    I would GREATLY appreciate any assistance provided.
    <script type="text/javascript" src="swfobject.js"></script>
    <script type="text/javascript">
    swfobject.registerObject("player1","9.0.98","expressInstall.swf");
    </script>
    <object id="player1" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="640" height="380">
    <param name="movie" value="player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="flashvars" value="file=assets/videos/Bob_Peebler.flv&image=images/videoStatic_Peebler.jpg" />
    <object type="application/x-shockwave-flash" data="player.swf" width="640" height="380">
    <param name="movie" value="player.swf" />
    <param name="allowfullscreen" value="true" />
    <param name="allowscriptaccess" value="always" />
    <param name="flashvars" value="file=assets/videos/Bob_Peebler.flv&image=images/videoStatic_Peebler.jpg" />
    <p><a href="http://get.adobe.com/flashplayer">Get Flash</a> to see this player.</p>
    </object>
    </object>

    Hello,
    Thanks  a lot for the reply.  However, I am pretty confident that the jw player supports the streaming video option, but as I mentioned that I was able to use it as a popup using the shadowbox javascript before. After doing a bit of investigating on how the videos are hosted, I am using "progressive download" method for these videos.
    I think the problem is that the player.swf is hosted on my website server -  and the videos are then hosted on the media hosting service.  I think that the player needs to be located on the media hosting service, and then embedded onto the page along with where to point to the .flv video.  Does that sound right?
    If so, the paramater I am using to embed the player as I mentioned in my original post is simply:
    <param name="movie" value="player.swf" />
    does the "value" then have to change to the http:// address for the video player.swf that would then be hosted on my video hosting service?
    Little help?
    Please let me know if there is anything I can provide to clarify the issue.
    Thanks
    M

  • NaN with loading external flv

    Hi all
    I'm having some strange diffulties which I can't solve.
    I'm starting off with a website.swf which loads different
    external swf's depending on the button that has been pressed.
    One of those swf's is a file with different buttons to load
    different external flv's.
    While loading a flv a progressbar shows the percentage of the
    loaded part of the flv
    Now: If I play the first video file everything works fine
    While switching to another button to load another flv during
    the loading of the first flv, My percentage says NaN. and stops
    loading.
    On each button I say:
    on (press) {
    stream_ns.close();
    connection_nc.close();
    _parent.videoloader_mc.unloadMovie();
    on (release) {
    _parent.videoloader_mc.loadMovie("movies/binnenkomers01.swf");
    This is the part I use for loading a flv in f.ex
    binnenkomers01.swf.
    stop();
    delete _global.loaded_interval;
    delete _global.connection_nc;
    delete _global.stream_ns;
    delete _global.pctLoaded;
    // video URL
    video1_url = "movies/binnenkomer06_Floriane.flv";
    _global.connection_nc = new NetConnection();
    connection_nc.connect(null);
    _global.stream_ns = new NetStream(connection_nc);
    videoholder_mc.video.attachVideo(stream_ns);
    stream_ns.play(video1_url);
    stream_ns.seek(0);
    // Zet de video op stop om te wachten tot hij volledig is
    ingeladen
    stream_ns.pause();
    _global.playstatus = "pauze";
    play_pauze_mc.gotoAndStop("pauze_lb");
    this.createEmptyMovieClip("progressBar_mc",
    this.getNextHighestDepth());
    progressBar_mc.createEmptyMovieClip("bar_mc",
    progressBar_mc.getNextHighestDepth());
    with (progressBar_mc.bar_mc) {
    beginFill(0xCCE6FF);
    moveTo(0, 0);
    lineTo(300, 0);
    lineTo(300, 23);
    lineTo(0, 23);
    lineTo(0, 0);
    endFill();
    _xscale = 0;
    progressBar_mc.createEmptyMovieClip("stroke_mc",
    progressBar_mc.getNextHighestDepth());
    with (progressBar_mc.stroke_mc) {
    lineStyle(0, 0xCCE6FF);
    moveTo(0, 0);
    lineTo(300, 0);
    lineTo(300, 23);
    lineTo(0, 23);
    lineTo(0, 0);
    progressBar_mc._x = 640;
    progressBar_mc._y = 400;
    this.createTextField("loaded_txt",
    this.getNextHighestDepth(), 0, 0, 200, 22);
    loaded_txt._x = 645;
    loaded_txt._y = 405;
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.color = 0x333333;
    my_fmt.font = "Verdana";
    my_fmt.size = 9;
    my_fmt.align = "left";
    _global.loaded_interval = setInterval(checkBytesLoaded, 500,
    stream_ns);
    function checkBytesLoaded(stream_ns) {
    trace("my_ns.bytesLoaded: "+stream_ns.bytesLoaded);
    trace("my_ns.bytesTotal: "+stream_ns.bytesTotal);
    _global.pctLoaded =
    Math.round(stream_ns.bytesLoaded/stream_ns.bytesTotal*100);
    trace("_global.pctLoaded: "+_global.pctLoaded);
    loaded_txt.text = "loading... "+pctLoaded+"%";
    loaded_txt.setTextFormat(my_fmt);
    progressBar_mc.bar_mc._xscale = pctLoaded;
    if (isNaN(pctLoaded)) {
    clearInterval(loaded_interval);
    } else {
    trace("OK");
    if (pctLoaded>=100) {
    clearInterval(loaded_interval);
    Hope you guys can help me....

    Maybe they have hotlink protection enabled
    "indierockmedia" <[email protected]> wrote
    in message
    news:f3c4mo$ddn$[email protected]..
    > Hi, I am having trouble with some loading issues. I
    design ecards for
    > bands and
    > their tour dates, bio, and video files all load external
    files (text files
    > for
    > bio/tour, flv files for the video, and an swf skin file
    for the video).
    > Its
    > only a problem when I have to embed those ecards into
    sites that don't
    > host the
    > ecard. I have used crossdomain.xml and every fix ive
    read about, and still
    > have
    > issues. Let me detail below:
    >
    > For example, I have an ecard for a band at
    >
    http://bandwebsite.com/ecard/ecard.swf
    > The tour and bio and video files load simply "tour.txt,
    bio.txt,
    > video.flv,
    > skin.swf"). Works great because no external servers are
    being called.
    >
    >
    But when I want to embed the file elsewhere, or use different
    domains,
    > I
    > have issues:
    > I want to embed the ecard on to
    http://www.otherwebsite.com,
    so I can't
    > have
    > it simply call "tour.txt" for example, the ecard will
    think the tour file
    > comes
    > from www.otherwebsite.com/tour.txt. So I call the full
    path
    >
    http://bandwebsite.com/ecard/tour.txt
    > I go to the ecard and click the button to load the tour
    dates. The text
    > box
    > that worked before says "undefined". So I put a cross
    domain file at the
    > root
    > of
    http://bandwebsite.com that
    allows access to files from
    > www.otherwebsite.com. Still getting undefined. I go to
    the embed code for
    > flashobject and have allowscript access to "always".
    Still undefined. I go
    > and
    > add System.security.allowDomain to my timeline and
    specify
    > www.otherwebsite.com. Still undefined. Still won't load
    my video or video
    > skin
    > and text files.
    >
    > Am I missing something?
    >
    > mikey
    >

  • Load random iframe

    Hi: I would like to know if anyone can help me with this
    issue:
    I'm developing a web site with an iframe in the center of its
    main content with featured products.
    I want the index.html, where the iframe it's included, to
    change it every time the page reloads, loading random htmls from a
    specified folder to display in the iframe area.
    I don't know if I'm clear enough... perhaps my English is not
    very good. I would appreciate any help. Thanks a lot.

    javichampagne wrote:
    > Hi: I would like to know if anyone can help me with this
    issue:
    >
    > I'm developing a web site with an iframe in the center
    of its main content
    > with featured products.
    >
    > I want the index.html, where the iframe it's included,
    to change it every time
    > the page reloads, loading random htmls from a specified
    folder to display in
    > the iframe area.
    >
    > I don't know if I'm clear enough... perhaps my English
    is not very good. I
    > would appreciate any help. Thanks a lot.
    >
    Does your server support a server langauge like php?
    If so insert the following piece of php code into the top of
    your page.
    1,14 being the number of files in your specified folder,
    change it to
    suit how many files there are ie (1,5) (1,8) (1,11) etc
    <?php
    // Set the lowest & highest numeric point in you series
    names of your
    includes files
    $sl = rand(1,14);
    ?>
    Then insert this in the table cell or <div> where you
    need the random
    file called in
    <?php
    include ('random_pages/file_'.$sl.'.php');
    ?>
    'random_pages' being the folder name the files are in. Name
    the files in
    the folder file_1.php, file_2.php, file_3.php etc
    Obviously you need php running on a server but you can use
    other server
    languages as well but youll have to google to find out some
    code. I'm
    sure it works similar.

  • Load random swf but not same

    someone here helped with the code to load random SWF files
    into a movie clip...however, i need to make sure it doesnt load the
    one that's already playing, that it goes on to a new one
    everytime..

    i dont think saying thank you really does it, but really,
    thank you.. you've helped me countless number of times, and it's
    only made me better at what I do, so I really am great full .
    Thanks again

  • Existing 'load external .flv' code?

    Recently, I found a great little Flash  project that acts like a jukebox for external mp3 song files, and am using it on my website to play my song demos.
    I'm now trying to find if there is an existing solution like that for video.  I just need some way to progressively download video files from my webspace when the thumbnail is clicked... and am now looking into some sort of Flash jukebox.
    I've tried just embedding the video files into HTML, but they don't progressively download for some reason (even though they are saved as Progressive With Compressed Header).  I've even tried using prettyPhoto (...a script that mimics a Lightbox like feature, where the whole page dims, and a floating window appears over your site, displaying any media, and allowing you to move back/forth through your list of media)..... works great, but again, not a progressive download, so you stare at a blank screen for a while.
    Seems the only way it works is if I have the file on YouTube or some other site, then embed it or use the prettyPhoto app.
    So, can someone either tell me how to make the embedded file download (OT, but I figured I'd ask), or point at some existing Flash file that serves as a video jukebox, showing all media on a common window?

    Hi,
    You can load external .flv files which is placed on your web server. You have to add a small amount of AS3 code into your flash document. Please click on the below link
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html
    Please use the sample code which is provided in the bottom of the page. In the code, you will find a line
    private var videoURL:String = "Video.flv";
    In the above line, instead of "Video.flv", you have to give your webserver path like http://www.domainname.com/foldername/videofilename.flv
    (The above code does the progressive download of an video)
    You can play the video through progressive download, by click on an image. To achieve that, you need to place the above code inside the mouse click function of an image.
    Thanks

  • What is the best way to repeatedly load random commercials?

    Hi Everyone,
    Any help with the above question would be useful.  Here's my end goal: I want to display commercials on a screen at my wife's bakery.  The script should load one commercial, play it, then unload it, randomly load another, and so on.
    I am completely new to as3 and have unsuccessfully been following several online tutorials.  My first attempt had code in each commercial file (swf), that randomly called up another commercial, which in turn called up another file, and so on--but this became a memory hog and crashed the program after a few minutes.
    Since then I have created one main swf file that loads an xml file, which holds all the information for the commercials.  However, when the swf commercials are loaded according to the xml file, they don't play properly: when the first commercial finishes playing, the next one is already partially done.  Obviously it started playing earlier.  The swfs should unload and load the next according to a timer, with the length of the timer being different for each swf according to the xml data.  Even with this, the first swf didn't always stop when it should.  My code is getting complicated and the display looks sloppy.
    I think something like this should be a simple way to display media such as these commercials, but I still haven't found a working solution.  Now I'm wondering if I'm even approaching this wisely.
    Would it be better to convert the swf to flv and create an flv player that has 'continuous play' and 'shuffle' features?  Would it be better to convert each swf into movieclips and put them all into one swf?  (I like the manageability of using an external xml file; I will be adding and removing commercials frequently and want to keep this as simple as possible.)
    Please let me know what you think is the wisest approach and refer me to any relevant tutorials.
    Peace,
    Trevor

    Thanks again kglad,
    I followed your advice, but it is still not working properly.  Here's my problem:
    The external swfs continue playing in the background.  Consequently, the event "playcomplete" was dispatched not only at the end of the swf that is being shown, but also at the end of the looping, previously loaded swfs that are not visible; this made the next swf play before the one being shown finished.  That seemed easy enough to fix by adding stop(); to each external swf on the last frame.  I thought everything was fixed -- but those swfs must still be there and are hogging memory before they can be collected for garbage. I've developed a loop that continues to load swfs, taking more and more memory, eventually causing a crash.  So:
    After a swf is loaded, how do I completely remove it to free up memory?  I'll attach the code I'm using, but I've made some adjustments to your previous examples (using a string with a random number instead of an array, using different variable names, etc).  Would I still have this memory problem if I used an array?  I have tried to remove eventListeners, to use weak eventListeners, and to remove the loaded Child as best as I know how, but I need some guidance on memory management before I can use this.
    Peace,
    Trevor
    var swfLoader:Loader = new Loader();
    var klaesiSwfs:XMLList;
    var totalSwfs:Number;
    //var swfArray:Array = ["swfs/movie1.swf", "swfs/movie2.swf", "swfs/movie3.swf", "swfs/movie4.swf", "swfs/movie5.swf"];
    //loads xml//
    var klaesiXmlLoader:URLLoader = new URLLoader ();
    klaesiXmlLoader.load(new URLRequest("xml/swf_depot.xml"));
    klaesiXmlLoader.addEventListener(Event.COMPLETE, processXML, false, 0, true);
    //finds how many swfs are on xml//
    function processXML (e:Event):void{
         var klaesiXml:XML = new XML(e.target.data);
         klaesiSwfs=klaesiXml.ID;
         totalSwfs=klaesiSwfs.length();
         //trace ("Total is " + totalSwfs);
         loadRandomSwf();
         klaesiXmlLoader.removeEventListener(Event.COMPLETE, processXML)
         klaesiXmlLoader = null;
    //loads swfs//
    function loadRandomSwf():void {
         var num:Number = (Math.floor(Math.random() * totalSwfs) + 1);
         var swfName:String = "swfs/movie"+ num +".swf";
         var requestSwf:URLRequest = new URLRequest (swfName);
         swfLoader.load(requestSwf);
         addChild(swfLoader);
         swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, playComplete, false, 0, true);
    //listens for the end of each swf//
    function playComplete(e:Event){
         MovieClip(swfLoader.content).addEventListener("playNextCommercial", nextSwf, false, 0, true);
         swfLoader.contentLoaderInfo.removeEventListener(Event.COMPLETE, playComplete)
    //removes old swf, starts new swf//
    function nextSwf(e:Event){
         MovieClip(swfLoader.content).removeEventListener(Event.COMPLETE, nextSwf);
         removeChild(swfLoader);
         loadRandomSwf();

  • Random FLV from an SMIL Playlist

    I have been trying to find a way to randomly select an flv
    file to play in a 400x100 signature I have for some of my forums.
    There is no user control on this swf besides onRollOver to start
    the flv and onRollOut to pause it. What I want to achieve is
    whenever the swf is loaded that it will randomly select an flv from
    a playlist. From what I have read, SMIL is the best format to use
    with FLVPlayback. All I should be needing to do is typing in the
    SMIL URL into the concenturl inside the properties of the
    FLVPlayback. However, this doesnt work. I also haven't a clue how
    to actually randomize it. I could not find anything regarding the
    required code used in SMIL to randomize the playlist.
    Any help, hints and clues would be very appreciated as this
    has stumped me for quite some time.

    If I am listening to my Shuffle in random/shuffle
    order and come to a song from an album I want to hear
    more of, can I switch it to Playlist order and hear
    the rest of the songs in order of the playlist?
    I believe that's the way it's supposed to work... WHY not TRY it?

  • Loading random .swf's in html page

    Desired scenario: I have a site which I want random .swf
    files to load into index page each time a user refreshes or visits
    the site.
    Solution: I used a Javascript array solution in the .html
    page. Note: it works perfectly in Firefox and Safari.
    The javascript code for that is listed below.
    Problem: In IE, the page which is supposed to load the
    random .swfs in blank. I tried to solve the problem by using an IE
    conditional statement with a single .swf embedded (so at least
    visitor could have interactive experience).
    <!--[if IE]>
    <object
    classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
    width="800" height="600">
    <param name="movie" value="drinks.swf" />
    <param name="quality" value="high" />
    <embed src="drinks.swf" quality="high" pluginspage="
    http://www.macromedia.com/go/getflashplayer"
    type="application/x-shockwave-flash" width="800"
    height="600"></embed>
    </object>
    <script type="text/javascript"
    src="fixit.js"></script>
    <![endif]-->
    Any help would be appreciated. The link to the site in
    question is:
    http://www.jayminnickinteractive.com

    Thank you for checking. Yes right now they are all working.
    But many times I visit the flv's don't load - i wonder if it is a
    flash thing or more connected to my web host.
    Gary

  • How to use Javascript to load random pages?

    I wonder if anyone knows how to use Javascript to load a list
    of links stored in the text file.
    Every address will take a line, and the Javascript will
    randomly select one of the addresses to load.
    The user will click the button "random" and access the page
    randomly selected by the script.

    Addition note:
    I forgot to say this because my computer froze......(how
    lame)
    I got the code for random accessing the links.
    But now the problem is, is there anyway to parse a text file
    into the array in Javascript?

  • Load Random Image in Flash?

    I've googled it and searched this forum. No luck.
    Does anybody know how to load a random image in flash. Like
    on a welcome screen (i.e. the first thing that shows up in my
    timeline with a stop command on it)
    I tried this:
    http://www.kirupa.com/developer/mx/loadingrandombackground.htm
    but can't do this where you are supposed to paste the code in
    Actions: "Now, look at your timeline. Right click on a blank
    keyframe in the timeline and select Actions. Copy and paste the
    following code: "
    seems like i have to add something first like adding a
    behavior like "goto URL" or "stop" or "goto frame" if you know what
    i mean.
    what do i click on???????????????????? to add this code into
    Actions.
    Thanx.

    let say you have 20 images file in jpg format, all at the
    same directory with your flash file, with file name as below:
    pic1.jpg
    pic2.jpg
    pic20.jpg
    in your flash, select the frame which you wan to load a
    random image, type script below:
    num = Math.ceil(10*Math.random());
    filename = "pic" + num + ".jpg";
    _root.createEmptyMovieClip("pic_mc", 1);
    loadMovie(filename, "pic_mc");
    //good luck

  • Load Movie, FLV not showing up

    I'm publishing to Flash Player 8 from CS3. I have a MC placed
    on main timeline that loads an external MC onto level 10 of the
    main timeline.
    code:
    on(release){
    loadMovieNum("video60.swf",10);
    The external mc, "video60.swf" is linked to an FLV file. The
    FLV, SWF and the "AC_RunActiveContent.js" are definitely uploaded
    to the web server. When I preview in Flash locally it all works
    fine. When I open the file locally in a browser (same result in
    three browsers), it works fine. When I go to the URL, "video60.swf"
    loads (I see type in the mc), but I do not see the video.
    Could this be a server issue? Any other possibilities?
    Need a solution quickly, of course.
    Thanks.

    hmmm....nothing obvious jumping out for either of us then.
    Someone else might know something there... but I'm stumped.
    All I'm left with is what I'd try to do to track it down (I
    haven't tried googling, so that would be first...but I guess you
    already tried that.) Here's what I'd check.
    What happens if you (just for testing) load the video60.swf
    directly into the html page .... i.e. not into the other swf.
    Beyond that I would try some trace code and possibly a try
    catch block around the contentPath setting and play methods. Use
    FlashTracer plugin in firefox to see what comes gets traced.
    Another alternative is the xray component to see whats
    happening.
    Because things load much quicker from local it may be some
    event related thing as well... but if it is then I can't think what
    it might be and presumably that would also work the second time
    once the flv was cached by your browser.

  • Load external FLV files?

    I would like my desktop AIR app (built in Flash CS3) to load
    and play external FLV files which are on the same computer/hard
    drive but are not packaged as part of the AIR app. Is there a way
    to do this with the sandbox restrictions AIR has? If so can you
    point me to a sample or documentation?
    Excuse me if this is an obvious subject but the information
    out there is incomplete and confusing.

    I'm still running into the following: As soon as I test the
    movie, I get the following in the area where the video should
    appear:
    status (0 seconds)
    Level: status
    Code: NetStream.Play.Start
    status (0.434 seconds)
    Level: status
    Code: NetStream.Buffer.Flush
    status (4.898 seconds)
    Level: status
    Code: NetStream.Play.Stop
    It doesn't matter if I click the button or not. The video is
    on my network.

  • Load random swf into movie

    I need to load a randomly selected .swf into my main movie.
    Have found the code below which does all the loading fine...
    ... however, I need to keep elements from the original, so is
    there a way to load the new movie INTO the main one?
    I think I might need to load into an empty instance? If so,
    what does my code need to look like?
    Thanks in advance

    You should use the MovieClipLoader class.
    var mcl = new MovieClipLoader();
    var lis = new Object();
    lis.onLoadInit = function(target:MovieClip){
    //target is loaded and ready when this fires
    mcl.addListener(lis);
    function loadFile(fileURL){
    mcl.loadClip(fileURL, content);
    Now you can just call loadFile with a url and it will be
    loaded into the
    clip 'content', which can be an empty clip on stage. You
    don't have to do
    anything in the listener, but you can set width, height,
    alpha etc. in
    onLoadInit.
    HTH
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

Maybe you are looking for

  • Drilldown Issue

    Hi I am using drilldown from table to a chart. In table i am showing 'Country' & in chart i am showing 'States' for the selected country. Now i want to show selected country in the chart. User gets confused on which state is selected, so to avoid thi

  • Java.lang.NullPointerException in CC 2014

    Hi, I'm using Photoshop CC 2014 and Extension Builder 3 and completed the setting for CC 2014 by the following document. Adobe Extension Builder and Creative Cloud 2014 But my project could not run and here is the error message. Please tell me how fi

  • Apple TV still not working?

    My apple TV doesn't respond to remote. I've changed the batteries and tried the menu back button and still get nothing

  • Segment Shrink Space Compact option in Oracle 10g

    Dear All, 1. Is it Compulsory to run the Segment Shrinking Jobs advised by Segment Advisor? 2. Running online will it affect the perfomance 3. Is this same as table re organization Thanks in Advance

  • White video background becomes grey

    I have an mp4 I want to play in my presentation. The video is basically showing a graph changing over time and has a white background. When I import the video into keynote the background becomes grey like the video has been severely compressed or som