Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[F8] Get File Names



i'm new to flash and i need to get the names of files that are in a folder on my hardrive. i have found some code that shoud do this for me but i cant get it working, could anybody tell me what i am missing.

fl.outputPanel.clear()
var folderURI="file:///C|/tools/";
fileList =new Array()
paths="";

function listFile(paths){
var files=[]
var folds=[]
var files=FLfile.listFolder(paths,"files");

for(i=0;i<files.length;i++){
fileList.push(paths+files[i]);
}
var folds=FLfile.listFolder(paths,"directories");

for(var j=0;j<folds.length;j++){
listFile(paths+folds[j]+"/");

//make sure that this stops at a reasonable point.
if (fileList.length > 1000)
return;
}


}
listFile(folderURI);
fl.trace(String(fileList).split(",").join(""));



FlashKit > Flash Help > Flash General Help
Posted on: 04-13-2007, 09:48 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Create Marquee Names In Flash But Edit Names In Text File HELP
Hi all im trying something new with a website. I have looked around and havent been able to find a file or help sections on this. Maybe someone can help me on this...

The marquee is going to scroll left to right and repeat over and over. This is going to be in flash. What i need is the names that are going to be in the marquee needs to be in a text file so they can easily be edited by anyone that doesnt have flash knowlege.

Can this be done?

Pass URL String From External File To AS Variable (dynamic File Names)
I have a movie player that works fine when i hard-code the url value in the video function, but when i try to pass that url/file path from an external file, the video doesn't load. I suspect that there is something i'm doing wrong with the quotes. What am i doing wrong?


Code:
var vfile:String = string("path");

supervideo = function () {
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream (netConn);
video.attachVideo(netStream);
netStream.setBufferTime(10);
netStream.play(vfile);

};

loadText.load(_global.text_url1);
loadText.onLoad = function(success) {
if(success){
showtitle.text = this.title1;
vfile = this.flv_name;
supervideo();
}
}
The value in the php file looks like this:

PHP Code:



&flv_name="elements/flv/superape.flv"& 




So ultimately i want to end up with netStream.play("elements/flv/superape.flv");. I know the value of vfile is being passed from the php file and getting into the supervideo(); function because i have a textbox echoing vfile. I have tried defining the variable with and without the ":String". Please let me know if you can see any errors. Thanks!

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?

File Names
I do a lot of sound file imports. If they contain a number it tells me it couldn't be imported but then imports it just fine.

However, sometimes I don't get the error message; the last time it imported without the message was with a 22 in the name. I haven't had the time to characterize the problem any further.

Is this a bug? A feature? Just me?

Macintosh/Flash 5

John

Archiving All Of The File Names On A CD?
hi all,

i have about 70 CDs of archived material and i'd like to create some kind of searchable "database". all i really want is some program that can log all the file names (and maybe "date saved" information) into some kind of spreadsheet.

CD: FILE NAME: DATE SAVED:
65 my_file.qxd 9/12/01

even if i could just get a program that spit out all the names (and dates) i could drop it myself into an excell spread sheet.

any ideas?

thanks a lot,
josh

Importing File Names
I've been playing around with dyanmic text over the past few weeks.
And now I want to do something a little different and I'm not sure where to start.. Lets say I have a directory full of files.

Is there a way to scan for those filenames and create a list inside flash?

Any ideas?

Searching Through File Names.
Hi I need my flash movie to be able to identify the name of a file and at the push of a button open the next file in line. In otherwords, if a file called text14.txt is currently being read out of and displayed in a scroll bar text box, and the user clicks previous, the movie should unload that file and read out of a file called text13.txt. If the user clicked next it would go back to the 'text14' and if the user clicked previous it would go to 'text12.txt'. I also need a way to remove the Next or Previous button if the next or previous file doens't exist.

Thanks~

Searching Through File Names.
Hi I need my flash movie to be able to identify the name of a file and at the push of a button open the next file in line. In otherwords, if a file called text14.txt is currently being read out of and displayed in a scroll bar text box, and the user clicks previous, the movie should unload that file and read out of a file called text13.txt. If the user clicked next it would go back to the 'text14' and if the user clicked previous it would go to 'text12.txt'. I also need a way to remove the Next or Previous button if the next or previous file doens't exist.

Thanks~

External Mp3 File Names
i need to make an mp3 player that can read file names and display them as the song's info.. without using php.. is this do able?

Encrypting File Names
<script src="filename.js" type="text/javascript"></script>

is there anyway to hide the name of "filename.js"? A way to encrypt it perhaps? I'm having trouble.. as it resides withith the script tag itself.

Anyone?
(sorry this sin't a flash question but it does have to do with a flash site i'm creating..)

Streaming MP3 File Names...
Hi,

I made a Flash MX custom music player that plays streamed MP3 files. The MP3 file names have spaces and commas in them, for example:

"Song Name,Sample.mp3"

1.) Would it have been better to name them without spaces and without commas?

2.) If so, they seem to work on my browser, do you think I need to change them?, because...

3.) I have a lot of code written with these filenames (variables for each of 11 song buttons and other places in my site to activate the player) -- but if I do need to change them...

4.) Is there a way to have Flash MX help me find and replace the song names?

Thanks,
-Todd

[F8] Broswe File Names
this is going to sound stupid, but how do i get the names of files that are stored in a folder using action script. i have a file browser working, but i want to create a list that is populated by the file names in the folder

File Names Into Flash
I've been working on trying to make flash sites which are easy for clients to update themselves.

My system at the moment for galleries is to call a php script from flash at runtime which looks inside a specific folder and returns all rellevent .jpeg files in an xml file which is then used to populate the gallery. So far so good.

My problem is this: In an ideal world, clients could simply name the file as whatever caption/title they wanted for the picture ie. The name of each picture could then be used as the caption:

Band At Photoshoot.jpg
Bass Player StageDive.jpg etc

Obviously this is not good practice though as it uses capitals, spaces and the clients will potentially use naughty characters like "/" and "@" in the file name and cause errors.

I considered asking the clients to use lower case and underscores instead of spaces, then sorting it out in Flash, but Flash's String functions make it impossible to Capitalise first letters or replace underscroes with spaces.

So how can I solve this problem?

Thanks

Flv With Utf8 File Names
Hi, i have some issues with loading videos that has none ansi charectors in there file names, the filesnames are correctly utf8 encoded and so is the html page that the flash movie lives on.

Heres a page where the video dosn't load
http://jof.dk/side174-
(/player4-3.swf?flvFilename=/files/video/småbådsfiskeri.flv)

and hers a sample of a video that does work
http://jof.dk/side176-
(/player4-3.swf?flvFilename=/files/video/put-take-spin-mede.flv)

Renaming the files to names with only ansi charectors is not an option as I am not incontrole of the file names.

The variable is correctly passed to flash as a utf8 sting and shows correct displayes in a text box, but it requests the video with a iso-8856-1 (sm%E5b%E5dsfiskeri) url rathere then an utf8 url (sm%C3%A5b%C3%A5dsfiskeri).

Is there some setting in flash i need to change to make it request the url in the right manor?

I had the same issue using AC2.0

heres "alle" the AC code in my player.


Quote:




video.source = loaderInfo.parameters.flvFilename;

Accumulating File Names
I want to add a large list of all the PDFs that I have in one file to my swf without typing them out 1 by 1? This will be so that the user can browse through them and open it. How can I make that happen?





























Edited: 12/20/2006 at 06:58:21 AM by dscreation

Reading File Names
How can I get flash to read file names from a particular folder and paste them into a text field?
thanks

Publish File Names
Is there any way so that when i publish a document to a swf the file name contains the date and time? Or instead of just overwritting the old version adds a number to the end of the new version?

File Names Problem
I've been working on trying to make flash sites which are easy for clients to update themselves.

My system at the moment for galleries is to call a php script from flash at runtime which looks inside a specific folder and returns all rellevent .jpeg files in an xml file which is then used to populate the gallery. So far so good.

My problem is this: In an ideal world, clients could simply name the file as whatever caption/title they wanted for the picture ie. The name of each picture could then be used as the caption:

Band At Photoshoot.jpg
Bass Player StageDive.jpg etc

Obviously this is not good practice though as it uses capitals, spaces and the clients will potentially use naughty characters like "/" and "@" in the file name and cause errors.

I considered asking the clients to use lower case and underscores instead of spaces, then sorting it out in Flash, but Flash's String functions make it impossible to Capitalise first letters or replace underscroes with spaces.

So how can I solve this problem?

Thanks

Buttons On The Fly With Names In External File
I just started playing more with functions and arrays in Flash 5. I want to make buttons using actionscript and an external text file. I took notes from the Macromedia Flash: Actionscript for Designers seminar in which this was covered, but it's been several weeks so things are a little fuzzy and my notes are a bit messed up.

The button names are in an ascii text file named navigation.txt. I think the text file is supposed to be
&content=nav1,nav2,nav3,nav4,nav5,nav6,nav7,nav8,n av9,nav10&

I made a button with a dynamic text field with a variable name of "buttonText" into a movie clip. It's on the main timeline, and the instance name is "button". It is to be used as a template to duplicateMovieClip.

This next part is where I really need the help. I think the code is supposed to make the original button template disappear, duplicate the button 10 times, and bring in the button labels from the text file.

In frame one on the main timeline is:

button._visible=false;
for (i=0; i<10; i++){
duplicateMovieClip("button", "button" + i, i+1)
with (_root["button" + i]);{
buttonText="myArray"
if (i>0){
_y=_root["button" + i-1]._y+_root["button"+i-1]._height
}
}
}

Or maybe I'm supposed to fit the following in somewhere:

button._visible=false;
loadVariable("navigation.txt", _root);
myArray=navigation.split(",")
myArrayLength=myArray.length;

If someone could help me iron this out, I'd greatly appreciate it.

Thanks

Load Names From Text File
How do i load these from a text file?
(General, Links, Problems, FeedBack)


Code:
CategoryName1 = "General";
CategoryName2 = "Links";
CategoryName3 = "Problems";
CategoryName4 = "FeedBack";
i want the user to type in what 'catagories' they want and then they will later be displayed in the movie.

any help woul be great!

thanx!
austin

Need To Find These Variables/mc Names In My Fla File
I have downloaded a script from an educational website.

This script has a drag and drop labelling game that marks your answers, excellent for use in education.

In my own version of the attached file i have managed to add another draggable button, however it doesn't fully work. This is because i cannot find the variables/mc names to change. i.e. when you duplicate the buttons etc you change all the variables and names to what you need.

e.g on the button 'question6text' the variable on the text is _root.choice_6 which is refered to as choice_6 in many areas of the script and this in the new button 'question7text' would be _root.choice_7.

In this case there are a few that are movie clips, and others that are variables on text boxes. I need to find out where the following variables/mc names are attached

chosentarget_1, chosentarget_2, chosentarget_3, chosentarget_4, chosentarget_5, chosentarget_6
drag1_choice, drag2_choice,drag3_choice, drag4_choice, drag5_choice, drag6_choice

so i can change them in my new button to make the script work

If anyone could find out where these are I would be grateful. They are mentioned in the script and I can only derive that because i can't find them and change them on the parts in my new button (a duplication) this is why it is not working. They are there somewhere otherwise they would not be refered to in the script.

I hope this makes sense

:/

Folder/file Names As Variables
Is this possible?
Imagine there was a folder on your root directory named 'stories'. This folder contained more folders that each contained groups of jpg's.
I need to create a container in my swf that dynamically reads the folder names from within the 'stories' folder and displays them as links (however many there are) that will open the contained jpg's in a different container.

Explanation...
I'm trying to avoid a complicated database for a photography web site. I want my client to be able to update his site simply by going into GoLive and updating/creating folder names, the jpg's that live in those folders and their file names.
I'm a professional art director who is hiring this job(coding) out, but I need to know if I can approach building the site this way before I hire somebody to do it.

Example...
www.yangtan.com (I doubt he did it this way, but it's exactly how I want the site to work).

Thanks!!!
you can email me directly at mike@styleriot.com

Loading Names From A Text File
I need to create a flash page that can load multiple names Individually, fade in and fade out from a text file or excel doc.

any links or tuts would help big time.

Thanks

[F8] Loading External File Names
Hi. I've been googling for a tutorial on this, and im not really sure its possible..
But i have a folder with files on my server. And i want to load the NAMES of theese files, not the files themselves. And insert theese names in a textfield in Flash.

Thanks in advance.

Getting A List Of All The Instance Names In A File
Is it possible to get a list of all the instances contained within a file? After a while it can get hard to keep track.

thanks

Looking For An Application That Can Take The File Names In A Folder And Put Them Into
So i have a full flash website that i use for digital photography etc , Its been working fine up till now i use advanced bach converter to make thumbnails and resize the images to the right folders


and that was fine but ive come around to that time everyone hates putting the holiday snaps online and theyres a lot of them i mean like 300 for the first day in cluding reams of duds os im gunna ned up with between 20-50 a folder . but now i have to index all of those images like i awalys do by hand and like the title suggest that isnt a possibility

so im looking for an application that can take the file names in a folder and put them into a .txt file or xml file if possible with an xml wrapper basicly i want an app that can give me this

<something>pic1.jpg<something>

for the entire folder or maby valid xml i can use expression to make it from just that node

thanks

Importing FLV's, And File Names -extensions
Ok, so here are two big ones for you all... Well I’m sure easy for most but beyond my comprehension, I am learning and I did get some books but until I understand what I am writing I cant do this kind of code myself.

So here they are.

Question one:
Can you dynamically call an FLV file into a MC?

Question two:
Can I call the file name minus the extension into a text field?

Anyway, that’s it for now... Thanks for all the help.

coop

Pulling In MP3 File Names At Runtime
Hi, I've been looking for tutorials for creating an MP3 player and I've found a few that work with an xml file, but this means hard coding the xml file into the flash file before publishing. I have a site im working on where once on each page the user has to listen to a file and then at that point answer questions on it. I don't want them to be able to browse the tracks at each stage.

Is is possible to create a generic mp3 player and then at the insertion point in the html pass the name of the file to be played at that point? If so can someone point me in the direction of a tutorial which shows me how to do it please.

Thanks form a new Flash user

Wheelz

Is There A Function To Detect File Names?
Hi Guys

I'm using actionscript to create a custom navigator for a PDF Portfolio. Currently my navigator uses the function getFileExtension(value.filename) to detect the filetype, and then assign an appropriote icon. I'm wanting to change it so that it dectects the filename, and assigns the icon based on that instead. Are there any functions like that, something like getFilename()?

Thanks

Loading File Names Into Flash With Php
ok... guys need ur help

i'm building a photography website... i need to read the jpg folder which read the files inside the folder then send the file names into flash so that i can load the respective .jpg file when the user clicks a button for it...

i've got the scripting done for the php part where the script reads the folder and echo out the file names...

now the question is... how do i get these file names in flash? i know using the loadVars object... but i want these file names to be loaded into an array if flash... cos the buttons that direct to the jpg files are dynamic... i'm thinking of using a 2-dimensional array.. one column to store a number reference and the other column to store the jpg file name...

do i create an array in php and send it into flash(dunno whether issit possible) OR send the "&fName=$fName&...&" string and then split it into the 2D array in flash...?

Loading File Names Into Flash With Php
ok... guys need ur help

i'm building a photography website... i need to read the jpg folder which read the files inside the folder then send the file names into flash so that i can load the respective .jpg file when the user clicks a button for it...

i've got the scripting done for the php part where the script reads the folder and echo out the file names...

now the question is... how do i get these file names in flash? i know using the loadVars object... but i want these file names to be loaded into an array if flash... cos the buttons that direct to the jpg files are dynamic... i'm thinking of using a 2-dimensional array.. one column to store a number reference and the other column to store the jpg file name...

do i create an array in php and send it into flash(dunno whether issit possible) OR send the "&fName=$fName&...&" string and then split it into the 2D array in flash...?

Read External File Names
Can actionscripts read external file names & put them in a variable?

grant

Appending MC Instances And Swf File Names With A Variable
Hi Everyone,

I have been working with Flash for over a year now and I'm finally taking the plunge and building an ActionScript driven Flash site. I am building an online art gallery that will display photos to a user when he or she clicks on the relevant category. ie. Clicking on "Japan" will display a selection of 20 images from Japan. Each of the photos will be stored in it's own separate swf file, so it only needs to be loaded when the user requests it. Each of the swf files is named sequentially: picture1.swf, picture2.swf, picture3.swf etc. In the main movie (main.swf), on the root timeline, I have a single movieclip instance on the stage called "container" (no quotes) which is an empty movieclip. In frame 1, a duplicateMovieClip script in the actions layer makes 20 copies of the empty "container" movieclip. On the stage, there is also a button in frame 1 to represent the gallery category: eg. Japan. When the user clicks on the button, the "on release" script starts a for loop which instructs Flash to fill each of the empty "container" movieclip instances, first with nothing (loadMovie(""); to clear them, and then with the corresponding picture1.swf, picture2.swf, picture3.swf, etc. Where I am running into problems is that I don't know the syntax for appending the "container" movieclip instance and the "picture.swf" with a variable. Here I have faked it as container(j).loadMovie("picture(j).swf"); to illustrate what I'm after. This is crucial so that Flash can increment the instance and swf file names each time the loop runs. Please advise me on the syntax that I should be using to do this.

Also, a related question here: When using the loadMovie(); script, is it possible to use a path to load a swf that is in a different directory than your main movie? Eg.: Directory structure going down the tree: container(j)loadMovie(japan/photos/"picutre(j).swf"); Directory structure going up and down the tree: container(j)loadMovie(../../japan/photos/"picutre(j).swf"); If so, please provide an example for the syntax of this. I have been pouring over all 5 of my FOE Flash books and I just can't figure these things out. Any help would be greatly appreciated.

Here are the scripts:

//main.swf, _root timeline, frame 1: duplicateMovieClip script producing 20 copies of an empty movieclip instance on the _root stage.

for (i=1; i<21; i++){
duplicateMovieClip ("container", "container"+i, i);
}
stop();

//button script, main.swf, _root timeline, frame 1. Loads 20 sequential swf files into each of the duplicated, empty movieclip instances on the _root stage.

on (release) {
for (j=1; j<21; j++){
container(j).loadMovie("");
container(j).loadMovie("picture(j).swf");
}
}

** Please note, this syntax: container(j).loadMovie("picture(j).swf"); does not work. It's just to illustrate what I'm after.

Thanks in advance for any help on this!

Ken

Load Dynamic Images With Different File Names
I'm working on a project where people can upload their own images that are then inserted into a MC. With Generator it was easy as I just used a {insert jpeg} variable. What is the equivalent in Flash MX?

Load Image Names From Txt File Then Show
I tried to do that;
a txt file which created by PHP , includes :
------ image.txt --------
image1=exim.jpg
&&image2=anteor.jpg
&&image3=antotherone.jpg
-------------------------
I load the values image1,image2,image3 but I can't show the images please help me ? how it can be possible,
LoadMovie(image1) does not work,
how it can be possible ?

Is It Possible To Save All File Names In A Folder Into Array?
Hey guys,

Is it possible to scan a folder (directory) in flash and put all of the names of all of the files in that folder into an array? What I want to do is make a photo gallery that is capable of updating it self with new images as the client drops them into the folder (the images will need to be the right dimension of course).

Thank you in advance,

Jacob Kerr
WI Works, Inc. - Web Development Engineer

Names From Extenal XML File To String Variable
I'm new to AS 3 and I have this problem:
I want to make a dynamic menu with some buttons. Names(labels) of these buttons are in external XML file. Parameters of buttons are specified in main file .fla. I have also actionscript file .as (it works without errors), which makes these buttons with parameters specified in main file .fla .And I want to GET NAMES OF BUTTONS FROM EXTERNAL XML FILE TO STRING VARIABLE, but here is the problem. How could I do that? Please help.

Here are my scripts:
------------------------------
this is in main file .fla:

import flash.events.*;
import flash.net.*;
import flash.text.*;

//declarations
var NumberofButtons:Number = 3;
var xposition:Number=25;
var textBut:String=new String;

//load XML file names.xml
var navData:XML;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
loader.load(new URLRequest("names.xml"));

function onComplete(evt:Event):void {
try {
navData = new XML(evt.target.data);
trace(navData);
loader.removeEventListener(Event.COMPLETE, onComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
} catch (err:Error) {
trace("Could not parse loaded content as XML:
" + err.message);
}
}
function onIOError(evt:IOErrorEvent):void {
trace ("An error occured when attempting to load the XML " + err.message);
}

//parameters of buttons
for (var i:Number=0; i<NumberofButtons; i++) {
//text of button label - HERE IS PROBLEM MAYBE
textBut= navData.buttons.button[i].text();
function positions():Number {
xposition=xposition+75;
return xposition;
}
// CreationBtn(hightofButton, widthofButton, colorofButton, colorofTextLabel,
// textLabelofButton, xpositionofButton)
var btn:Sprite = new CreationBtn(25,50,0xFFFF00,0x000000,textBut,positi ons());
addChild(btn);
}
----------------------
here is XML file - names.xml
<buttons>
<button>Animations</button>
<button>Photo</button>
<button>Books</button>
</buttons>
----------------------
actionscript file is CreationBtn.as and has no errors
----------------------

Can I Use File Names From Some Folder To Specisfly A Value Of A Variable
so here is the thing I want to do:
I've got like 3 variables in my swf file which value tells to the code how many picture there are to load.
So I have like
var totalPics:Number = 5
in my folder images I have 5 pics, but I want to put 3 more so I want to make suck code that will check the total files in the folder and return a value of 8 or check the name of the last file found in the foulder like pic8.swf (I've made it into swf to load in a loader) and to take that letter 8 from it as a value to put in the variable totalPics so it is = 8.
Can u tell me is this possible to make in flash.... where I should read helps or guides .. or just give me a simple example please.

Thank u a lot. If u have any more questions, just ask me..

Names From Extenal XML File To String Variable
I'm new to AS 3 and I have this problem:
I want to make a dynamic menu with some buttons. Names(labels) of these buttons are in external XML file. Parameters of buttons are specified in main file .fla. I have also actionscript file .as (it works without errors), which makes these buttons with parameters specified in main file .fla .And I want to GET NAMES OF BUTTONS FROM EXTERNAL XML FILE TO STRING VARIABLE, but here is the problem. How could I do that? Please help.

Here are my scripts:
------------------------------
this is in main file .fla:

import flash.events.*;
import flash.net.*;
import flash.text.*;

//declarations
var NumberofButtons:Number = 3;
var xposition:Number=25;
var textBut:String=new String;

//load XML file names.xml
var navData:XML;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
loader.load(new URLRequest("names.xml"));

function onComplete(evt:Event):void {
try {
navData = new XML(evt.target.data);
trace(navData);
loader.removeEventListener(Event.COMPLETE, onComplete);
loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);
} catch (err:Error) {
trace("Could not parse loaded content as XML:
" + err.message);
}
}
function onIOError(evt:IOErrorEvent):void {
trace ("An error occured when attempting to load the XML " + err.message);
}

//parameters of buttons
for (var i:Number=0; i<NumberofButtons; i++) {
//text of button label - HERE IS PROBLEM MAYBE
textBut= navData.buttons.button[i].text();
function positions():Number {
xposition=xposition+75;
return xposition;
}
// CreationBtn(hightofButton, widthofButton, colorofButton, colorofTextLabel,
// textLabelofButton, xpositionofButton)
var btn:Sprite = new CreationBtn(25,50,0xFFFF00,0x000000,textBut,positi ons());
addChild(btn);
}
----------------------
here is XML file - names.xml
<buttons>
<button>Animations</button>
<button>Photo</button>
<button>Books</button>
</buttons>
----------------------
actionscript file is CreationBtn.as and has no errors
----------------------

Return File Names In Folder....filereference Class?
with flash 8 is it possible to return what files are in a given folder?


maybe via the filereference class?

How Do I Change The Menu Item Names? [flash File Attached]
I bought this template and I can't seem to figure out how to change the item names on the menu - they all say "Home" when I open it in flash 8 - you'll see what i mean when you open the file

Also where it says the date when you open it in flash it says "'hukl tyui ryui ty" so i m trying to figure out how to do those two things.

Thnx in advance for the help

(I know the file is big but please be patient and help the nooby) -lol


Download Here

Mulitiple File Names As A String In One XML Attribute, Then Spliting Into An Array
I am attempting to take an already opperational xml video player with a playlist and add the ability to assign mulitple filenames to a single description in the playlist. I want the video player to play through 6 video clips sequentially and then move on to the next title in the playlist which will also have another 6, etc.

I tried to create a String and then split that string into an Array. But I am uncertain how to tell the video object to play through each video.

PLEASE HELP!!!

Here is what I have so far... the string and array variables are not working properly.

Code:
xml.onLoad = function() {
var nodes = this.firstChild.childNodes;
for (i=0; i<nodes.length; i++) {
var myFlv:String = nodes[i].attributes.flv + "1_" +i+ ".flv";
var splitAr:Array = myFlv.split(",");
list.addItem(nodes[i].attributes.desc,myFlv[i].attributes.flv);
}
vid.play(list.getItemAt(0).data);
list.selectedIndex = 0;
};

Movie File Links Refer To Instance Names In Root
I know this question has been asked a few hundred thousand times. I am an extreme beginner when it comes to any type of programming, especially actionscript. I have a menu movie that needs to refer to instance names in the root. I have looked at using variables, tell target and a bunch of other crap that I don't understand. I really need to have somone explain how to do this. Please help me! Here is what I am looking at.


Code:
on (release) {
_root.gotoAndStop ("Scene 1", "mbasic");
}
I know this isn't right, but I am soooo lost. Again, remember I am really stupid when it comes to this, so I guess we can give this a try!!

Mulitiple File Names As A String In One XML Attribute, Then Spliting Into An Array
I am attempting to take an already opperational xml video player with a playlist and add the ability to assign mulitple filenames to a single description in the playlist. I want the video player to play through 6 video clips sequentially and then move on to the next title in the playlist which will also have another 6, etc.

I tried to create a String and then split that string into an Array. But I am uncertain how to tell the video object to play through each video.

PLEASE HELP!!!

Here is what I have so far... the string and array variables are not working properly.


Code:
xml.onLoad = function() {
var nodes = this.firstChild.childNodes;
for (i=0; i<nodes.length; i++) {
var myFlv:String = nodes[i].attributes.flv + "1_" +i+ ".flv";
var splitAr:Array = myFlv.split(",");
list.addItem(nodes[i].attributes.desc,myFlv[i].attributes.flv);
}
vid.play(list.getItemAt(0).data);
list.selectedIndex = 0;
};

Take 2 Arrays (1 Of First Names And 1 Of Last Names), Then Combine The First And Last
Hi everyone. I'm totally new to actionscript and trying to do somethng simple but I just can't see where I'm wrong. I'm trying to take 2 arrays (1 of first names and 1 of last names), then combine the first and last names into a string, and push that string into another array as one index.

My loop seems to be working fine, except that when I trace the array after the function, it just shows the last name. I think this is because I am not pushing within the function?

Can someone advise me or show related examples???

Thanks!


Code:
var classFirsts:Array = ["Albert", "Amber", "Conway", "Danny (Shyang-Min)", "Darcy (Yun-Ching)", "Dongwoo", "Fiorella", "Jae Hwan", "Jie Yun", "Julia", "Justin", "Kane", "Kunal", "Michael", "Rohini", "Scott", "Thai"];

var classLasts:Array = ["Dang", "Krishan", "Liao", "Chang", "Wang", "Kim", "Gu", "Kim", "Roe", "Vallera", "Blinder", "Albarron","Patel", "Thibodeau", "Rathi", "Hartman", "Le"];

var numFirstNames:uint = classFirsts.length; //COUNTS NUMBER OF NAMES IN ARRAY

var ourClass:Array = new Array() ; //EMPTY ARRAY TO FILL WITH CLASS NAMES


function getFullName():String {
for (var i:uint = 0; i < numFirstNames; i++) {
var fullName:String = classFirsts[i] + " " + classLasts[i];
}
return fullName;
}

var fullName:String = getFullName();
ourClass.push (fullName);
trace(ourClass);

AS2 : Using Variables As Array Names/ Dynamic Array Names
Hi,

Hoping someone here can help me with this problem:-

This code works (as part of a loop):-

attachMovie(x1r1[i], "Aln1" + i, i);

where x1r1 is the name of an array which gets cycled through.

However, this array name will change on a new level, (lvl) so what I really
need is something that works like this:-

lvl = 1;
var ex = "x"+lvl"+r1"
attachMovie(ex[i], "Aln1" + i, i);

However flash does not see ex as equal to "x1r1" for the purposes of
using it as an array name. Not even if I use "eval".

Any suggestions?

Thanks

Michael.

Getting XML Tag Names
is there way to get the tag name when traversing XML? so for the tag <items_id>5</items_id> i can get the value "5" but i want to no its tag name ie "items_id".

also if i want to get at my second value "items_name_raw" i get at it with myXmlList[1] but is there not a way i can get at it by using the tag name? like myXmlList["items_name_raw"] << that dose not work


Code:
var myxml:XML = <item>
<items_id>5</items_id>
<items_name_raw>test 1 earring TS</items_name_raw>
<items_name_flash>test 1 earring TS</items_name_flash>
<media_file_name>all_01</media_file_name>
<media_file_ext>.jpg</media_file_ext>
</item>;

var myXmlList:XMLList;

myXmlList = myxml.children();

for (var i:int = 0; i < myXmlList.length(); i++){
trace(myXmlList[i]);

}
traces out:
5
skull ear ring
skull ear ring
all_01
.jpg

Key Names
Is there a list used for reference for each key button on a mobile phone?
Keys 0-9 are kind of a given.
But I don't know the names of the other keys.

[AS3] Get All Names
Hopefully someone can help me out with this problem, or at least help me with a way to approach this.

I am building a class to handle the positioning of mc's that are in my display list when you resize. In my document class if I either attach or create a mc, how can I reference that mc from my other class?

It would be nice if I can set it up where in my document class I have:

var box:MovieClip = new MovieClip();

Then I can maybe create a ReferenceList class, and in my StageHandler class have something like:

trace( ReferenceList.box ); // This would reference the box mc created in my document class.

This way I can add a ReferenceList to all my mc's if needed.

I am not sure if that is possible but if anyone has some ideas please chime in.

Copyright © 2005-08 www.BigResource.com, All rights reserved