Player help - xml driven mp3

Hi,
I have been working on a different effect for a xml driven
mp3 mini player; it consists of three buttons that plays, pauses
and unpauses. Only one button is displayed on screen, to its user.
Now the problem I've got is that when the song ends, the button
shown is either pause or unpause; due to once the play button is
initially pressed its visibility is set to false. Now, when the
songs ends it stops until the user clicks the play button; however
the play button at present is invisible; so I need a way to display
the play button when the song ends, so the user can start it again,
and pause and unpause as normal.
I have attached the code.
Quite a challenge, but the effect will be unique. Clbeech
where are you?
Kind Regards,
Boxing Boom

Hi,
Nice try, but doesn't resolve the problem. You als forgot to
add the playSong() function to the play button; So I added it as
follows;
//this is the 'play' button
toggleSound1_btn.onRelease = function() {
playSong();
toggleSound2_btn._visible = true;
this._visible = false;
And the rest of the code does exactly what it done in the
first place. But many thanks for trying this for me, I really do
appreciate you help.
What we got here, is a RUBICS CUBE! It is mindgame for me!
Aaaghh! How can a little sound player script be so hard, this is
not right, is it?
This is how my layers is set up; Actions, Play, Pause,
Unpause. This has nothing to do with the problem at hand?
Kind Regards,
Boxing Boom

Similar Messages

  • Help - xml driven photo gallery

    Hello,
    I have a very simple ajax page. There is a dropdown from
    which the user selects the gallery and then there is an xml file
    that send back the xml full of pictures for that gallery. The
    problem is that on changing the gallery in the dropdown, sometimes
    it works and then it doesnt. More like it works the first time (so
    new pictures load up fine) and then it doesnt. I cant figure out
    for the life of me why this wont work right. I have tried looking
    at the xml, it is running fine, takes a url parameter as the
    galleryid and generates the xml. The alert in the get_pictures
    alwys pops up but the loadData seems like not working. Been looking
    over this code for hours now. Here is the relevant code:
    <script type="text/javascript">
    var dsPhotos = new
    Spry.Data.XMLDataSet("test_getpics_xml.cfm?galleryid=<cfoutput>#galleryid#</cfoutput>",
    "photos/photo");
    //var dsPhotos = new
    Spry.Data.XMLDataSet("test_getpics_xml.xml?galleryid=<cfoutput>#galleryid#</cfoutput>",
    "photos/photo");
    //var dsPhotos_page = new
    Spry.Data.PagedView(dsPhotos,{pageSize: 20});
    //var dsPhotos_page_info = dsPhotos_page.getPagingInfo();
    function get_pictures(galleryid)
    urltext='test_getpics_xml.xml?galleryid='+galleryid
    alert(urltext)
    dsPhotos.setURL(urltext)
    dsPhotos.loadData()
    </script>
    <table>
    <tr>
    <td>Galleries:
    <select name="galleryid"
    onChange="get_pictures(this.value)">
    <cfoutput query="qry_galleries">
    <option
    value="#galleryid#">#galleryname#</option>
    </cfoutput>
    </select>
    </td>
    </tr>
    </table>
    <div spry:region="dsPhotos">
    <div spry:repeat="dsPhotos"> <a href="##"
    onclick="alert('hey')"><img width="100" height="100"
    src="{@picture}" /></a>
    <p><br />
    </p>
    </div>
    </div>
    I have Firebug plugin installed on my Firebox and there is no
    error on it. Any help will be appreciated. Thanks a lot.

    Hi vansh110,
    It's really hard to diagnose the problem without actually
    seeing your example in action. If you can't give us an URL to look
    at, then the best we can do is suggest some debugging tips.
    Try adding an observer to your data set that prints the
    notifications:
    dsPhotos.addObserver(function(notificationType, notifier,
    data)
    Spry.Debug.trace(notificationType);
    if (notificationType == "onPostLoad")
    Spry.Debug.trace("<pre>" +
    Spry.Utils.encodeEntities(dsPhotos.getData().toSource()) +
    "</pre>");
    That way you can watch what states the data set is going
    through. The trace statement will only work in FireFox due to the
    use of toSource(), but it will show you what the final data set
    looks like after the data is loaded and flattened into a table.
    Next, you can turn on region debugging:
    Spry.Data.Region.debug = true;
    That should show you the markup that is being generated after
    data is loaded.
    --== Kin ==--

  • XML Driven Photo Gallery (Action Script Help)

    Hi,
    I need to make a XML Driven Photo slide in Flash CS5.
    It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
    The  Box sits on top of the Main photo area and shrinks (or close out) when  user click its close button. And it opens out by clicking on a open  button.
    I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
    Can they disappear with the Box and retrieve when it opens? is it possible?
    If yes, what would be the best way to do that?
    Any comment would be greatly appreciated!
    Here is the ActionScript.
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    import fl.controls.Button;
    import flash.display.Shape;
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.text.TextField;
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.display.Shader;
    var hasloaded:Boolean = false;
    var firstLoaded:Boolean = false;
    var barWidth:int;
    var barHeight:int;
    var images;
    var imageCount:int;
    var thumbnailArray:Array = new Array();
    var bigImageArray:Array = new Array();
    var descriptionArray:Array = new Array();
    var xmlLoader:URLLoader = new URLLoader();
    var imageXML:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest("slideshow.xml"));
    function LoadXML(e:Event):void {
         imageXML = new XML(e.target.data);
         ParseImages(imageXML);
      Populates the arrays with the image values
      and the text for each picture.
    function ParseImages(imageInput:XML):void {
         var iconList:XMLList = imageInput.image.icon;
         var mainImageList:XMLList = imageInput.image.mainimage;
         var descriptionList:XMLList = imageInput.image.description;
         for (var i:int = 0; i < iconList.length(); i++) {
             var imageElement:XML = iconList[i];
             //trace(imageElement);
             thumbnailArray[i] = imageElement;
         for (var j:int = 0; j < mainImageList.length(); j++) {
             var mainimageElement:XML = mainImageList[j];
             //trace(mainimageElement);
             bigImageArray[j] = mainimageElement;
         for (var l:int = 0; l < descriptionList.length(); l++) {
             var descriptionElement:XML = descriptionList[l];
             //trace(descriptionElement);
             descriptionArray[l] = descriptionElement;
         loadImages();
    function loadImages():void{
         trace("inside of loadimages function.");
         trace(thumbnailArray.length);
         for(var i:int=0; i < thumbnailArray.length; i++){
             trace(thumbnailArray[i]);
             populateContainers(thumbnailArray[i], i);
             //populateContainers2();
             trace("Loaded " + thumbnailArray[i]);
    var loader:Loader;
    var xStart = -210;
    var ypos = -34;
    var currentPos = xStart;
    var incrementValue = 66;
      This takes in the name of the image file and
      displays it within the newly created movie clip
    function populateContainers(file:String, pos:int):void{   
         //create a movie clip to hold the image
         var mc:MovieClip = new MovieClip();
         mc.graphics.beginFill(0xFFFFFF);
         mc.graphics.drawRect(0, 0, 50, 51);
         mc.graphics.endFill();
         mc.buttonMode = true;
         mc.x = currentPos;
         mc.y = ypos;
         mc.name = "thumb_" + pos;
         mc.addEventListener(MouseEvent.CLICK, clickHandler); 
         loader = new Loader();
         //loader.mask = imagemask;
        var url:URLRequest = new URLRequest(file);
         loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
         loader.load(url);
         //add the image to the movie clip
         mc.addChild(loader);
         this.imageBar.addChild(mc);
         //increment the currentPos
         currentPos += incrementValue;
    function clickHandler(e:MouseEvent):void{
         var str:String = e.currentTarget.name;
         var index:int = int(str.substr(6,1));
         if(hasloaded) {
             this.mainWindow.removeChild(loader);
         loader = new Loader();
         loader.load(new URLRequest(bigImageArray[index]));
         this.mainWindow.addChild(loader);
         TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
         //setChildIndex(loader, 0);
         hasloaded = true;
         loadText(index);
    function loadText(index:int):void {
         Object(this).imageBar.txtdescription.text = descriptionArray[index];
    function loadInitialImage(event:Event):void {
         if(!firstLoaded) {
             loader = new Loader();
             loader.load(new URLRequest(bigImageArray[0]));
             this.mainWindow.addChild(loader);
             TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
             //setChildIndex(loader, 0);
             hasloaded = true;
             loadText(0);
         firstLoaded = true;
    /*  This section defines the buttons that control the image bar */
    Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
    function openImageBar(event:MouseEvent):void {
         this.gotoAndPlay(1);

    Well Thats what i know but you might be able to use flash player 10 in your browser i think the file system works on it fine im not sure i mostly work on air glad i could help
    James

  • XML driven flv player

    Hi,
    I need to create an XML driven flv player, now I know how to
    construct the player, but not sure of the code for the XML to hold
    just one flv file, not a list of them just the one.
    I need my flv player to play just one flv file; as soon as
    its run on the web, it needs to play only one flv video. No need to
    pick it from any list etc... This way the client can simply edit
    the XML file to play a different flv video.
    Kind Regards,
    Boxing Boom

    Boxing Boom,
    You are correct about error
    AS3
    Error #1093 being because of the quotes. The unfortunate thing
    is that this error doesn't give any further info. I have created a
    blog post specifically about error
    ActionScript
    Error #1093 There are a few other reasons that a Flasher will
    get this error. Hope this is helpful.
    Curtis J. Morley

  • Hi i need help with my mp3 flash player

    Hi i need help with my mp3 player, i wan't to add pause button..can you help me?
    i created button i added btn_pause and it won't work.
    function soundStatus(){
              var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();
              _root.loader.loadBar._width = amountLoaded * 260;
              duration = _root.sound_mc.sound_obj.duration;
              position = _root.sound_mc.sound_obj.position;
              _root.playHead._x = position / duration * 272 + 5;
    btn_play.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.songStarter(songfile[song_nr]);
    btn_pause.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.sound_obj.pause();
    btn_stop.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.sound_obj.stop();
    btn_fw.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
              _root.sound_mc.songStarter(songfile[song_nr]);
    btn_rev.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
              _root.sound_mc.songStarter(songfile[song_nr]);
    <moved by mod from as3 - kglad>


    function soundStatus(){
              var amountLoaded = _root.sound_mc.sound_obj.getBytesLoaded() / _root.sound_mc.sound_obj.getBytesTotal();
              _root.loader.loadBar._width = amountLoaded * 260;
              duration = _root.sound_mc.sound_obj.duration;
              position = _root.sound_mc.sound_obj.position;
              _root.playHead._x = position / duration * 272 + 5;
    btn_play.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.songStarter(songfile[song_nr]);
    btn_pause.onRelease = function() {
              clearInterval(timeInterval);  // you should re-set this interval when the unpause button is clicked
             // _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.sound_obj.stop()
    btn_unpause.onRelease=function(){
    this._parent.sound_mc.sound_obj.start(position/1000);
    btn_stop.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              this._parent.sound_mc.sound_obj.stop();
    btn_fw.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              (song_nr == songfile.length-1) ? _global.song_nr=0 : _global.song_nr++;
              _root.sound_mc.songStarter(songfile[song_nr]);
    btn_rev.onRelease = function() {
              clearInterval(timeInterval);
              _root.timeDisplay_txt.text = "00:00/00:00";
              (song_nr == 0) ? _global.song_nr=songfile.length-1 : _global.song_nr--;
              _root.sound_mc.songStarter(songfile[song_nr]);

  • Flashvars, loaderinfo for mp3 player with xml

    ok, I am using flash cs5, am pretty new to as3, and I've been trying for 3 days to figure this out, as of yet have not been able to.
    I have built a music community website, obviously members can sign up for an account, and upload mp3 files to their accounts.
    now I'll explain in as much detail as I can.
    Once registration is complete, the php script creates a folder in the members directory on my server with their unique id, then when they go and upload an mp3, it uploads it to their folder and automatically creates a playlist.xml file for the song(s)
    so, I have a prebuilt flash mp3 player that I got from developphp.com, his as3 code calls for a static directory for the audio and xml, now since the flash player will live in the root, and the xml and audio will live in the members/$id folders, I am told to use flashvars and loaderinfo.parameters to do what I need, and that is to load the xml and mp3 files into the player for the profile that is being viewed at that moment, so lets look at what I've put into the html object and embed.
    lets use profile #7
    <param name="movie" value="flplayer.swf?<?php print"$id/playlist.xml" ?>">
                <embed src="flplayer.swf?<?php print "$id/playlist.xml" ?>"> (please tell me if I have done this incorrectly)
    now if we go to the profile.php?id=7 page, thius is what the page source looks like:
    <param name="movie" value="flplayer.swf?7/playlist.xml">
                <embed src="flplayer.swf?7/playlist.xml>">
    now here is where I am stuck, as I said the flash mp3 player urlLoader and URLRequest, and I have been searching for days to figure out what I am supposed to do to get the player to pick up on the flash vars, here is the top part of the as3 code where it calls for the mp3 and the xml.
    stop();
    var myFormat:TextFormat = new TextFormat();
    myFormat.color = "0xFFFFFF";
    list.setRendererStyle("textFormat", myFormat);
    var trackToPlay:String;
    var pausePosition:int = 0;
    var songURL:URLRequest;
    var isPlaying:Boolean = false;
    var i:uint;
    var myXML:XML = new XML();
    var XML_URL:String = "mp3_playlist.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    function xmlLoaded(event:Event):void {
        myXML = XML(myLoader.data);
       var firstSong:String = myXML..Song.songTitle[0];
       var firstArtist:String = myXML..Song.songArtist[0];
       songURL = new URLRequest("mp3_files" + firstSong + ".mp3");
       status_txt.text = "1. "+firstSong +" - "+firstArtist;
         for each (var Song:XML in myXML..Song) {
    i++;
    var songTitle:String = Song.songTitle.toString();
    var songArtist:String = Song.songArtist.toString();
    list.addItem( { label: i+". "+songTitle+" - "+songArtist, songString: songTitle, Artist: songArtist, songNum: i } );
    var myArray = new Array (0,0);
             list.selectedIndices = myArray;
    gotoAndStop(3);
    I am not asking for free work, I'm just trying to get pointed in the right direction, through searching I have been trying to find out how and what to change, and I have been having a great deal of trouble finding the info, I'm ready to pull my hair out.

    ok, here is the object/embed section from dreamweaver
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="386" height="250">
                  <param name="movie" value="flplayer.swf">
                <embed src="flplayer.swf?xml=members/$id/playlist.xml">
                  <param name="quality" value="high">
                  <param name="wmode" value="opaque">
                  <param name="swfversion" value="9.0.45.0">
                  <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
                  <param name="expressinstall" value="Scripts/expressInstall.swf">
                  <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
                  <!--[if !IE]>-->
                  <object type="application/x-shockwave-flash" data="flplayer.swf" width="386" height="250">
                    <!--<![endif]-->
                    <param name="quality" value="high">
                    <param name="wmode" value="opaque">
                    <param name="swfversion" value="9.0.45.0">
                    <param name="expressinstall" value="Scripts/expressInstall.swf">
                    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
                    <div>
                      <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
                      <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
                      </div>
                    <!--[if !IE]>-->
                    </object>
                  <!--<![endif]-->
                  </object>

  • Looking for a non XML driven Flash banner rotator

    I am looking for a non XML driven Flash banner rotator, something where I can load my images into the FLA and publish. The only rotators I can seem to find have external XML/image files, etc.
    All I want to do is create simple SWF's that I can use to display rotating images preferably is a smooth and stylish manner. Does anyone know of any, or could point me in the right direction?
    Many thanks for any help you may be able to offer and I am willing to follow any tutorials.

    Hi
    I wonder why not show you how to use Quicktime.
    Because I would use the html5 audio, that way the browser chooses the 'player' to use, and I wanted to give the OP the choice -
    <audio controls preload="auto" autobuffer>
      <source src="elvis.mp3" />
      <source src="elvis.ogg" />
      <!-- now include flash fall back -->
    </audio>
    PZ

  • Flash Lite XML Driven Gallery Simple Question

    Hello Flash Lite Gurus',
    Someone Named "Mr. Samir K. Dash;" did a wonderful tutorial regarding Flash Lite XML driven Photo Gallery, and I have just a small question:
    1> I changed the attributes schema of the xml as attached and noticed that it is not working, and I wonder what could be the reason (please see the attached XML new attribute schema, I didn't change fields names, I just changed the way the attributes' schema looks like).
    The link to the tutorial is the following:
    http://www.adobe.com/devnet/devices/articles/xml_photo_gallery.html
    Looking forward to your help
    best regards
    Talal

    As I look at your modified XML file, you need to make major changes in the script.
    You have changed the attributes to become child nodes. So, you will need to use firstChild.nodeValue or childNodes[i].nodeValue everywhere.
    Regards,
    Hemanth Sharma
    http://www.flashlitehub.com/blog

  • Creating a very simple XML-driven gallery

    Hi, I'm learning XML in AS3 and I am having real trouble finding a resource that can help me learn how to build a very simple XML-driven picture gallery.
    I am working in an FLA file with AS3, with a dynamic text field with the instance name "textfield". I also have a UILoader Component with the instance name "UILoaderComponent" and an XML file called "rootdir.xml".
    I have an XML file in the following format.
    <images>
         <imagenames>
              <name>image1</name>
              <name>image2</name>
              <name>image3</name>
              <name>image4</name>
              <name>image5</name>
         </imagenames>
         <imagepaths>
              <path>image1.jpg</path>
              <path>image2.jpg</path>
              <path>image3.jpg</path>
              <path>image4.jpg</path>
              <path>image5.jpg</path>
         </imagepaths>
    </images>
    I am using the following as my actionscript.
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest("rootdir.xml"));
    function LoadXML(e:Event):void {
    xmlData = new XML(e.target.data);
    parseImg(xmlData);
    function parseImg(imgLoad:XML):void {
    var imgChild:XMLList = imgLoad.images.children();
    for each (var imgTrace:XML in imgChild) {
    trace(imgTrace);
    No matter which way I experiment, I always have poor results with my dynamic text, and every tutorial I've followed does not reproduce anything like the same returned data in "textfield" that it does with the trace command.
    My objective is: I simply want to build a menu inside a textbox called "textfield" that lists images1-5, and when clicked, calls upon the relevant image. For instance: I load the file "rootdir.xml" into the file "index.fla". I call a function to parse the XML into a dynamic text box called "textfield". When image 2 is clicked on the textbox "textfield", it would call upon a function that would load into the UIComponent Loader "image2.jpg".
    Are there any tutorials for this? I'm so confused as to why dynamic text operates so differently from the trace command. I'm not interested in doing a fancy menu bar with thumbnails, scrollbars and animations, I just want to learn the basics.

    I don't really see how you are getting a valid trace out of that code (I get nothing if I try it as is), but as far as the textfield goes, you haven't shown any attempt in your code that might help to point to why you cannot get the text into a textfield.  It might be a problem with how you are trying to write to the textfield and not how your are manipulating the data.
    While you could make use of a textfield for the menu, doing so is not straightforward, as you would need to implement htmlText with special coding in order to have the text clickable.  You might consider using a List component or ComboBox instead.
    What I always do when I am working with xml is to store the data into a data structure, usually an array conatining objects, and then make use of that structure rather than dippng into the xml data itself when I utilize the data.
    Another thing, which rquigley demonstrated, is that your xml will serve its purpose better if the data for each image is collected under the same node.  If you have separate sections for each piece of data like you have, when it comes to editing it will be more prone to error as you have to be sure you are editing the correct entry of each separate group.
    I too am no expert in the world of xml, but I have not yet worked with parameters inside the tags, so I would usually structure it as...
    <images>
       <image>
           <imgName>image 1</imgName>
           <imgPath>image1.jpg</imgPath>
       </image>
       <image>
           <imgName>image 2</imgName>
           <imgPath>image2.jpg</imgPath>
       </image>
    </images>
    Now, back to what you have...  let's say you have a textField named imgText that you want to list the image names in.  The following should work, though I do not go my usual route of storing the data into an object array first...
    function parseImg(imgLoad:XML):void {
       var imgNames:XMLList = imgLoad.imagenames.name;
       var imgPaths:XMLList = imgLoad.imagepaths.path;
       // show name
       for each (var nameTrace:XML in imgNames) {
          trace(nameTrace);
          imgText.appendText(nameTrace +"\n");
       // show path
       for each (var pathTrace:XML in imgPaths) {
          trace(pathTrace);
          imgText.appendText(pathTrace +"\n");
       // show name and path
       for(var i:uint=0; i<imgNames.length(); i++){
          trace(imgNames[i].text()+"  "+imgPaths[i].text());
          imgText.appendText(imgNames[i].text()+"  "+imgPaths[i].text() +"\n");

  • XML Driven Video Gallery with Playlist

    Hi,
    I have put together a XML Driven Video Player with auto thumbnail detection but there is a problem.The Video plays but, The thumbs will not show. I think my thumbnail function is not reaching the correct node in my XML.Can someone take a look at my Actionscript Please? The Action Script is below. The XML is at the bottom of this post. The top half of the code is the video playing code the bottom is for the thumbs.
    Actionscript 2.0
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.setNufferTime(30);
    ns.onStatus = function(info) {
    if (info.code == "NetStream.Buffer.Full") {
    bufferClip._visible = false;
    if (info.code == "NetStream.Buffer.Empty") {
    bufferClip._visible = true;
    if (info.code == "NetStream.Buffer.Stop") {
    ns.seek(0);
    theVideo.attachVideo(ns);
    rewindButton.onRelease = function() {
    ns.seek(0);
    playButton.onRelease = function() {
    ns.pause();
    var videoInterval = setInterval(videoStatus, 100);
    var amountLoaded:Number;
    var duration:Number;
    ns["onMetaData"] = function (obj) {
    duration = obj.duration;
    function videoStatus() {
    amountLoaded = ns.bytesLoaded/ns.bytesTotal;
    loader.loadbar._width = amountLoaded*187.4;
    loader.scrub._x = ns.time/duration*187.4;
    var scrubInterval;
    loader.scrub.onPress = function() {
    clearInterval(videoInterval);
    scrubInterval = setInterval(scrubit, 10);
    this.startDrag(false,0,this._y,187.4,this._y);
    loader.scrub.onRelease = loader.scrub.onReleaseOutside=function () {
    clearInterval(scrubInterval);
    videoInterval = setInterval(videoStatus, 100);
    this.stopDrag();
    function scrubit() {
    ns.seek(Math.floor((loader.scrub._x/187)*duration));
    var theMenu:ContextMenu = new ContextMenu();
    theMenu.hideBuiltInItems();
    _root.menu = theMenu;
    var i1:ContextMenuItem = new ContextMenuItem(":::::Video Controls:::::", trace);
    theMenu.customItems[0] = i1;
    var i2:ContextMenuItem = new ContextMenuItem("Play / Pause Video", pauseIt, true);
    theMenu.customItems[1] = i2;
    var i3:ContextMenuItem = new ContextMenuItem("Replay Video", replayIt);
    theMenu.customItems[2] = i3;
    var i4:ContextMenuItem = new ContextMenuItem("All Rights Reserved 2009", trace, true);
    theMenu.customItems[3] = i4;
    var i5:ContextMenuItem = new ContextMenuItem("SamAndOnline.com Video Player", trace);
    theMenu.customItems[4] = i5;
    function pauseIt() {
    ns.pause();
    function replayIt() {
    ns.seek(0);
    //sound controls
    _root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
    vSound.attachAudio(ns);
    var so:Sound = new Sound(vSound);
    so.setVolume(100);
    volControl.volcon.slider1.onPress = function() {
    this.startDrag(true,volControl.volcon.groove1._x,volControl.volcon.groove1._y,volControl.v olcon.groove1._x,volControl.volcon.groove1._y+100);
    slideit = setInterval(volControl.volcon.slider_1Move, 100, this);
    volControl.volcon.slider1.onRelease = function() {
    this.stopDrag();
    clearInterval(slideit);
    mute.gotoAndStop("on");
    volControl.volcon.slider1.onReleaseOutside = function() {
    this.stopDrag();
    clearInterval(slideit);
    mute.gotoAndStop("on");
    mute.onRollOver = function() {
    if (so.getVolume() == 100) {
    this.gotoAndStop("onOver");
    } else {
    this.gotoAndStop("muteOver");
    mute.onRollOut = function() {
    if (so.getVolume() == 100) {
    this.gotoAndStop("on");
    } else {
    this.gotoAndStop("mute");
    mute.onRelease = function() {
    if (so.getVolume() == 100) {
    so.setVolume(0);
    this.gotoAndStop("muteOver");
    } else {
    so.setVolume(100);
    this.gotoAndStop("onOver");
    //listBx
    var vlist:XML = new XML();
    vlist.ignoreWhite = true;
    vlist.onLoad = function() {
    var videos:Array = this.firstChild.childNodes;
    for (i=0; i<videos.length; i++) {
    videoList.addItem({label:videos[i].attributes.desc,data:videos[i].attributes.url ,image:videos[i].attributes.thumb});
    //play 1st video
    ns.play(videoList.getItemAt(0).data);
    videoList.selectedIndex = 0;
    //would like to reference something in the XML File with the thumb attribute
    thumbnails_fn(i);
    var vidList:Object = new Object();
    vidList.change = function() {
    ns.play(videoList.getItemAt(videoList.selectedIndex).data);
    videoList.addEventListener("change",vidList);
    vlist.load("videos.xml");
    soundb.onRelease = function() {
    if (volControl.switch2=open2) {
    volControl.gotoAndPlay("open");
    } else {
    volControl.play();
    function thumbNailScroller() {
    // thumbnail code!
    this.createEmptyMovieClip("tscroller", 1000);
    scroll_speed = 10;
    tscroller.onEnterFrame = function() {
    if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._height)) {
    if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {
    thumbnail_mc._x -= scroll_speed;
    } else if ((_root._xmouse<=40) && (thumbnail_mc.hitTest(hit_left))) {
    thumbnail_mc._x += scroll_speed;
    } else {
    delete tscroller.onEnterFrame;
    function thumbnails_fn(k) {
    thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
    tlistener = new Object();
    tlistener.onLoadInit = function(target_mc) {
    target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
    target_mc.pictureValue = k;
    target_mc.onRelease = function() {
    p = this.pictureValue-1;
    nextImage();
    target_mc.onRollOver = function() {
    this._alpha = 50;
    thumbNailScroller();
    target_mc.onRollOut = function() {
    this._alpha = 100;
    image_mcl = new MovieClipLoader();
    image_mcl.addListener(tlistener);
    image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
    trace(videoList.getItemAt(0).image+ "k= "+k+" "+videos.length+" pv "+target_mc.pictureValue+" thumbnails");
    XML Example
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <videos>
    <video url="vid1.flv" desc="Video 1" thumb="1.jpg"/>
    <video url="vid2.flv" desc="Video 2" thumb="2.jpg"/>
    </videos>

    I'm trying to load the thumbnails in with this code
    image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
    i tried
    videoList.getItemAt(k).image
    which works in the trace method but gives no response in the actual code it self
    So the line of code that should work is
    image_mcl.loadClip(videoList.getItemAt(k).image, "thumbnail_mc.t"+k);
    and not
    image_mcl.loadClip(image[k], "thumbnail_mc.t"+k);
    but I gets no response

  • XML Driven

    Hello World,
    I'm interested in a photo stack gallery.
    Here is an example: http://www.flashdevelopment.de/CONTENTS/3DPHOTOSTACKGALLERY02/3dphotostackgallery02.php
    I want to use a photo stack gallery on my multiple affiliate websites to display my products.
    What I want to be able to do is add and delete photos very fast, without having to fiddle around with xml or any other codes.
    Can I do this with this product or is there some other simple, reliable and cheap product that I can?
    Is a bulk preloader a code-work-around solution?
    In other words does a bulk preloader make a photo stack gallery an image drag-and-drop photo stack gallery?
    Said differently once more, is there a way to add multiple images fast to an xml driven photo stack gallery without fiddling around with xml code?
    Thank you for your help,
    Jerry

    the xml will need to be edited to make changes to any xml-driven application whether that's a photo gallery or any other xml-driven application.
    typically, you do that by opening up the xml file in a text editor and "fiddling" with code and then uploading the needed file(s) including the edited xml and the photo(s).   but an editor can be created (i make them using flash) that eliminates the need to fiddle with code ftp file uploads.
    in the case of a photo gallery, you would:
    1.  open the editor
    2.  enter your password (because you don't want anyone else editing your gallery)
    3.  you would be presented with an easy-to-use display - not code.
    typically, for a photo gallery, that display would be:
    1.  select a category (from a combobox), eg, shirts, pants, ties
    2.  select one of 3 options, add, edit or delete
    3.  if add was selected, you would be presented with
        a.  add after photo number.
        b.  add before photo number.
    4. browse for file dialogue box would open so you could click on the file (on your computer), that you want to add.
    5. a confirmation would appear (if all went well) that your photo was uploaded and added to your gallery.
    6.  return to 1.
    usually, there will be more involved (like a description/text) that should accompany the photo.  but that gives you the general outline of how a user-friendly editor would work.
    if you want me to build one for you, send an email via my website:  www.kglad.com

  • XML driven Accordion is it possible?

    Hi,
    An XML driven Accordion is it possible?
    If so does anyone know a good tutorial?
    Any help is greatly appreciated.

    I am familiar with with creating and loading an xml file.
    I never touched the accordian component though.
    Is it also possible to let the accordeon dynamicaly grow/thrink as the XML holds more or less data?
    I will try it out
    Thanks

  • XML Driven 3D Animated Flash Charts

    Hi,
    I want to create a 3d XML driven animated chart. Can anyone help me for that?
    Thanks
    Pinal

    I do have pretty good idea. But it is unrealistic to expect someone will walk you through development of entire application.
    Charts, especially 3D charts, are quite advanced tasks and require deep knowledge of ActionScript and its Graphics functionality along with trigonometry and 3D concepts/techniques.
    If you just need charts - you can use available packages. Charts come with Flash Builder. Yahoo has its free astra charts. You may want to use them.

  • Flash player has been installed multiple time without errors but bbc news website and even flash player help say it isn't. How do i get out of this loop? - using windows 7 ultimate and latest IE11

    flash player has been installed multiple time without errors but bbc news website and even flash player help say it isn't. How do i get out of this loop? - using windows 7 ultimate and latest IE11

    I have had the same problem for WEEKS and I cannot access any sites that use Flash. Flash has been installed on this computer since I bought it in 2012. I have allowed auto updates but for weeks the updates never get past Step 2 - is this because I do NOT want the Google Tool bar? I use NO tool bars as there is only 6 inches of vertical screen space. Is this because I uncheck wanting Chrome as a default browser?  It is already installed, I just don't use it.  I came to this site and ran the check is it installed and the system says it is either not installed or not enabled. Version 14 just downloaded about 30 minutes ago - but did not progress to Step 3 although a pop up screen came up with a finish button, which I clicked. WHAT is the problem and how do I fix it?  If this were just a compatibility bug between IE11 and Adobe they have had plenty of time to fix it.
    Stephanie HC

  • XML Driven Flash Photo Gallery Thumbnails

    Hi,
    I need to make a XML Driven Photo slide in Flash CS5.
    It needs to have a Box that contains 5 Thumbnails(by XML) act as buttons.
    The Box sits on top of the Main photo area and shrinks (or close out) when user click its close button. And it opens out by clicking on a open button.
    I'm sure it can be done by using timeline, Tweening or you name it..But what about the Thumbnails that run from the XML file?
    Can they disappear with the Box and retrieve when it opens? is it possible?
    If yes, what would be the best way to do that?
    Any comment would be greatly appreciated!
    Here is the ActionScript.
    import flash.net.URLRequest;
    import flash.net.URLLoader;
    import flash.events.Event;
    import fl.controls.Button;
    import flash.display.Shape;
    import flash.events.MouseEvent;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.text.TextField;
    import fl.transitions.*;
    import fl.transitions.easing.*;
    import flash.display.Shader;
    var hasloaded:Boolean = false;
    var firstLoaded:Boolean = false;
    var barWidth:int;
    var barHeight:int;
    var images;
    var imageCount:int;
    var thumbnailArray:Array = new Array();
    var bigImageArray:Array = new Array();
    var descriptionArray:Array = new Array();
    var xmlLoader:URLLoader = new URLLoader();
    var imageXML:XML = new XML();
    xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
    xmlLoader.load(new URLRequest("slideshow.xml"));
    function LoadXML(e:Event):void {
        imageXML = new XML(e.target.data);
        ParseImages(imageXML);
    Populates the arrays with the image values
    and the text for each picture.
    function ParseImages(imageInput:XML):void {
        var iconList:XMLList = imageInput.image.icon;
        var mainImageList:XMLList = imageInput.image.mainimage;
        var descriptionList:XMLList = imageInput.image.description;
        for (var i:int = 0; i < iconList.length(); i++) {
            var imageElement:XML = iconList[i];
            //trace(imageElement);
            thumbnailArray[i] = imageElement;
        for (var j:int = 0; j < mainImageList.length(); j++) {
            var mainimageElement:XML = mainImageList[j];
            //trace(mainimageElement);
            bigImageArray[j] = mainimageElement;
        for (var l:int = 0; l < descriptionList.length(); l++) {
            var descriptionElement:XML = descriptionList[l];
            //trace(descriptionElement);
            descriptionArray[l] = descriptionElement;
        loadImages();
    function loadImages():void{
        trace("inside of loadimages function.");
        trace(thumbnailArray.length);
        for(var i:int=0; i < thumbnailArray.length; i++){
            trace(thumbnailArray[i]);
            populateContainers(thumbnailArray[i], i);
            //populateContainers2();
            trace("Loaded " + thumbnailArray[i]);
    var loader:Loader;
    var xStart = -210;
    var ypos = -34;
    var currentPos = xStart;
    var incrementValue = 66;
    This takes in the name of the image file and
    displays it within the newly created movie clip
    function populateContainers(file:String, pos:int):void{   
        //create a movie clip to hold the image
        var mc:MovieClip = new MovieClip();
        mc.graphics.beginFill(0xFFFFFF);
        mc.graphics.drawRect(0, 0, 50, 51);
        mc.graphics.endFill();
        mc.buttonMode = true;
        mc.x = currentPos;
        mc.y = ypos;
        mc.name = "thumb_" + pos;
        mc.addEventListener(MouseEvent.CLICK, clickHandler); 
        loader = new Loader();
        //loader.mask = imagemask;
        var url:URLRequest = new URLRequest(file);
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadInitialImage);
        loader.load(url);
        //add the image to the movie clip
        mc.addChild(loader);
        this.imageBar.addChild(mc);
        //increment the currentPos
        currentPos += incrementValue;
    function clickHandler(e:MouseEvent):void{
        var str:String = e.currentTarget.name;
        var index:int = int(str.substr(6,1));
        if(hasloaded) {
            this.mainWindow.removeChild(loader);
        loader = new Loader();
        loader.load(new URLRequest(bigImageArray[index]));
        this.mainWindow.addChild(loader);
        TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeOut});
        //setChildIndex(loader, 0);
        hasloaded = true;
        loadText(index);
    function loadText(index:int):void {
        Object(this).imageBar.txtdescription.text = descriptionArray[index];
    function loadInitialImage(event:Event):void {
        if(!firstLoaded) {
            loader = new Loader();
            loader.load(new URLRequest(bigImageArray[0]));
            this.mainWindow.addChild(loader);
            TransitionManager.start(this.mainWindow,{type:Fade, direction:Transition.IN, duration:2, easing:Regular.easeIn});
            //setChildIndex(loader, 0);
            hasloaded = true;
            loadText(0);
        firstLoaded = true;
    /*  This section defines the buttons that control the image bar */
    Object(this).imageBar.btnBarOpen.addEventListener(MouseEvent.MOUSE_UP, openImageBar);
    function openImageBar(event:MouseEvent):void {
        this.gotoAndPlay(1);

    thank you!

Maybe you are looking for

  • GIF Img in Photoshop CS3 Extended

    Hello. I have searched and searched for an answer to my question and have tried many given solutions to no avail. My problem is the famous white line around my Gif image. I run a website for moms and women in general basically. I am making glitter gr

  • Change document display in BDT

    Hi, Can some tell me how to display the change document list for the field level in BDT...CHGD1,CHGD2 and CHGD4 are event where i have written the code to display the list..currently it always display a single record list i.e created...it never show

  • How do I transfer my Aperture license?

    Am selling my personal copy of Aperture. Have access to it at work now. How do I transfer my license? Can I just trash the application or uninstall? Will the buyer of the software be able to register anew? Or must he/she use my license info? Any othe

  • Surround speakers not working with 12.1.0.71

    The latest version of iTunes no plays surround speakers.  Front left and right work fine.  WinAmp and MediaMonkey both work fine with all speakers.  Only option in preferences is Windows Audio Session.  Windows 8.1

  • Problems running Software Update and Disk Utility

    I had automatic updating turned on in the Software Updates control panel, so I believe the system tried to apply the 10.4.6 automatically and somehow failed. Ever since, when I try to run Software Update it hangs while trying to connect to the intern