Welcome to Dream.In.Code
Getting Help is Easy!

Join 136,248 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,205 people online right now. Registration is fast and FREE... Join Now!




Need Help with XML & dropDown Menu

 
Closed TopicStart new topic

Need Help with XML & dropDown Menu, Scrolling images to be synced with dropDown

bmcc81
10 Oct, 2008 - 08:06 AM
Post #1

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
Hi,

What I'm trying to do is populate my text fields with when selecting the dropDown menu.

This is my load XML and what loads my scrolling images

CODE
var seriesAlbumNames:Array = new Array();            // the names of the albums
var seriesAlbumThumbs:Array = new Array();            // the names of the thumbnails
var seriesAlbumFLV:Array = new Array();                // the names of the xml files that hold songs in each album
var seriesAlbumSKU:Array = new Array();                // the SKU number for each album
var seriesSynopsis:Array = new Array();                // the snyopsis for every DVD
var seriesFirstBullet:Array = new Array();                   // first Bullet
var seriesSecondBullet:Array = new Array();            // second Bullet
var seriesNumDVDs:Array = new Array();                // second Bullet

var gcbNumOfAlbums:Number;                            // hoe many albums are we loading
var whichAlbum:Number;                                // which album is currently selected

var currentTinImage:String;
var currentTinVideo:String;
var currentTinSynopsis:String;
var currentTinName:String;
var currentTinSKU:String;
var currentFirstBullet:String;
var currentSecondBullet:String;
var currentDVDNum:String;


                                                    
//-------------------------------------
// populate the album list
//-------------------------------------

var gcbXML:XML = new XML();
gcbXML.ignoreWhite=true;
gcbXML.onLoad = function(success:Boolean){
    if (success){
        gcbRootNode= gcbXML.firstChild;
        gcbNumOfAlbums = gcbRootNode.childNodes.length;
        
        for (var i:Number =0; i<gcbNumOfAlbums; i++){
            _root.seriesAlbumNames.push(gcbRootNode.childNodes[i].childNodes[0].childNodes[0].nodeValue);
            _root.seriesAlbumThumbs.push(gcbRootNode.childNodes[i].childNodes[1].childNodes[0].nodeValue);
            _root.seriesAlbumFLV.push(gcbRootNode.childNodes[i].childNodes[2].childNodes[0].nodeValue);
            _root.seriesAlbumSKU.push(gcbRootNode.childNodes[i].childNodes[3].childNodes[0].nodeValue);
            _root.seriesSynopsis.push(gcbRootNode.childNodes[i].childNodes[4].childNodes[0].nodeValue);
            _root.seriesFirstBullet.push(gcbRootNode.childNodes[i].childNodes[5].childNodes[0].nodeValue);
            _root.seriesSecondBullet.push(gcbRootNode.childNodes[i].childNodes[6].childNodes[0].nodeValue);
            _root.seriesNumDVDs.push(gcbRootNode.childNodes[i].childNodes[7].childNodes[0].nodeValue);
        }
        
        //---------------------------------------------------------------------------------
        //populate the left menus
        //---------------------------------------------------------------------------------
        _root.loadingRootData._visible=false;
        //----------------------------------------------------
        // the first copy of the scrolling movies on the side
        //----------------------------------------------------
        _level0.mainTarget._visible=false;
        
        for (var _i:Number = 0; _i<_root.seriesAlbumThumbs.length; _i++){
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_1.unit.duplicateMovieClip("unit"+_i, _root.body.scrollingPane.TwoScrollingMovies.scrolling_1.getNextHighestDepth());
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i].thumbLoader.loadMovie(prefix+"images/small/"+_root.seriesAlbumThumbs[_i]);
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i].ThumbAlbumTitle=_root.seriesAlbumNames[_i];
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i].thumbIndex=_i;
            if (_i==0){
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i]._y=_root.body.scrollingPane.TwoScrollingMovies.scrolling_1.unit._y;
            }else{
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i]._y=
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+(_i-1)]._y+
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+(_i-1)]._height+9;
            }
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_1["unit"+_i].onRelease=function(){
                    _root.whichAlbum=this.thumbIndex;
                    _root.populateTitles(_root.whichAlbum);
                    
            }
        }
        _root.body.scrollingPane.TwoScrollingMovies.scrolling_1.unit._visible=false;
        //----------------------------------------------------
        // the second copy of the scrolling movies on the side
        //----------------------------------------------------
        _root.body.scrollingPane.TwoScrollingMovies.scrolling_1.duplicateMovieClip("scrolling_2", _root.body.scrollingPane.TwoScrollingMovies.getNextHighestDepth());
        for (var _i:Number = 0; _i<_root.seriesAlbumThumbs.length; _i++){
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_2.unit.duplicateMovieClip("unit"+_i, _root.body.scrollingPane.TwoScrollingMovies.scrolling_2.getNextHighestDepth());
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i].thumbLoader.loadMovie(prefix+"images/small/"+_root.seriesAlbumThumbs[_i]);
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i].ThumbAlbumTitle=_root.seriesAlbumNames[_i];
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i].thumbIndex=_i;
            if (_i==0){
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i]._y=_root.body.scrollingPane.TwoScrollingMovies.scrolling_2.unit._y;
            }else{
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i]._y=
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+(_i-1)]._y+
                _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+(_i-1)]._height+9;
            }
            _root.body.scrollingPane.TwoScrollingMovies.scrolling_2["unit"+_i].onRelease=function(){
            _root.whichAlbum=this.thumbIndex;
            _root.populateTitles(_root.whichAlbum);
            
                
            }
        }
        //------------------------------------------------------------
        
        _root.body.scrollingPane.TwoScrollingMovies.scrolling_2._y =_root.body.scrollingPane.TwoScrollingMovies.scrolling_1._y+
        _root.body.scrollingPane.TwoScrollingMovies.scrolling_1._height+9;

    }
}


Then my drop Down Menu.

CODE
var tracksScollUp:Boolean=false;
var tracksScollDown:Boolean=false;
var PaneDrag:Boolean = false;

for (i=1; i<=_root.seriesAlbumNames.length; i++){
    
    if (i>0){
        trackContainer.title0.duplicateMovieClip("title"+i, trackContainer.getNextHighestDepth());
        this.trackContainer["title"+i]._x=trackContainer.title0._x;
        this.trackContainer["title"+i]._y=this.trackContainer["title"+(i-1)]._y+this.trackContainer["title"+(i-1)]._height-5;
        
        this.trackContainer["title"+i].onPress=function(){
            _root.whichSongPlay=null;
            indicator=this._name.split("e");
            _root.whichAlbum=indicator[1]-1;
            dayTitle.text=_root.seriesAlbumNames[indicator[1]-1];]
            dayTitle.text=_root.seriesAlbumNames[indicator[1]-1];
            _root.populateTitles(_root.whichAlbum);
            this.populateTitles(_root.currentTinSynopsis);
            
            _root.populateTitles(_root["XMLtrackListing_"+_root.whichAlbum]);
            gotoAndStop(1);
        };
        
        this.trackContainer["title"+i].onRollOver=function(){
            myIndicator=this._name.split("e");
            
            _root.main.YearDrop["format_fmt"+myIndicator[1]].color=0xFFFFFF;
            this.playingSongName.setTextFormat(_root.main.YearDrop["format_fmt"+myIndicator[1]]);
            
            this.gotoAndStop(2);
        };
        this.trackContainer["title"+i].onRollOut=function(){
            myIndicator=this._name.split("e");
            
            if (Number(myIndicator[1])-1  !=_root.whichSongPlay){
                _root.main.YearDrop["format_fmt"+myIndicator[1]].color=0x000000;
                this.playingSongName.setTextFormat(_root.main.YearDrop["format_fmt"+myIndicator[1]]);
            
                this.gotoAndStop(1);
            }else{
                _root.main.YearDrop["format_fmt"+myIndicator[1]].color=0xFFFFFF;
                this.playingSongName.setTextFormat(_root.main.YearDrop["format_fmt"+myIndicator[1]]);
            }
        };
        
    }
    this["format_fmt"+i] = new TextFormat();
    this.trackContainer["title"+i].playingSongName.setTextFormat(this["format_fmt"+i]);
    this.trackContainer["title"+i].playingSongName.selectable=false;
    this.trackContainer["title"+i].playingSongName.text = _root.seriesAlbumNames[i-1];
    this.trackContainer["currentAlbumTitle"+i].playingSongName.text = _root.currentAlbumTitle[i-1];
    this.trackContainer["currentTinSynopsis"+i].trackContainer_song.text = _root.currentTinSynopsis[i-1];
    
}
trackContainer.title0._visible=false;
this.trackContainer.setMask(this.TrackMask);


_parent.onEnterFrame = function() {
    if ((trackContainer._xmouse>trackContainer.title0._x) && (trackContainer._xmouse<(trackContainer.title0._x+trackContainer.title0._width))) {
        
        for (i=0; i<_root["SongFiles"+_root.albumIndex].length; i++){
            if ( ( trackContainer._ymouse>(eval("trackContainer.title"+i+"._y")) ) && (trackContainer._ymouse<((eval("trackContainer.title"+i+"._y"))+eval("trackContainer.title"+i+"._height")))) {
                eval("format_fmt"+i).color= 0xFF0000;
                eval("trackContainer.title"+i).playingSongName.setTextFormat(eval("format_fmt"+i));
                
                whichSong = i;
            } else {
                eval("format_fmt"+i).color= 0x000000;
                eval("trackContainer.title"+i).playingSongName.setTextFormat(eval("format_fmt"+i));
                
            }
        }
    }else{
        whichSong = null;
    }
    if (tracksScollUp){
        if (trackContainer._y<TrackMask._y){
            trackContainer._y+=4;
        }
        
    }
    if (tracksScollDown){
        if (trackContainer._y+trackContainer._height>TrackMask._y+TrackMask._height){
            trackContainer._y-=4;
        }
    }
    if (tracksScollUp || tracksScollDown){
        paneHandler._y=paneBG._y+(((TrackMask._y-trackContainer._y) / (trackContainer._height-TrackMask._height))*(paneBG._height));
    }
    
    if (PaneDrag){
        trackContainer._y =TrackMask._y -(
        (Math.abs(paneHandler._y - paneBG._y) /(paneBG._height)) * Math.abs( TrackMask._height -14- (trackContainer._height))
    );
        
    }
};



I need to populate the synopsis text field, currentTinSKU, currentFirstBullet and make sure the scrolling menu on the right works after using the dropdown.

Any point in a right direction would help.

Thanks,






User is offlineProfile CardPM
+Quote Post

bmcc81
RE: Need Help With XML & DropDown Menu
15 Oct, 2008 - 07:10 AM
Post #2

D.I.C Head
**

Joined: 10 Jul, 2007
Posts: 164


My Contributions
What I needed to do was put the drop down menu inside my main_mc

it was in the wrong level
User is offlineProfile CardPM
+Quote Post

Closed TopicStart new topic
Time is now: 12/2/08 04:01AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month