Need A Person To Write Simple Array For Me.
Don't think im dumb are anything but i need someone to write a simple array for me though all my actionscripting ive never had to do it before and I really dont have the time to learn now. Let me descirbe what has to be done really simple and then ill send you a test dummy to add the code to. The game this is for is almost completed and is one of my best creations yet.
Description:
My game consists of thousands of hit tests that all work together to stop the unit from running though small objects. (mostly alot of trees and walls).
I know nothing about arrays. Heres the simple hit test all you have to do is make the number after T everynumber possible.
if (this, hitTest(_root.world.T+[i])) {
okay if you accept this job you will be included in the Credits. The file is attached, when done send it to (with the name you want to be known as under the credits):
Darktemplarian8@aol.com
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 08-09-2004, 09:10 PM
View Complete Forum Thread with Replies
Sponsored Links:
Need A Person To Write Simple Array For Me.
Don't think im dumb are anything but i need someone to write a simple array for me though all my actionscripting ive never had to do it before and I really dont have the time to learn now. Let me descirbe what has to be done really simple and then ill send you a test dummy to add the code to. The game this is for is almost completed and is one of my best creations yet.
Description:
My game consists of thousands of hit tests that all work together to stop the unit from running though small objects. (mostly alot of trees and walls).
I know nothing about arrays. Heres the simple hit test all you have to do is make the number after T everynumber possible.
if (this, hitTest(_root.world.T+[i])) {
okay if you accept this job you will be included in the Credits. The file is attached, when done send it to (with the name you want to be known as under the credits):
Darktemplarian8@aol.com
View Replies !
View Related
Simple Question? Write To Array In Parent?
I've got a movie that loads in an external swf into a movie clip. I need to be able to write items into the array in the main clip from the sub-clip...I thought it would be simple, but it doesn't seem to be working??
I'm using:
in the parent movie I create the array:
Code:
var aImages:Array = new Array(); aImages.push({image:"img1", fileLoc:""});
in the nested movie I use:
Code:
_parent.aImages[0].fileLoc == "test";
but when I trace it in the following line, it shows me what I push in from the parent, but not what I set in the nested clip??!!
Code:
trace("array "+_parent.aImages[0].fileLoc);
Thanks!!
View Replies !
View Related
Simple Questions From A Simple Person
Hi all...
I am new to flash... The only actionscript I have actionally used is "stop ();" Anyway... I'm using flash cs3... It seems a fantastic tool to a newcomer like me!! Firstly, I'll show you what I've managed to do so far...
This is my first movie...
http://www.allnationschessleague.com...tpagewhite.swf
An this is the header I would like to put at the top of the website pages:
http://www.allnationschessleague.com...ANCLHeader.swf
Well, my first question (for I am sure to return to this site for more advice, is how do I link the flags at the top, to the relevant pages. Please check out the following page to see how it should work:
http://www.allnationschessleague.com
So as you can see, the flash needs to link to php pages... for example the British flag needs to link to 'setlanguage.php?lang=en' etc... so how do I set those links for the flags?
Thank you for answering my post )
Jeff
View Replies !
View Related
SIMPLE QUESTION FOR DUMBFOUNDED PERSON
I have been following the tutorial on this website for a while on advanced rollover buttons. Please do not tell me that there is another way to do this because I have spent a long time trying to understand what is happening within the script. Otherwise, please help me with this problem
The rollover works and plays framelabel "1text" from the movieclip you, however, on the rollout, it does not play at "1back" from the movieclip you.
I have gone and looked through the whole movie and I do not see any errors PLEASE PLEASE HELP
I've attached my .fla. please take a look and see
View Replies !
View Related
Simple Question For Dumbfounded Person
How do you check the paths in a directory?
I've followed the VERY LONG tutorial in the forums regarding the resizing slideshow. I finally found one that suited my needs (made by vman) however, the images do not load when I uploaded the phps the swf and the images. Everything is correct in terms of its lay out
in the root director I have the phps and the swf
in a folder within the root directory, called "Arrar" images are kept there where they are properly named.
However the images REFUSE TO LOAD. I'm not sure if this has to do with my actionscript, the script within the php files or my paths which I don't know how to check are correct. I have attached everything except my images SOMEONE PLEASE HELP!@
View Replies !
View Related
20 Bucks To The First Person Who Can Help Me With This Simple Problem.
hi there,
My name is brandon. i have this website with a flash JOIN MAILING LIST FORM. Here is the link:http://www.brandonparis.com/upload/N...submission.fla
.its very simple it just has a email input line with a variable name "YMLPO" <--that name is a must. then there is one submit button.
when you enter your email address and press submit, your email address should be sent to this MAILING LIST PROVIDER (called YLMP a mailing list company provider) which logs into my account then enters the email address. unfortunately it does not. and im very sure its because the action script does not tell it to send the variable line(named "YMLPO"which is the email input) to enter on the site.
below is the fla. i took everything else out except the form so its simple as hell. just try entering your email address and press submit. it will say" you forgot to enter your email address"
here is what i have in the action scrip so far:
-----------------------------------------------------------------------
on (release) {
getURL("http://www.ymlp.com/subscribe.php?brandonparis", "_blank");
}
-----------------------------------------------------------------------
the part that says "brandonparis" is my account. it logs in properly but the email deosn't get entered becasue as you can see there is nothing that tells it to in the actionscript.
***here is a link to an HTML version which works perfectly when you enter your email and press submit. this may help you with figuring how to make the FLASH version work. http://www.brandonparis.com/upload/testformHTML.htm
who ever figures this out i will pay them 20 bucks. just give me a link to your paypal or give me your address which i can send you a money order. this is so important i get this fixed.
thank you all so kindly
Brandon
ps also here is my email addres : info@brandonparis.com can you please email and let me know that you solved my problem. thank you so much! you can use my email address to give me your mailing address for me to send you a money order providing that you actually solved the problem. if for soem reason it took you much longer than you thought i may be willing to pay you more.
View Replies !
View Related
SIMPLE QUESTION FOR DUMBFOUNDED PERSON
I have been following the tutorial on this website for a while on advanced rollover buttons. Please do not tell me that there is another way to do this because I have spent a long time trying to understand what is happening within the script. Otherwise, please help me with this problem
The rollover works and plays framelabel "1text" from the movieclip you, however, on the rollout, it does not play at "1back" from the movieclip you.
I have gone and looked through the whole movie and I do not see any errors PLEASE PLEASE HELP
I've attached my .fla. please take a look and see
View Replies !
View Related
Simple Question For Dumbfounded Person
How do you check the paths in a directory?
I've followed the VERY LONG tutorial in the forums regarding the resizing slideshow. I finally found one that suited my needs (made by vman) however, the images do not load when I uploaded the phps the swf and the images. Everything is correct in terms of its lay out
in the root director I have the phps and the swf
in a folder within the root directory, called "Arrar" images are kept there where they are properly named.
However the images REFUSE TO LOAD. I'm not sure if this has to do with my actionscript, the script within the php files or my paths which I don't know how to check are correct. I have attached everything except my images SOMEONE PLEASE HELP!@
View Replies !
View Related
Just Need One Knowledgeble Person To Answer A Seemingly Simple Question For Me...
I have a button that uses loadVariables to bring a txt file into a dynamic text box. I want to be able to click on a word in that txt file once it is loaded into the .swf and cause it to load a different txt file into that same text box. Instead of using a hyperlink to go to a different webpage, I want it to go to a different txt file in the same movie. Does this make sense?
Recap: This is what I want to do: clicking on a word in theory.txt causes history.txt to load into the same movie, same dynamic text box.
Please help me...this is the third or fourth time I've posted this message, and I've gotten a few views, no answers. Someone please answer!
Thankyou in advance,
Kaugummisch
View Replies !
View Related
Simple Question For Dumbfounded Person - Resizing Slideshow
How do you check the paths in a directory?
I've followed the VERY LONG tutorial in the forums regarding the resizing slideshow. I finally found one that suited my needs (made by vman) however, the images do not load when I uploaded the phps the swf and the images. Everything is correct in terms of its lay out
in the root director I have the phps and the swf
in a folder within the root directory, called "Arrar" images are kept there where they are properly named.
However the images REFUSE TO LOAD. I'm not sure if this has to do with my actionscript, the script within the php files or my paths which I don't know how to check are correct. I have attached everything except my images SOMEONE PLEASE HELP!@
View Replies !
View Related
Simple Question For Dumbfounded Person - Resizing Slideshow
How do you check the paths in a directory?
I've followed the VERY LONG tutorial in the forums regarding the resizing slideshow. I finally found one that suited my needs (made by vman) however, the images do not load when I uploaded the phps the swf and the images. Everything is correct in terms of its lay out
in the root director I have the phps and the swf
in a folder within the root directory, called "Arrar" images are kept there where they are properly named.
However the images REFUSE TO LOAD. I'm not sure if this has to do with my actionscript, the script within the php files or my paths which I don't know how to check are correct. I have attached everything except my images SOMEONE PLEASE HELP!@
View Replies !
View Related
[F8] Need To Write Array, I Think (?)
onLoad = function () {
numPart = 50;
for ( var index = 0; index < numPart; index++) {
particle.duplicateMovieClip("Particle"+index, index);
particle._x = Math.random()*320;
particle._y = Math.random()*240;
speed = Math.floor(Math.random()*3)+6;
}
}
onEnterFrame = function () {
particle._y += speed;
if (particle._y > 240) particle._y = 0;
}
This code is taken off AS 1.0 and trying to fit it over to AS 2.0 for Flash 8, since that is what got loaded into my classroom this year - and I am trying to make sure the kids are NOT writing code on the movieclips themselves and trying to get them to write on the main timeline layer.
How can I get the particle in the onEnterFrame section to create an array or loop statement so I can apply the vertical movement to all the already created duplicate clips that were created in the onLoad section.
Should I use attachMovieClip instead and just call for the clip from the library instead of duplicating it on the stage first?
Thanks for your help and my high school kids will appreciate the fix.
View Replies !
View Related
Write To An Array
How do I have variables write to an array? I have three variables coming into flash called:
spot1
spot2
spot3
and I want to have an array that holds those values. something like:
ActionScript Code:
initial = [spot1, spot2, spot3]
I've been reading the tutorials and it looks like everything has to be in quotes, but that won't work. Any ideas?
Thanx in advance.
View Replies !
View Related
How To Write An Array Of URL's ?
Hey guys,
Stupid question I know... But I don't know. LOL
In AS3, how do you create an array of external files loaded thru a URLLoader?
I know how to write an array, but I need to put down that it is basically an array of URL's, right? How do I add it to:
HTML Code:
var extFiles:Array = new Array("nnn", "nnn", "nnn");
Second question, also... What about an array of strings, would it be of any help in that case?
THANK YOU FOR ALL OF YOUR HELP!
View Replies !
View Related
Trying To Write XML Data From An Array()
Hey everyone...
I have an array called dateHolder[] and it has a random amount of items in it, each with a few dateHolder[i].date and dateHolder[i].venue style variables...
Can someone help explain to me how to write a loop that could go thru dateHolder[] and convert it to XML that I can then send out to PHP to write to mySQL?
Thanks so much!
=)
View Replies !
View Related
Write Vars Loaded From .txt To Array?
dear AS-masters:
how would i write an array from variables which i loaded to my movie from an external .txt- file?
my txt looks like:
variable1=value1&variable2=value2&....variableN=va lueN
the variables are loaded to flash properly (i checked this with a dynamic text field) but if i try to create a neqw array with my variables (i do this with an upcounting integer, like array[i]=user[i], i=i+1),
flash ignores the variables loaded from my .txt.
i tried to trace my variables, but nothing happened. maybe you have a solution to this...
thanks anyway
sojus
View Replies !
View Related
[CS3] Help Need A Cleaner Way To Write This Array Of Buttons
Hi there,
not sure how difficult this is going to be, but I have 30 movie clips, which will all be sequentially numbered. (pos1, pos2, pos3......pos30).
They will all have the same functions, with the only change being the number.
I know there is a more efficient way to write this code using arrays, but I will need help with it. I would rather have 10 lines of code than 150.
I also need help with writing the code, that will disable all other movie clips, once the first one is clicked.
Also, not sure how tricky the javascript part will be.
Below is the code i am trying to achieve, but the long version.
PHP Code:
pos1.onRelease=function(){
this.gotoAndStop("selected");
getURL("Javascript:JSposition('',1)");
(all other buttons).enabled = false;
}
pos2.onRelease=function(){
this.gotoAndStop("selected");
getURL("Javascript:JSposition('',2)");
(all other buttons).enabled = false;
}
pos3.onRelease=function(){
this.gotoAndStop("selected");
getURL("Javascript:JSposition('',3)");
(all other buttons).enabled = false;
}
pos4.onRelease=function(){
this.gotoAndStop("selected");
getURL("Javascript:JSposition('',4)");
(all other buttons).enabled = false;
}
... all the way to
pos30.onRelease=function(){
this.gotoAndStop("selected");
getURL("Javascript:JSposition('',30)");
(all other buttons).enabled = false;
}
AS Guru's please help!!!
Thanks.
View Replies !
View Related
How To Write A Simple Function?
(unanswered post from Macromedia's ActionScript Forum--please help)
Dear Users:
I have glanced at a couple of tutorials and tried to write my own function but can't seem to get it to work.
What am I doing wrong? Following is the function I wrote and the error in the Output Window.
----script in frame 1 of main timeline----
function myMove(myParam:String){
myParam.this._x=_xmouse;
myParam.this._y=_ymouse;
}
myMove(myObj_mc);
----OUTPUT WINDOW----
**Error** Scene=Scene 1, layer=actions, frame=1:Line 2: Expected a field name after '.' operator.
myParam.this._x=_xmouse;
**Error** Scene=Scene 1, layer=actions, frame=1:Line 3: Expected a field name after '.' operator.
myParam.this._y=_ymouse;
Total ActionScript Errors: 2 Reported Errors: 2
This function is attempting to recreate the startDrag() function. I'm testing to see if I can write one so that I can emplioy some new techniques for other stuff I want to do.
Thanks in advance for any help.
View Replies !
View Related
Simple Write To TXT File
Flash CS3 Pro-AS2
I'm not looking for this to run over the internet,
I'm looking for a simple way, or at least hopefully, for getting text that is submitted in one flash document (As in some text in an input box), being written in a txt file.
If I could choose, I'd prefer to be able to choose where it placed the text in the file, but I'd still be okay if it were to write the text at the end of the txt file.
Ok then, thanks.
View Replies !
View Related
*simple* How To Write Range
I am creating a flash game, and I can't seem to get a range to work correctly. I have an object that needs to be collected. once you touch it, it randomly regenerates on the y axis. That all works fine, however I'd like it to regenerate between lets say 20 and 500 because otherwise it overlaps a menu bar.
Here's what I have
Attach Code
onClipEvent (enterFrame) {
if (hitTest(_root.super_fister)==true)
{
trace("hit")
_root.score.text = Number(_root.score.text) + Number(25)
gotoAndPlay(1)
_root.point._x = (0)
_root.point._y = random(400)
}
}
View Replies !
View Related
Simple Script Yet So Hard To Write
Hey all, I need a way to simulate someone typing on a screen. They must be able to press any keyboard button and have the text appear as if it is being typed. What I need I guess is:
a)a way to mak the playhead advance on frame by pressing any keyboard button
b)a way to simulate text being typed or
c)another suggestion.
Thanks
View Replies !
View Related
Write Out Variables From A File (simple)
Can someone do a .fla file where it fetche information from a .php file, the php-file will print out text=wery much text hera as you now.
I want that the .swf file shall print out "wery much text hera as you now." so the user can see it.
(appologise for my bad english )
And one more thing: Dont give me a tutorial, I have already test many and it never work ( http://www.actionscript.org/tutorial..._counter_php3/ )
View Replies !
View Related
ReferenceError: Error #1074: Illegal Write To Read-only Property Array
I'm really sorry if this ends up a no brainer. I'm new to both AS3 and OOP and have spent the last 4 hours getting nowhere.
the code is being used as a document class in an fla (nothing else in the fla yet).
the boiled down code is:
package
{
import flash.display.Sprite;
public class SimpleMenu extends Sprite
{
public var btnData:Array;
public function SimpleMenu():void;
{
btnData:Array=new Array("Home","About us","Projects","Clients","Press","Brochure");
trace (btnData);
}
}
}
the output says:
ReferenceError: Error #1074: Illegal write to read-only property Array on global.
at SimpleMenu$cinit()
at global$init()
I've tried every way round that I can think off including the stupid ones.
I've googled it but the errors reported there seem much more complex.
View Replies !
View Related
Very Simple Read Write Variable Actionscript/php Wanted
Heya, I want to be able to read write varibles to a text file on a server from actionscript. Apparently you can use a php script for processing? or something like that. Can anyone help?
As an example, I want a user to fill in a form and have the variable appended to the end of a list of variables... or something like that.
Thankyou in advance.
View Replies !
View Related
[FMX] Creating A Simple Read & Write Database In Flash?
Hi everyone. I'm new here, nice to meet everyone ^^. I have some big problems(to me T^T) that I really need some advice about.
I'm working on this flash game right now and I need to implement a simple players database...
It needs to be both read and writable . Meaning, when the player register to save his character information , he needs to key in his email and a password and create an account. The account shall store that player's life amount, ammunition etc . All the infos are stored on an external file and retrieved again when the player logins to the game with the email as his login ID. Security issues are not the biggest concern here because its not exactly meant to be an online game and I don't think hacking would be something I need to worry about ^^'''
I've tried Xml with AS, but I realised that, that alone canot allow me to write the player's info into the xml file.
I'm not exactly an mySQL idiot...but I really have very(x2) rusty and limited knowledge of it. All the server topics confuses me and I've had no experience with Microsoft Access. I know neither Php nor ASP =(but they shouldnt be too hard to learn i hope>.<
I hope I've been clear in explaining. Sorry to trouble you folks here but can anyone suggest how I should go about this project? what are the programs necessary? Thanks in advance >.<
*prays someone replys soon*
View Replies !
View Related
[FMX] Creating A Simple Read & Write Database In Flash?
Hi everyone. I'm new here, nice to meet everyone ^^. I have some big problems(to me T^T) that I really need some advice about.
I'm working on this flash game right now and I need to implement a simple players database...
It needs to be both read and writable . Meaning, when the player register to save his character information , he needs to key in his email and a password and create an account. The account shall store that player's life amount, ammunition etc . All the infos are stored on an external file and retrieved again when the player logins to the game with the email as his login ID. Security issues are not the biggest concern here because its not exactly meant to be an online game and I don't think hacking would be something I need to worry about ^^'''
I've tried Xml with AS, but I realised that, that alone canot allow me to write the player's info into the xml file.
I'm not exactly an mySQL idiot...but I really have very(x2) rusty and limited knowledge of it. All the server topics confuses me and I've had no experience with Microsoft Access. I know neither Php nor ASP =(but they shouldnt be too hard to learn i hope>.<
I hope I've been clear in explaining. Sorry to trouble you folks here but can anyone suggest how I should go about this project? what are the programs necessary? Thanks in advance >.<
*prays someone replys soon*
View Replies !
View Related
Flash Can Write To Txt? [FLfile.write]? :confused:
Okay, a while ago I started a project for one computer. I needed a little database to store information. When I started out I was informed that flash cannot write to a txt file and that I would have to use php to do my bidding. Well.... I just found in F8 the FLfile.write command that says otherwise. I haven't tested it, but will. So what is the deal with this? What advantages are there to flash vs. php with writing to a txt file?
Code:
var URI = "file:///c|/temp/mydata.txt";
if (FLfile.write(URI, "xxx")) {
alert("Wrote xxx to " + URI);
}
if (FLfile.write(URI, "aaa", "append")) {
alert("Appended aaa to " + fileURI);
}
View Replies !
View Related
Simple? Array To Array Problem
I am trying to pass the value from one array element to an element in another array. I believe the value is getting there, but it won't display when the 2nd array element is used as the variable in a dynamic text block. Here's the simplistic code I'm trying to learn the concept with:
one = new Array(5);
one[0]=1;
one[1]=2;
one[2]=3;
one[3]=4;
one[4]=5;
two = new Array(5);
two[0]=one[4];
two[1]=one[3];
two[2]=one[2];
two[3]=one[1];
two[4]=one[0];
I then set up individual dynamic text boxes for two[0] through two[4], but no value will show.
View Replies !
View Related
Simple And Simple Array Question
Hi all
Do Flash understand array list items that uses paths?
Example:
Code:
var submenus:Array = new Array( "sub_menu.portfolio" , "sub_menu.contact" , "sub_menu2.about" );
for(var i:Number = 0; i<submenus.length; i++) {
this[submenus[i]].onRollOver = function(){
this.colorTo("0xAAEEFF",0, 0.0);
trace("dfklgödfk")
}
}
View Replies !
View Related
Array (simple I Think..)
Im new to actionscript so this is probally pretty simple...
I have a menu bar with four buttons each button has the following
script:
on (release) {
submenuArray = ["Welcome", "Industry Challanges", "Overview"];
gotoAndPlay ("SubSlide");
}
I change the values of the items in the array but it always reverts to the
values contained in the first array. Why does the new array not load when
the button is "released". Is this the wrong way to handle this?
Thanks
-Sean
View Replies !
View Related
[F8] Simple Array Help
I have created one button and placed 3 instances of it on the stage:
I put the instance names in an array and set up a variable (in Blue)using a for loop
Code:
var pButtons:Array = new Array("portBtn_1", "portBtn_2", "portBtn_3");
//trace(pButtons[0]);
var i:Number
for(i=0; i<pButtons.length; i++){
_global.buttons = pButtons[i]
//trace(buttons);
}
I am trying to avoid repetetive actionscripting by using a variable to execute a rollover function for all the instances of my movieclip/button.
the variable returns the correct strings, but i can't get the rollover function to work: (I included the .FLA)
Code:
buttons.onRollOver = Over;
buttons.onRollOut = Out;
function Over() {
this.gotoAndStop(2);
};
function Out() {
this.gotoAndStop(1);
};
View Replies !
View Related
A Simple Array
morning...
ive wrote this simple code which i would like to duplicate for x number of movie clips... the only change is the box number which will count from 1 upwards...
im guessing that an array would work to simplify this but i have no idea how to write an array..
can anyone point me in the right direction?
////////
/////// BOX20
this.boxes.box20.onRollOver = function() {
boxes.box20.swapDepths(100000);
boxes.box20.gotoAndPlay("zoom");
_global.box20Status = "roll";
boxes.bar_mc.swapDepths(10000)
};
// BOX ROLLOUT
this.boxes.box20.onRollOut = this.boxes.box20.onDragOut=function () {
if (_global.box20Status != "clicked") {
boxes.box20.gotoAndPlay("shrink");
_global.box20Status = "rollout";
}
if (_global.box20Status == "clicked") {
boxes.box20.gotoAndPlay("click_shrink");
_global.box20Status = "srinked";
}
};
//BOX CLICK
this.boxes.box20.onRelease = function() {
if (_global.box20Status == "roll") {
boxes.box20.swapDepths(100000);
boxes.box20.gotoAndPlay("click");
_global.box20Status = "clicked";
} else if (_global.box20Status == "clicked") {
boxes.box20.gotoAndPlay("click_shrink_roll");
_global.box20Status = "roll";
}
};
View Replies !
View Related
Help With An Simple Array
Hi all, I worked out a few things to do with my xml loading on this thread here: http://www.actionscript.org/forums/s....php3?t=149349
Now I want to load different nodes of the xml into different instances of the movieClip I'm attaching, how would I go about this? as I'm not very familiar with arrays
BTW the Mc "table" has 'node1, node2, node3' inside it.
Cheers
Code:
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = function() {
nodes = this.firstChild.childNodes;
numOfNodes = nodes.length;
for (i=0; i<numOfNodes; i++) {
_global.node1 = nodes[i].firstChild.firstChild;
_global.node2 = nodes[i].firstChild.nextSibling.firstChild;
_global.node3 = nodes[i].firstChild.nextSibling.nextSibling.firstChild;
}
attachResults = function () {
attach = attachMovie("table", "table", r);
attach._x = 0;
attach._y = table._height*r;
};
for (r=0; r<numOfNodes; r++) {
attachResults();
}
};
date = '04-10-07';
xml.load('results'+date+'.xml');
dateTitle.text = date
View Replies !
View Related
XML Simple Array
Because I am working on this and others are probably curious too... I found a well explained example that should help you get your XML data put together perfectly... if you are unfortunate enough to be working with XML.
http://proto.layer51.com/d.aspx?f=611
View Replies !
View Related
Really Simple Array Q
I can't get my head around arrays...
Ok so basic I know it can be displayed as blah = ["blah","blah blah","blah blah blah"]
then you can retrive with trace(blah[x]); or in a text box.
I can't be bothered with the var blah:Array = []ect.. I want to stay simple.
I want to load a random vaule from an array but I want to keep the code simple so I can come back to it and instantly understand and make changes.
I know this is really stupid I probably didn't explain very well but oh well its late. Good nigh, from me I will check this in the morn.
Thanks in advance.
View Replies !
View Related
Array? Simple Question
Hi,
It's late and my mind and reference books are failing me. All I want to do is have one button randomly address ten different MC's. Do I put their names in an array, define a variable as the array name[random number between one and ten], then make the button tell _root.(variablename).gotoAndPlay("start")???
I'm following the directives to the letter-no code errors, but I cannot address the different MC's like this, randomly or otherwise. Am I barking up the wrong tree? This seems like a simple thing to do; is an array the wrong approach?
Surely I can randomly target several MC's with one button???
Thank You,
Bryan T
View Replies !
View Related
Simple Array Problem
Hi
I want to to delete a sepcified item out of my array:
Here is the code:
Code:
for (/checkbox1/:i =0; /checkbox1/:i<= /:Songlist.length; /checkbox1/:i++) {
if (eval(/:Songlist[/checkbox1/:i] ) =/:id1) {
/:Songlist.splice(/checkbox1/:i,1);
}
}
Now if the array songlist has the elements 1,2,3,4,5
Then if i run this script with /:id1 = 3
This is what happens
Songlist array becomes: 2,4
i want it to be: 1,2,4,5 (with the 3 being removed)
what have i done wrong?
Thanks
Ash
View Replies !
View Related
Simple Question - Array
Hi all,
I have a question in using and creating 2 or more dimentional Arrays.
For Example:
map = new Array();
map = [[1,2,1],[1,0,0],[1,0,0]];
If I am correct, this is a 3 x 3 dimentional array. But how do I use it?
For Example: I would like to get the 2 out of the array:
text = map[0,1];
But it doesnt work! it gives me the whole 0 element: [1,2,1], why does it do that?
Please help me
View Replies !
View Related
Simple Array Question(i Think)
so i got an array and i want to get the value of the variables and sort them out for example
car=1
toster=3
tub=3
boat=1
bike=1
so every thing that is equal to 3 should go in to the house array and every thing that is equal to 1 should go in to the transportation array
View Replies !
View Related
Simple Array() Question
Code:
createLabels(["username", "firstname", "lastname"]);
function createLabels(labels){
for(i = 0; i < labels.length; i++){
trace(labels);
}
}
Why does the trace return:
username,firstname,lastname
username,firstname,lastname
username,firstname,lastname
I want it to return:
username
firstname
lastname
Can someone tell me how to fix the code to do that?
View Replies !
View Related
Simple Array Question
Okay i am not too fond of flash's array concepts, I use 1D arrays all the time, but when I try to make a 2 or more Dimensional array i get lost... i need to make something like this... An item say a sword and then i need to store all the swords stats inside of an array, then the second main element of the array would be say sheild then all the stats of that sheild.. understand?
I thought it would be something like this..
Code:
items = new Array();
code = [["Sword"[100, 23]], [["Sheild"[34, 65]]];
then all of the other items, now the problem arose when i wanted to acess just the first sat of sword:
Code:
trace(items[0, 1);
but that game me the entire first element
OUTPUT:
Sword, 100, 23
I just need the 100 in this instance, I am hoping you understand what I mean by this, I am guessing i am just way off on the array set up(as I Have no clue how to, that was just an educated guess) so please, i need your help flashers
~Zakarus2001
View Replies !
View Related
Array Problems So Simple I Am Sure
Hi everyone,
I am having such a problem with a stupidly simple thing. I am trying to copy from one array into another array. I have really simplified the script below but it still doesn't work! Any help would be much appreciated! Why doesn't it work!! Maybe becasue it is the weekend and I am tired but I can't figure it out!
Code:
stop();
categoryVar = new Array("doubles", "tennis_playing");
categoryArray = new Array();
for (j=0; j<2; j++) {
var temp2 = categoryVar[j];
trace(temp2);
_root.categoryArray[j] == temp2;
trace("loaded "+_root.categoryArray[j]+" into array");
}
trace("Category array: "+_root.categoryArray[0]+"|"+_root.categoryArray[1]);
this is in frame one! layer 1, nothing could be simpler!
WHere am I going wrong?
Thanks
A
View Replies !
View Related
Simple Array I Hope(MX)
Hi I suck at this so I really could use some help.
I have a php script that loops all the content of a databas.
While doing so it generates a name and a message.
I want to fetch that into flash but all that comes up in my dynamic box is the last post of my databas. I want them all in the same dynamic box called box.
My actionscript goes:
status="FETCHING COMMENTS";
loadVariables("comments.php", _root.container, "POST");
if (status eq "FETCHING COMMENTS") {
gotoAndPlay (8);
} else {
gotoAndPlay (9);
}
So I should have some sort of array i guess in the if statement.
But I have no clue on how to make an array in flashMX.
View Replies !
View Related
Simple Array Problem- Please Help
hi,
im trying to make a card game (choi dai di) using flash. so far im even getting stuck on the basics like shuffling the cards into 4 hands. i have got this far, but although i can trace the contents of each hand, it wont let me do anything with it (ie then convert it into displaying the appropriate cards). its pretty inefficient at the mo but i just want to get it working at the moment. below is some code!
_global.cardArray = new Array();
//sets up deck of cards. each item in array has 2 numbers- 1st is rank 2nd is suit
for (i = 1; i < 14; i ++)
{
for (j = 1; j < 5; j ++)
{
_global.cardArray.push(new Array(i, j));
}
}
Array.prototype.copy=Array.prototype.slice;
tempArray =_global.cardArray.copy();
tempArray2 = new Array();
tempArray3 = new Array();
tempArray4 = new Array();
//randomly picks cards from array of all cards, assigns it to new
//array and then removes it from original array
for (i = 0; i < 52; i ++)
{
randomise = Math.round(Math.random()*(tempArray.length-1));
tempArray2.push(tempArray[randomise]);
tempArray3 = tempArray.slice(0,randomise);
tempArray4 = tempArray.slice(randomise+1, tempArray.length);
tempArray = tempArray3.concat(tempArray4);
}
//then splits final array into 4 different hand arrays
hand1 = new Array(tempArray2.slice(0,13));
hand2 = new Array(tempArray2.slice(13,26));
hand3 = new Array(tempArray2.slice(26,39));
hand4 = new Array(tempArray2.slice(39,52));
trace (hand1);
trace (hand2);
trace (hand3);
trace (hand4);
//traces fine upto here, but if i say
// trace(hand1[0][1]);
//ie explicitly reference it then it does nothing.
What am I doing wrong- any help would be much appreciated!!
Thanks
View Replies !
View Related
Simple Array Question
How do I tranform
header_array = ["id", "text"];
id_array = ['1', '2', '3', '4'];
text_array = ['asdasd', 'asdasdas', 'asdasd', 'asdasd'];
into
item[0] = {id : '1', text : 'asdasd'};
item[1] = {id : '2', text : 'asdasd'};
item[2] = {id : '3', text : 'asdasd'};
item[3] = {id : '4', text : 'asdasd'};
Im sure its quite simple
thankz all
View Replies !
View Related
Simple Array Question
Hello,
I'm not sure if using an array is correct in this instance, but i'd like to change the color of several movie clips at once by a using a function. Each clip has a unique name. Currently, I'm using the following code, and i know it's not accurate, or complete.
function setColor() {
states = ["fl","ga"];
myColor = new Color(states);
myColor.setRGB(0xD8D0C7);
}
setColor();
Any help in advance is greatly appreciated, as i can't seem to find any help elsewhere
View Replies !
View Related
|