A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: xml based dynamic text field with huge swf file

  1. #1
    Member
    Join Date
    Feb 2009
    Posts
    30

    xml based dynamic text field with huge swf file

    I'm trying to make an xml based tracklist for a music mix on a website. The code loads the info from the XML file, and displays it in the text field, and I have a UIScrollbar component as well. When I test movie, everything seems to be working fine. However, the swf file is 14.1 MB. The .FLA is only 690kb... so where the hell is the size coming from? I only have text in the xml file, and the code is pretty compact. Why is the swf so big? Here is my code:

    Code:
    var showX:XML;
    var showList:XMLList;
    var output:String = "";
    
    var style:StyleSheet = new StyleSheet();
    
    var loader:URLLoader = new URLLoader();
    loader.addEventListener(Event.COMPLETE, onComplete);
    loader.load(new URLRequest("The_Fixx_DJ_Little_Fever_Show8.xml"));
    
    function onComplete(e:Event):void
    {
    	showX = new XML(loader.data);
    	showList = showX.song;
    	
    	for(var i:uint = 0; i<showList.length(); i++)
    	{
    	var track:Number = (i + 1);
    	if(i<9) {
    		output += "0" + track + ". " + showList[i].number + " " + showList[i].artist + " - " + showList[i].title + "<br>"; }
    	else {
    	output += track + ". " + showList[i].number + " " + showList[i].artist + " - " + showList[i].title + "<br>"; }
    	}
    	show_txt.htmlText = output;
    }
    I also need to make up about 30 of these... and short of creating 30 copies of this playlist file, is there a way i can call on the xml file in the html code? I know this is possible with mp3 players... an example of which is here:

    Code:
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0','width','400','height','275','src','playlist_player?xml_path=66011.xml','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer','movie','playlist_player?xml_path=66011.xml' );
    If anyone knows how this could be done so I can create one shell swf file, and load the xml file in the html/php code. Thanks!!
    Last edited by djsting; 03-16-2009 at 01:30 AM. Reason: something to add

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    To call it from the html look into Flashvars. Search Flashvars on Flashkit.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Member
    Join Date
    Feb 2009
    Posts
    30
    Quote Originally Posted by cancerinform View Post
    To call it from the html look into Flashvars. Search Flashvars on Flashkit.
    Thanks for that! I thoroughly researched it, and managed to get FlashVars to work for me on this project thanks so much!!!

    However, my initial problem I was having is still presenting itself... the scrollbar I added does not let you scroll the text field. You can see my finished product here:

    http://www.djlittlefever.com/mixshow_player.html

    You can scroll down the text by holding it down and dragging, but the scrollbar is not working. The text field is not a movie clip, just a dynamic text field with an instance name of show_txt. It is set to scrollable, and the UIscrollbar is linked to it in the parameters. Do you know why it's not working for me? I'm stumped

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Is your problem solved, since I can scroll the text.
    - The right of the People to create Flash movies shall not be infringed. -

  5. #5
    Junior Member
    Join Date
    Mar 2009
    Posts
    3
    try this:


    <setting mode="normal" allowDrag="false" allowDoubleClickToSwitchMode="true" menuMode="hide" openMenu="true" autoPlay="false" loop="true" shuffle="false" volume="75" mute="false" backgroundColor="0x000000" backgroundAlpha="100">

    <audio cover="files/cover.jpg" title="Novej:He made it work" url="files/FOC/01.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:I give You praise" url="files/FOC/02.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Let you Know" url="files/FOC/03.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:I press" url="files/FOC/04.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Amazing" url="files/FOC/05.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Try Jesus" url="files/FOC/06.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Like You" url="files/FOC/07.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:King" url="files/FOC/08.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Bible Definitions" url="files/FOC/09.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Everyday Like Sunday" url="files/FOC/10.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Soldier" url="files/FOC/11.mp3"/>
    <audio cover="files/cover.jpg" title="Novej:Washed in the Blood" url="files/FOC/12.mp3"/>

    </setting>

  6. #6
    Member
    Join Date
    Feb 2009
    Posts
    30
    Yes... my problem is now solved! I guess I had two different topics for similar issues. I ended up switching out the dynamic text field for a TextArea component and that did the trick! Everything seems to be fine now. Thanks everyone for your help!!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center