Home | Help Forums | Web Design Tutorials | Free Swishmax Downloads | All Downloads

 

 

Company

Home

Nework Details

Tutorials

SWiSH 2

SWiSHMax

Flash MX

PHP & MySQL

HTML / JScript

Adobe Photoshop

Corel Draw

Gimp

Miscellaneous

Downloads

Templates

Plugins

Fonts

Wallpapers

Free Images

Scripts and Codes

Products

E-Books

SWiSH BB

SWiSH Templates

SWiSH-DB Newsletter
Subscribe to our newsletter : GO
  Partners / Affiliates

   Swish Templates
   SWiSH Climax
   GimpTalk
   Idea Designs
   Sposatoettore
   Try Acai Berry Diet
   Download Free Ringtones
   Swishzone

Manage your site with Flax Article Content Management System
External txt, trasform it in Array and html
Category : SWiSHMax | Level : Intermediate | Language : English
Ask Question | Read Comments | Post tutorial | Previous | Next

Web www.swish-db.com

An example of as to read an external file to transform it in Array and in html,
through SWI.
external txt:
CODE


&tot=4&

&song1=1 Name of the mp3&
&band1=1 Name of the band &
&url1=1 Url of the mp3"&

&song2=2 Name of the mp3&
&band2=2 Name of the band &
&url2=2 Url of the mp3"&

&song3=3 Name of the mp3&
&band3=3 Name of the band &
&url3=3 Url of the mp3"&

&song4=4 Name of the mp3&
&band4=4 Name of the band &
&url4=4 Url of the mp3"&

&done=1&


Swi:

we have to define a variable (des)of dynamic text
do not forghet to chech <>
user posted image

CODE

onLoad () {
   totsong=new Array;               // array for the var of txt
   totband=new Array;
   toturl=new Array;
   loadVariables("listmp3.txt");
}
onFrame (2,afterPlacedObjectEvents) { // read all variable of txt
   if (done != "1") {
       prevFrameAndPlay();
   }
}
onFrame (3) {      // write the array
   i++;
   des0=eval("song"+i);
   totsong [i]=des0;
    des0=eval("band"+i);
    totband [i]=des0;
     des0=eval("url"+i);
     toturl [i]=des0;  
}
onFrame (4) {if (i<tot)    
{prevFrameAndPlay();
}
}
//As you see from this script we can add to the various texts the commands html  
//in this case I have used only the interruption of the line.
onFrame (6) {a++;
            if(a>tot){stop()}
            else { des=des+"<p>"+totsong[a]+
            "</p>"+"<p>"+totband[a]+"</p>"+
            "<p> "+toturl[a]+
            "</p>"+"<p>"+" "+"</p>";
            prevFrameAndPlay();         }
}


This is the result
user posted image

and we can use the var of Array for to do..........................
what one wants to do.

Download Source


All rights reserved - swish-db.com