-
problems with grid
Aii there...
Okay I just make a grid based on array... my problem is how to highlight boxes that contain only character I mean if the box contain character it will gotoAndPlay(2)...eg:
*****
**C**
*CAR*
**T**
*****
here's the code currently Im using...
Code:
var xPos:Number = 10;
var yPos:Number = 10;
var columns:Array = new Array(["*","*","*","*","*"],["*","*","c","*","*"],["*","c","a","r","*"],["*","*","t","*","*"],["*","*","*","*","*"]);
for (var i:Number = 0; i < columns.length; i++) {
for (var j:Number = 0; j < columns[i].length; j++) {
//if (columns[i][j]) {
var s:MovieClip = this.attachMovie("square", "square" + this.getNextHighestDepth(), this.getNextHighestDepth());
s._x = xPos;
s._y = yPos;
s.lbltxt.text = columns[i][j];
//}
xPos += 20;
}
yPos += 20;
xPos = 10;
}
Hope someone will give me shed some light....thanks
-
Flashmatics
PHP Code:
var xPos:Number = 10; var yPos:Number = 10; var columns:Array = new Array(["f","*","*","*","*"],["*","*","c","*","*"],["*","c","a","r","*"],["*","*","t","*","*"],["*","*","*","*","*"]); for (var i:Number = 0; i < columns.length; i++) { for (var j:Number = 0; j < columns[i].length; j++) { var s:MovieClip = this.attachMovie("square", "square" + this.getNextHighestDepth(), this.getNextHighestDepth()); s._x = xPos; s._y = yPos; s.lbltxt.text = columns[i][j]; if(columns[i][j] != "*") { s.gotoAndStop(2); } xPos += 20; } yPos += 20; xPos = 10; }
-
Originally Posted by silentweed
PHP Code:
var xPos:Number = 10;
var yPos:Number = 10;
var columns:Array = new Array(["f","*","*","*","*"],["*","*","c","*","*"],["*","c","a","r","*"],["*","*","t","*","*"],["*","*","*","*","*"]);
for (var i:Number = 0; i < columns.length; i++) {
for (var j:Number = 0; j < columns[i].length; j++) {
var s:MovieClip = this.attachMovie("square", "square" + this.getNextHighestDepth(), this.getNextHighestDepth());
s._x = xPos;
s._y = yPos;
s.lbltxt.text = columns[i][j];
if(columns[i][j] != "*")
{
s.gotoAndStop(2);
}
xPos += 20;
}
yPos += 20;
xPos = 10;
}
Thanks for the code silentweed....
and ur concern....sorry for the lateness reply....
Tq
-
Hi Silentweed
1stly I ve been decide not to using static value array as I post previously on board regarding the crossword..so I just load from xml file.....and it workings now...and as for new with AS3 i manage to make a simple mockup crossword as Im still try and error with as3....ok here what I have now...
http://www.franzacollections.net/fifin04/cw_as3.swf
source
http://www.franzacollections.net/fifin04/cw_as3.fla
What I after is if someone has click the item in the list it will highlight the box that contain the words from the clue...eg; If I click item "just sport car" so the answer will be
ferrari..then it will highlight the all box that contain ferrari words...is it something can be doone or maybe My whole code are wrongly structured at the 1st places..hope I will get any lead from u...or maybe something point me to the rite path..any help are really appreciated...u can take look my code in my fla attach...
Tq for ur times mate...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|