Converting .txt File To Array
Hi,
I have a text file, which has large arrays in it of this format,
&Array1 = [2, 2, 2, 2, 2, 2, 2, 2, 2, etc etc etc ]; &Array2 = [2, 2, 2, 2, 2, 2, 2, 2, 2, etc etc etc ];
I need these loaded in at the begining of my movie (before any other actionscript can run), and converted to arrays in my Flash movie. When I do loadvariables, it just loads the text file in as a string, but I need it as a array.
How would I do that?
thanks for any help.
phil.
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-31-2003, 06:25 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Converting A PDF To A Flash FLA File Without Converting To An Image First?
Basically, I'm building a digital catalogue that runs off a CD and uses a Flash 'page turning component' to display the pages. Certain pages will have links that use Flash's Fscommand call to open Word and Excel documents.
Has anyone got any bright ideas of how to Convert a PDF to a Flash FLA file without converting to an image first?
I know I can open a PDF in Photoshop, save as a PNG or JPG and then import this into Flash, however the quality isn't brilliant. If you use a hi-res image, then you get a hi-res file size...
Currently, the best way I have found, is to open the PDF in Illustrator, then export it as a SWF. Illustrator converts all text to shapes and you end up with a small SWF, yet great quality when displayed in larger sizes. As I'm currently using a page turning flash component that loads SWF files, I need the quality to be good for the 'Zoom' function.
I've found an Illustrator script that will do the hard work via a 'batch' process, so I can take a 100 page PDF and convert the whole lot to 100 SWF files while I drink tea and 'look busy' and read a magazine, but the problem I have is that I need to add a layer of buttons to several of the SWF files to add a little functionality....
I do have a SWF to FLA decompiler which does a good job, however because Illustrator turns everything into shapes, the decompiler does the same and you end up with thousands of files in the library.... Plus there are a lot of error messages when the file is first loaded...
Many layers are masked, (for some reason without a fill), so if you publish the decompiled file straight away, you just get a blank file. Once you go through and fill the masks needed, it shows when you publish, but this really is a lot of work and I've had a few pages that show when you open the SWF file, but don't show when the SWF is called into the page turning file.... Hmmm....
So in short, I'd like to take a PDF and convert it to a FLA file, add a layer of buttons and publish as a SWF file....
Anyone got any 'Pearls of Wisdom'?
Clere
Clere Print
Converting & And ' From An Array
I have this array :
that is from xml:
["images/bob's.jpg",
"images/bob&john.jpg",
"images/bobpic's.jpg",
];
how do i go tru for loop searching for ' and & and convert them to ' and & ?
thanks in advanced.
Converting A String Into A Array? Please Help
Hello,
I have the following Variable named strArray
strArray=Unknown,Pre-Underwriting,Processing,Final Underwriting,Closing,Team Leaders,Account Executive,Account Manager,Post Closer,Account Manager 1,Account Manager 2,Account Manager 3
>>I am then tring to delcare that array in flash with:
autoEntries = new Array ();
autoEntries = [eval(strArray)]
// I have also tryed: autoEntries = strArray
Please tell me what I need to do???
Thanks
Converting String To Array Value
hey freinds...
heres a quick question.
say the user has an input box where he can type in a value. (ie: the user types -> ["one", "two", "three"] <- in the box.
can I get flash to read that as an array?
heres a quick script I did to demonstrate what I mean...
code:
importedNames = "["bob", "george", "paul"]";
trace(importedNames);
//returns:
//["bob", "george", "paul"]
thearray = new Array();
thearray = importedNames;
trace(thearray);
//returns:
//["bob", "george", "paul"]
trace(thearray[2]);
//returns:
//undefined
//desired return:
//paul
thanks all
[F8] Converting A String To Array
Hello,
I'm not that up on actionscript like i used to be and i can't figure out where i am going wrong so please excuse me if this is blindly obvious or totally wrong. I'm reading in a text file using loadvars and i then want to load that data into an array by splittling it. where am i going wrong. please help!
Code:
adverts = new LoadVars();
adverts.load("advertList.txt");
adverts.onLoad = function(success) {
if (success) {
trace(this.publishedAdverts);
}
}
var adlist:String = adverts;
var adNosArray:Array = adverts.split(",");
for (var i = 0; i<adNosArray.length; i++)
{
holder.loadMovie(adNosArray[3]);
trace(adNosArray[i]);
}
any light shed on this would be greatly appreciated. Sorry again if it is utterly wrong!
cheers
neil.
XML Converting To AS Array Trouble
I’m working on this project and the company I work for doesn’t support XML. I have this flash file that I didn’t write that I'm trying to convert the xml over to AS. My problem is I don’t seem to be able to duplicate the array. I want the array data to be written the same as if it came from an XML document because this array is connected to a lot of other things that I really don’t want to go in and mess with. The original code looks like this the following code. Does any one know how I could convert it back to AS? Thanks for any help. :)
Attach Code
// initialize XML
johnnypagesXML = new XML();
johnnypagesXML.ignoreWhite = true;
// main load function
johnnypagesXML.onLoad = function(){
// create main book array
pseudoRoot.contentArray = new Array();
// create main XML array
mainArray = new Array();
// grab XML nodes
mainArray = this.firstChild.childNodes;
// place file names into main book array
for(i=0;i<mainArray.length;i++){
if(mainArray[i].nodeName.toUpperCase() == "PAGE"){
pseudoRoot.contentArray.push(mainArray[i].attributes.filename);
}
else if(mainArray[i].nodeName.toUpperCase() == "PARAM"){
Object.prototype[mainArray[i].attributes.name] = mainArray[i].attributes.value;
}
// check for alternate xml file
if(Object.prototype.alternateXML != undefined && Object.prototype.alternateXML.toUpperCase() != "FALSE"){
delete pseudoRoot.contentArray;
johnnyPagesXML.load(Object.prototype.alternateXML);
delete Object.prototype.alternateXML;
return;
}
}
// call initialize function
pseudoRoot.init();
// set initial enterFrame method
pseudoRoot.onEnterFrame = pseudoRoot.loaderEnterFrame;
}
// call XML load funtion
johnnypagesXML.load("bookdataph.xml");
*****************************
And here’s the XML file:
*****************************
<johnnyPages>
<page filename="cover.jpg" />
<page filename="coverinside.jpg" />
<page filename="page01.jpg" />
<page filename="page02.jpg" />
<page filename="page03.jpg" />
<page filename="page04.jpg" />
<page filename="page05.jpg" />
<page filename="page06.jpg" />
<page filename="page07.jpg" />
<page filename="page08.jpg" />
<page filename="page09.jpg" />
<page filename="page10.jpg" />
<page filename="qual_cover.jpg" />
<page filename="qual_left.jpg" />
<page filename="qual_right.jpg" />
<page filename="qual_back.jpg" />
<page filename="backinside.jpg" />
<page filename="back.jpg" />
</johnnyPages>
*****************************
When I debug the variables look like this.
*****************************
Variable _level0.mainArray = [object #13, class 'Array'] [
0:[object #14, class 'XMLNode'] {
<page filename="cover.jpg" />
},
1:[object #15, class 'XMLNode'] {
<page filename="coverinside.jpg" />
},
2:[object #16, class 'XMLNode'] {
<page filename="page01.jpg" />
},
3:[object #17, class 'XMLNode'] {
<page filename="page02.jpg" />
},
4:[object #18, class 'XMLNode'] {
<page filename="page03.jpg" />
},
5:[object #19, class 'XMLNode'] {
<page filename="page04.jpg" />
Converting Array Into URL Encoded String
i am trying to convert an array into URL encoded format to save to a text file.
I have been joining the array with .join(",") but when i convert it using .escape it also converts my comma's which Im using to split the array when I import.
can anyone suggest some code to URL encode my data in the array and then join it with commas seperating the array elements?
Converting A Formated String Into An Array
I have a .txt file with a huge mulitdimesional array in it.
For example:
//in myTxt.txt
spectrum=[[0,0,0,0],[0,1,2,3],[0,2,5,3]]
when I use a loadVars object to load it, I can trace spectrum but I can't trace individual values such as spectrum[2][1] because I assume it is being loaded as a string.
How would I go about converting spectrums value into a readable array?
Converting A String To Number Array
basicaly if you can read the code then you understand what i am doing sorry i cant realy explain what it is doing but if you can read action script then you can under stand what i am doing
if you run this script it output this
Quote:
1
0
1000
100
10
final =undefined10100010010
everything is working unil the code reaches to finaly
what i am trying to do is add them all like a math equation
but what the script is doing is joining the script like a string
does any body know how i can convert this string into a number
so the script will at final add and not join together like a string
not php actionscript
PHP Code:
var my_str:String = new String("10444");
var my_array:Array = my_str.split("");
var length:Number=my_array.length;
var whilenum:Number = 1;
for (var i = 0; i<my_array.length; i++) {
if(my_array[i]== 4)
{
var digit:Number;
var full:Number =10;
digit = my_array.length - i;
digit = digit -1;
for(var b =0; b < digit; b++)
{
full =10 * full;
}
my_array[i] = full;
full = 10;
}
trace(my_array[i]);
}
var final:Number;
for( var c = 0; c < my_array.length; c++)
{
final = final + my_array[c];
}
trace("final ="+ final);
i am sorry i cant realy explain what i am doing but if you have a question or need information i would be happily to answer it as the best i can
thank you in advance
Converting Elements In Array To Numbers
I've been using arrays to store data throughout my FLA, but now when I want to add up a bunch and spit out a sum for total, I'm getting NaN errors. Please help. Here's the code:
ActionScript Code:
_root.totalQuantity = (drug01[2] + drug02[2] + drug03[2] + drug04[2] + drug05[2]);
I want it to LITERALLY add those numbers together. What's the deal?
Converting An XML Attribute String Into An Array?
I'm trying to convert the titles in a playlist from an attribute string into an array and can't seem to get it to work properly. Every time I trace out the array I get undefineds. thanks
_global.trackfile is the attribute string I am bringing in from XML
Code:
function splitstring(trackfile) {
var myStr:String = _global.trackfile;
var myArray:Array = new Array();
var testarray:Array = new Array();
for(j=0; j<myArray.length; j++)
myArray [myArray.length]= (_global.trackfile.split(","));
};
Converting An Image To An Array Of Bits
Hiz!
I´d like to convert an image or a portion of my Fla in an Array of bits.
The objective of that is to send that array to an JAVA aplication an then convert the Array to the original picture.
The Class BitmapData allows to work with bitmaps and the bitmapInstance.getBits() seems to do exactly what i wont but i dont know how to "link" that information.
I use Flash8.
Can anyone help me in this matter??
Help Converting Code From A Mc Clipevent To An Array...
im creating a side scrolling game, but instead of a space ship and enemy ships, i have a guy dodging a flower, a cat, and a perfume bottle... so far everything is working fine. the following code example is what i have on the flower, cat and perfume bottle. they are all set up onClip events with random locations and hit test.. HERE THE WORKING CODE....
onClipEvent (load) {
function reset(){
this._x = random(600)+1500;
this._y = random(500)+100;
enemySpeed = 10;
this.gotoAndStop(1);
}
reset();
}
onClipEvent (enterFrame) {
this._x -= enemySpeed;
if (this._x <- 100) {
reset();
}
if (this.hitTest(_level0.guy.hitTarg)) {
_level0.lives--;
_level0.counterDist.stop();
trace("you hit the flowers");
}
lives();
}
what i want to do is consolidate this code(x3 becasue this code example was only from the flower mc) into an array...AM I ON THE RIGHT TRACK HERE???? i need all the randomness and hit.test incorporated into the array..
var numEnemy = ["flower", "perfume", "cat"];
for (var i:Number = 0; i < numEnemy.length; i++) {
flower.duplicateMovieClip( "flower", "flower" + i, i + 100);
perfume.duplicateMovieClip( "perfume", "perfume" + i, i + 500);
cat.duplicateMovieClip( "cat", "cat" + i, i + 1000);
}
Converting Swf File To Broadcast Quality Movie File
I'm using a Patrick Jansen effect in flash and if I try to export it the way I usually do for movie credits - ie export to quicktime - all I get is a grey box. The only way I can get the movie into a quicktime file correctly is to save the file as an swf then use "swf and flv player" to export each frame as a tif then recompile in quicktime.
Is there a program that will convert the SWF to quicktime in one go and keep the quality? It's for a movie, so I need it very high res.
thanks in advance,
(mac os x 10.4.9 G5 dual 2ghz, internal 250 and 350hd, external 500gb, 4gb ram)
Converting A Comma-delimited String To An Array?
hi guys,
i'm working on an mp3 player (had to join the trend) but of course, me being me, i've got one that'll eventually read files locally :P....wihtout needing IIS or Apache or anything other than windows
anyway,
after a million lines of functions turning %20's and all of that into something legible, i've reached this point with the code:
50 Cent (Feat. Destiny's Child) - Thug Love.mp3,Faithless - God is a DJ.mp3,Faithless - Insomnia.mp3
the mp3 names are now a comma-delimited string, but how do i make this string an array?
suggestions are more than welcome...
Ben
Populating A List By Converting A String To An Array (XML)
I'm trying to build this playlist by converting a XML string into an array and am not familiar enough with actionscript to solve my problem :-( Any help would be appreciated. Thanks
-J
Code:
stop();
// New XML object
playlist = new XML();
// Ignore white spaces
playlist.ignoreWhite = true;
// Load the XML file
playlist.load("playlist.xml");
playlist.onLoad = function (success) {
if(success) {
_global.trackfile = [];
_global.trackimage = [];
_global.trackimage2 = [];
_global.trackdescription = [];
_global.trackurlname = [];
_global.trackurl = [];
_global.my_sound = new Sound();
for (var i=0; i<playlist.firstChild.childNodes.length; i++) {
_global.trackfile[i] = playlist.firstChild.childNodes[i].attributes.tk_file;
_global.trackimage[i] = playlist.firstChild.childNodes[i].attributes.tk_image;
_global.trackimage2[i]= playlist.firstChild.childNodes[i].attributes.tk_image2;
_global.trackdescription[i] = playlist.firstChild.childNodes[i].attributes.tk_description;
_global.trackurlname[i] = playlist.firstChild.childNodes[i].attributes.tk_urlname;
_global.trackurl[i] = playlist.firstChild.childNodes[i].attributes.tk_url;
};
// Trace out all the variables to make sure they are working
/* trace(trackfile);
trace(trackimage);
trace(trackimage2);
trace(trackdescription);
trace(trackurlname);
trace(trackurl); */
splitstring();
loadmp3();
trackname_txt.text = "Nice work";
}else{
trackname_txt.text = "Somethings Wrong";
}
};
function splitstring(trackfile) {
var myStr:String = _global.trackfile;
var myArray:Array = [];
//trace(myStr);
myArray = myStr.split(",");
for(j=0; j<myArray.length; j++)
list_playlist.addItem[j]({label:myStr[i], data:"test"});
//list_playlist.addItemAt[i](0, trackfile[i])
};
trace(myArray);
btn_next.onPress = function() {
for(var i=0; i<playlist.firstChild.childNodes.length; i++) {
nexttrack = _global.trackfile[i];
//trace(nexttrack);
}
}
function loadmp3() {
my_sound.loadSound(_global.trackfile[0],true);
my_sound.onID3 = function() {
trackname_txt.text = this.id3.TIT2;
artist_txt.text = this.id3.TPE1;
album_txt.text = this.id3.TALB;
genre_txt.text = this.id3.TCON;
year_txt.text = this.id3.TYER;
comment_txt.text = this.id3.COMM;
};
}
btn_stop.onPress = function() {
my_sound.stop();
}
Converting Text-based Items In An Array To MovieClips
I've been trying to find an alternative to my problem, but all seems to no avail. The situation is the following:
I have an array which I fill at the very beginning of my code:
ActionScript Code:
var objArray:Array = new Array("apple","juice","banana","chicken","cookie","dish","milk","oranges","strawberry");
Further down, I have a function that removes an item randomly (can be anywhere in my array) and immediately adds it back at the end of the array:
ActionScript Code:
var removedObj = objArray.splice(rPosition,1); //rPosition being a random number (max = array.length)
objArray.push(removedObj);
It all works fine and I normally have quite random arrays, but now comes the part where I add them onto my stage; the part that does not work, because the items in my array are no class/displayobjects/movieclips (I guess it's the first one):
ActionScript Code:
for(var i:int=0; i<objArray.length; i++){
var libObject:MovieClip = new objArray[i]();
addChild(libObject);
}
All I know is that it does not work.
For your information, making a DisplayObject/class-filled-array from the very beginning and adding them onto stage works, but it's then impossible to remove an item out of the array (splice) and adding it back at the end. The result here (again) is that I can't add it to my stage due to the fact that the item I just re-added is not a class, but mere text. Therefore my title =D
Thanks in advance! Really hope someone can figure this out, all I need is a hint.
Converting Midi File Into Wave File
Hey folks. Is there a program that I can use that will convert midi sound files to wave files to use in flash?
Any URL or workaround would be helpful.
Problem Converting An MPEG File Into .FLV File
HI
I want to convert an video file into .FLV. I have imported an .MPEG file into the flash and i am trying to export as .Flv file but i culdnt find any option how to do that in flash mx 2004. Please can any one can help me in this concern....
Thanks in Advance
Ashirwad
Limits Of Flash Player Converting String To Array With Split() Function?
Hi all,
heres one for the real flash heads!!
i am building an application using flash 5 that will effectively need to search through all the words within a dicitonary.
Now i know that flash has alot of string manipulation power
i need to put the words into an array to then search through them.
My searching for the purposes of the application is not an issue, it does what i want, however, converting a string to an array is proving a stumbling block. I think i am right in thinking that when the loadVariables command is used, the variable comes in in string format and not array, so you need to convert within flash.
As a test, I have 2000 words coming in from a textfile using loadVariables - this comes in in an instance.
BUT if i then use the split() function to split the string into an array, the computer slows markedly and the "you are running a script that is looping alot...." warning appears.
is there a limit to how many items are held in an array?
is the split() function the best function to use?
any help would be greatly appreciated
thanks in advance
gilesb
Converting File
Ok I know I ask alot of questions. Thx for Helping me.
Ok I made my site on word ( for my first site) Now im told i need a converter to put it into the internet??? Um how can I put my word website/file into the internet. Thx
Jake
Converting Web/File
Ok I know I ask alot of questions. Thx for Helping me.
Ok I made my site on word ( for my first site) Now im told i need a converter to put it into the internet??? Um how can I put my word website/file into the internet. Thx
Jake
Converting An AS2.0 File To AS3.0?
Hey everyone,
I have a CS3 file that was given to me to make some changes to.
It was written in AS2.0, but I would like to implement some new AS3.0 classes.
Is there any way to convert this file to an AS3.0 file? I'd really like to avoid re-creating the entire .fla.
Thanks in advance for any thoughts!
Converting An AS2.0 File To AS3.0?
Hey everyone,
I have a CS3 file that was given to me to make some changes to.
It was written in AS2.0, but I would like to implement some new AS3.0 classes.
Is there any way to convert this file to an AS3.0 file? I'd really like to avoid re-creating the entire .fla.
Thanks in advance for any thoughts!
Help Converting File
I hope I can get some help here.
In a nutshell, I've made a 15-minute flash video for a friend's wedding. Basically it's a glorified slideshow, but several people asked for a copy. I'd like to provide copies as DVDs people can just stick in and play, particularly since many of them are blue-haired great aunts that won't necessarily have the latest and greatest computers, or any computer for that matter.
Does anyone out there have an angle on how to convert a Flash video into a straightforward movie format? I'm not a developer, so basically, I'm looking to pay someone to just take care of it for me.
Any leads would be greatly appreciated.
Thanks!
Array, Array HELP - Importing A External File Into N ARRAY - Almost There
I am reading and external file with the following code:
ActionScript Code:
on (release, keyPress "<Enter>") {
lv = new LoadVars();
lv.onLoad = function() {
questions1 = this.filelist0.split(",");
answers1 = this.filelist1.split(",");
for(i=0;i<questions1.length;i++)
//trace(questions1[i]+" "+answers1[i]);
trace(questions1[i]);
//assumes same number of scores in each list
};
lv.load("questions.txt");
}
When I parse the file it puts it into an columar format as it should...however I need it to look like this:
questions1=new Array ("2+4=?","What is the capital of Illinois?","What color is the sky?","10x(5+2)=?");
answers1=new Array ("8","springfield","blue","70");
How do I do that?
Text file look like this:
&questions1=2+4=?,What is the Capital of Illinois?,What color is the sky?,10x(5+2)=?")&
&answers1=8,springfield,blue,70&
Converting A File Too Use In Flash
Was wondering if anyone here can tell me how too convert a DEM file from Half-life into a movie so that i can make a flash intro too there site?
Converting SWF To Gif Animation File
Is that possible? I notice that under "Publish", it gives me the option to publish the file to Gif, but it only shows up the background image. Please help.
Converting To QuickTime File
Hello
I have a problem converting Flash 8 movie to Quick Time movie
I am using Export Movie command: selecting Quick Time file type, choosing needed options (kipping file flatten), setting Flash version to Flash Player 5, as asked.
I have a .mov file as a result, but it plays only in my computer; if I send this file to somebody else via email, it does not work anymore.
I tried to publish the movie as QuickTime – still the same result.
The size of that .mov file is equal to the size of the original .fla file, which is not right at all.
I remember, when I had Flash 5, there were no problems converting Flash movies to QuickTime movies, but now I spoke with several people, it seems like everybody have the same problem.
I would very appreciate, if somebody could help me
Thank you
Converting A MX 2004 File To MX
Hi,
I've been having trouble converting a .fla file from MX 2004 to MX.
I tried Save As Flash MX Document but when I openned it with MX it gave an error, Unexpected File Format.
I searched the forums but didn't have much success.
Does anyone know how can I convert it?
My main traget is to use Symbols I've created, I do have AS code but it's less important.
Thanks!
WMV File Not Converting To FLV Properly
I am trying to use the Flash Video Encoder to convert a WMV file that a client provided to me into an FLV file. The audio works fine in the FLV, but the image stays stuck on the first frame through the whole movie.
This file needs to be uploaded by tomorrow. I've tried compressing with about 6 different compression settings (both in Sorenson and the newer On2 VP6 codecs).
I'm about to rip my hair out.
I even downloaded a trial version of Adobe Premiere Pro CS3 to export it and it's taking an hour to do so. My suspision is that it wont work in there either.
Edited: 09/08/2007 at 08:51:28 PM by ThinkSeed
Converting Flash File To Gif?
Is there a way to export or convert a flash file to a picture file? Even if I go through fireworks? How would I get my flash animation imported into Fireworks???
Thanks,
vv
Converting A Simple AS2 File To AS3. Pic Loop Bar.
Hi everyone. I'm no expert on Actionscript 3.0. I'm wondering if someone had a suggestion on how to fix my AS3 code.
Here's the AS2 loop picture bar code. Works perfect.
_root.pics.onEnterFrame=function(){
_root.pics._x+=(86-_root._xmouse)/33.3;
if(this._x>0){
this._x=-300;
}
if(this._x<-300){
this._x=0;
}
}
Then I was trying to update to AS3. There's something obvious I'm missing, no?
pics.addEventListener(Event.ENTER_FRAME, onEnterFrame);
pics.x+=(86-mouseX)/33.3;
if(this.x>0){
this.x=-300;
}
if(this.x<-300){
this.x=0;
}
thanks kindly for any suggestions!
Converting Video File In FLV In Runtime
Hi,
I am working on a site where user can upload his video files like mpeg,avi,mov etc and i have to display that file in flash in FLV format so that its size will be minimum.
Is it possible ?
thanks for any help.
Converting An Number In A Text File To A Variable
I'm tried this a hundred ways, and can't seem to get it to work. I'm trying to get my flash file to read a number from an external text file (in form: &var0100=4&) and have the flash file go to a specific frame number based on this variable. This code works if I import it into a text file, but I can't get it to take what's in the text file and convert it to a variable. Here's my following code:
totalprojects = new LoadVars();
totalprojects.load("rmptext.txt");
totalprojects.onLoad = function(right) {
if (right) {
trace("done loading");
total.Number = this.var0100
if (Number(total) < 5) {
projectmovie.gotoAndStop(2);
}
else {
projectmovie.gotoAndStop(3);
}
}
else {
trace("not loaded");
}
};
stop();
Problem Converting Flash File To Animated .Gif
I've never made an animated gif from a flash file but the flash help says to simply do the following:
Flash exports the first frame in the movie as a GIF, unless you mark a different keyframe for export by entering the frame label
#Static. Flash exports all the frames in the current movie to an animated GIF unless you specify a range of frames for export by
entering the frame labels #First and #Last in the appropriate keyframes.
No matter what I try, when I export to an animated gif, the image that shows up is not animated but I only get the first frame. What could be missing and what areas should I check? Thanks in advance.
Importing Strings Into A Text File And Converting Them In The Movie For Use.
I have a text file, in that text file there are several strings that look like this.
&&S1=[room,250,1]&&
&&S2=[room,252,1]&&
&&totalRooms =2&&
Any they go on like that. Now what I am wanting to do is to load this text file and convert the strings into items that can be used in the movie.
The code I have tried using for this is
code:
function buildInfo() {
for (i=1; i<=totalrooms; ++i) {
foo = "T"+i;
foo2 = "S" + i;
foo = foo2.split(",");
trace("foo:"+foo[0]);
}
}
Now I was expecting this to make the S1 into T1 with the information from text file. This is not working, when I run the movie the trace("foo:"+foo[0]); returns the actual name of the S1 file and that is it. I am just not sure what I am doing wrong. Thank you for any help. I f I have not made myself clear enough, please let me know.
Converting After Effects Scene To Swf FILE SIZE Question
I have created an introduction for a website and exported it from After Effects at 640 x 480 into Quicktime. The clip is 10 secs long and renders out to 14 megs. I have Sorenson Squeezed it 780 KBs.
Is this a good size? Or should I try another route? Is so which one?
What is a good standard file size for the web?
Converting Flash Scripts Inside .fla Into External .as File?
Hi, I have a client that for some reason they are wanting to convert their .fla project and break up the 8 script layers of their game, and put it in an external .as file for the Flash project.
I was just wondering if this could be done could someone show me a link, tutorial or anything on how I would go about doing this, and why this needs to be done this way?
Easy implementation for future games of the same kind?
Retriveing Date Variables From Text File/ Converting Strings To Dates
Hi,
I'm trying to read date variables from an external text file. I'm using the LoadVars method and it is working fine for regular string variables. I'm running into trouble trying to convert some of those strings into date variables so I can compare the current date to the targetDateX variable from the text file. I'm working on a countdown timer for a list of different times/dates. It will display the time left until the first event, then after that event the time left until the second event. I'm running the code in a for loop and everything is working except being able to convert the string with format (yyyy,mm,dd,hh,mm) into a date variable- I've attached a sample of where I'm having trouble.
Thanks in advance for any help! :)
Attach Code
var targetDateX:String = "targetDate" + i;
//sets a variable targetDateX equal to the variable targetDate(i) so that you can read it from the text file
var targetDateA:Date = new Date (this[targetDateX]);
//attempting to set it into a date format
trace (this[targetDateX]);
//returns the variable stored with the name targetDate(i) in the text file
trace (targetDateA);
// returns 'Invalid Date'
Edited: 11/09/2008 at 12:45:04 PM by wyattr1
Converting Internal Array Data Into External XML Data [renamed]
I have this code inside my flash to name my navigation menu. Now I want to put this outside flash and load it via XML. How do save my different arrays into a variable for later use in my code?
In my nav fla (what i want to load from XML):
Code:
// MAIN MENU ARRAY
var mm_array:Array = ["MAIN1", "MAIN2", "MAIN3", "MAIN4"];
// SUB MENU ARRAY
var sm1_array:Array = ["sub1", "sub2"];
var sm2_array:Array = ["sub1", "sub2", "sub3"];
var sm3_array:Array = ["sub1", "sub2", "sub3"];
var sm4_array:Array = ["sub1", "sub2", "sub3", "sub4"];
var submenu_array:Array = [];
XML loading code
Code:
// LOAD MY XML
var myXML:XML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function (success:Boolean):Void {
if (success) {
// what goes here to define: mm_array, sm1_array, sm2_array etc
myXML.load("myXML.xml")
XML file something like this:
PHP Code:
<navigation>
<menu>
<mm_array>main1</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
</menu>
<menu>
<mm_array>main2</mm_array>
<sm_array>sub1</sm_array>
<sm_array>sub2</sm_array>
<sm_array>sub2</sm_array>
</menu>
</navigation>
Converting And .swf File Into A .fla File
Sorry if this topic has already been posted (the search feature wasn't working).
I was just wondering if there was any way to convert an .swf file into a .fla file. I have been doing some flash work on two computers and was copying the files to just one of them. Unfortunately I only copied an .swf file of one of them and deleted the .fla file. So I was just wondering whether there's any way to convert it into the .fla file.
Loading An Array Of File Names From A Text File.
Basically I want to do the following.
Create an array of
Image[x] = "x.jpg"
from a text file where the images are listed as
x.jpg
y.jpg
z.jpg
I can't figure out how to load these in an array and I haven't been able to produce this from the closest examples I have found.
Any suggestions?
|