ActionScript 2.0 :: Random Line From External Txt File?
Apr 20, 2007I have an external text file which has 1500 lines and I want to load randomly 100 lines into flash. Each line should be on its own text field.
View 4 RepliesI have an external text file which has 1500 lines and I want to load randomly 100 lines into flash. Each line should be on its own text field.
View 4 RepliesI'm tring to import a text file and have a dynamic text field display a random line from that file (picture a quote-of-the-day type scenario). I've been able to import the file, but I have yet to find a way of displaying a random line from the file.
View 8 RepliesI have a .txt file with 10 variables containing 10 sentences. The variables are named myText1, myText2, myText3, etc.
I want to be able to load one of these sentences at random into a dynamic text box.
My plan was to generate a random number i and concatonate it to the variable name (ie myText + i) then call that in a LoadVars.
However, I am not able to properly reference it.
Is it possible to load a text file using line breaks as a delimeter rather than having a &var= at the beginning of each line? Like by a for instance? I have a text file with about 1000 lines that I need to load/display.
View 5 RepliesI need to read a large CSV file (8-15 MB) and generate a LineChart in Flex AIR. Since Chart need data in structurd format like XML. When I read CSV and convert it to XML object 8 MB file size become 24 MB XML object and not able to graph.
Best solution is to read Line by line and read only part of data. How can I acheive this in Flex AIR ? Is it possible to read line by line in Flex.
Otherwise what are the best ways to draw a graph in FLEX using large data.
How I can make this script lo load mp3 files via an external xml file like music.xml and if is possible to load random
Code:
music = new Sound();
music.onSoundComplete = function() {
[code]....
im playing with the load random movie (but loading a random xml file instead) based on the wonderful tutorial from front page and was wondering whether anyone can show me the work around/upgrade to AS2 for this bit of script since im publishing to Flash 8 /AS2 and it doesnt work:
[Code]....
Let's say I have a movieclip, which contains a simple circle draw on it. What I need is to scale the movie clip along a random line (not vertical or horizontal only). The picture attached probably illustrates what I mean. The only idea I can have is to combine usual scaling and rotating.
View 0 RepliesAnd I want it to randomly wave like if it was a hair in the wind, or like a snake moving, or even like a flame waving.Is there any way of doing it with actionscript?Is it also possible to make react to the cursor? When I pass through it with the mouse it moves, like if I just touched it.
View 6 RepliesHere is what im trying to do:
I have created a movie clip which contains a bubble inside it which floats upwards. On my main banner i want this symbol to appear randomly (time and location) but at the same height measurement everytime, but a random width value.
im trying to create a random moving line along the x-coordinate that with each cycle will move for a random distance at a random speed. i can generate the ranom distance and speed just fine, but i cant get the speed to apply the movement for then length of the distance. i have tried using a for loop:
[Code]....
i need to split a large text file into an array at line breaks so one array element = one line.i have tried the using "" in both match() and in RegExp but it doesnt work.i had the g and m flags on. tried the $ sign too.
View 8 RepliesHere is a link to FLA with random jumps to the various frame labels with in the time line [URL] I have 2 questions about this file
[Code]...
i have an xml file and i want my code in flash to read it line by line but its only showing the first line out of 5 lines.Below is the code:
var NigeriaNumber:Number;
var stateName:String;
var year:String;
[code].....
I am wondering if it is possible to use random file access for reading and writing data to file in Actionscipt 3.0 similar to that what is in Visual Basic?
View 1 RepliesI'd like to load an external PNG and use it as a brush for a line I am drawing using graphics.lineTo(). I'm trying to load the PNG, draw it into a new BitmapData-object and apply this BitmapData-Object to the line via lineBitmapStyle. Like this:
Code:
var hello:MovieClip = new MovieClip();
var ldr:Loader = new Loader();
var pinselFile:URLRequest = new URLRequest('pinsel20x20.png');
[Code]...
But somehow (as always) it just won't work. The PNG is loaded fine, I can use it anywhere else btw.
I can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
View 15 RepliesFor some reason, when I import my external html to my page, I'm getting extra line breaks. Even if I don't use a <br> in the line, but do a hard return, I'm getting a line break. So that's weird too. As well, it doesn't do the bold (which may be an embedding issue, as I'm using a nonstandard font. I've got the normal font embedded. of coruse, the italics works, which is weird.). What am I doing wrong?I don't think it does anything, but I've set the textbox to "render as HTML," if that effects anything.
My AS code:
ActionScript Code:
dynamic_txt.visible = false;
[code]........
I'm using Flash CS3. [URL]I have a series of external SWF's that load into a main SWF randomly, then dissapear and the next random SWF loads. It works fine for a while, but if you stay on the page for a couple minutes, then whatever the last random SWF was, starts to repeat, rather than another random SWF loading. I need the SWF's to randomly appear no matter how long someome stays on the page.
randomClips = new Array ("/Flash/ACDC.swf", "/Flash/Aerosmith.swf", "/Flash/Boston.swf", "/Flash/Doors.swf", "/Flash/Doobies.swf", "/Flash/Halen.swf", "/Flash/Journey.swf", "/Flash/LedZep1.swf", "/Flash/PinkFloyd1.swf", "/Flash/Skynard.swf", "/Flash/Stones.swf");
var mclListener:Object = new Object();
[code]....
On my web site, i would like to load some external FLV files, so that they play as soon as the page loads. I would probably load them into a movie clip, or just directly into the site, either way i dont mind. The catch is, can they be randomly selected from a folder external to the site at the site's route?
View 1 RepliesI'm trying to load a random swf from the same folder when the main swf is started. So basicly the main swf contains nothing, just the randomized code, and the content I'd like to show is in the same folder but being loaded random on startup.
I had a few things in mind but I'm still not sure how to cope with this. I was thinking having the URLRequest load a random number and that number would represent an array spot. And this array spot would contain the information about the external swf I would want to load. But the random would need a max because if the random would give a 20 if there are only 10 files, nothing would happen offcourse.
I have this code that I am using to randomly load in external swfs. It seems to be working but, as I know very little about coding I just wanted to ask the experts and see if its ok? or should be done differently. I added the preloader code from watching the tutorials but not sure if its even in the right place?
Code: Select allimport flash.display.Loader;
import flash.net.URLRequest;
import flash.events.Event;
[Code].....
How do I load a external file and then display a random var (fact) from it?? this is what I got :-)
-------------AS--------------------------
loadVariablesNum("data.txt", 0);
------------------------------------------
-------------external file-------------
[code]......
I have 5 external flash files that i am trying to load randomly in from a seperate flash files (main.swf is trying to randomly load: Flash1.swf, flash2.swf, flash3.swf, flash4.swf, flash 5.swf)
this is what i have so far:
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("flash1.swf");
myLoader.load(url);
it works in loading just one flash movie but im looking to have to randomly load from the five .swf's
How can I replace text loaded from an external file with text from another external file? Using setInterval and calling the .load from a function or something? In the example below I'm calling an external text file, could this also work with an .xml file with cycling through the children?
[Code]...
I have 5 external flash files that i am trying to load randomly in from a seperate flash files (main.swf is trying to randomly load: Flash1.swf, flash2.swf, flash3.swf, flash4.swf, flash 5.swf) this is what i have so far:
var myLoader:Loader = new Loader();
addChild(myLoader);
var url:URLRequest = new URLRequest("flash1.swf");
myLoader.load(url);
it works in loading just one flash movie but im looking to have to randomly load from the five .swf's
I've got main time line as Main.swf (level 0) and few external swf files: Message_01, Message_02, Message_03 etc.By the end of the main time line there is a key frame with the script (AS2).The script should call randomly one of the external swf and load it to level 2.
View 5 RepliesI was wondering if there was a way to modify the current tutorial regarding "loading random movie clips from external swfs", into MC containers on the stage? I would like it to do the following
[Code]....
I have gotten my movies to play at random from external files but the links that where coded into the random swf files no longer work. could there be an action script issue? The random swf files are as3 and the player file is as2????
View 1 Repliesi'm using this code i got on-line, the text is being outputted through a dynamic text box, which is multi line enabled and html. Yet I just can't seem to get a single line break, i can get a double by doing a normal line break in notepad. But i need a single. And <br> doesn't seem to work.
Quote:
myLoadVars_lv = new LoadVars();
myLoadVars_lv.onLoad = function(success) {
if (success) {
[code]....
and my text file is
Quote:
variable1= 1) Blackpool 02 Academy, 14/4/10, 19:30, 4.50 <br> Liverpool 02 academy, 25/08/11, 13:00, 5.00