Grid Thing
http://www.fmx6.com/teststuff/resizer1.swf
made as a request from Pixeldude
KirupaForum > Talk > Source/Experiments
Posted on: 04-21-2005, 06:00 PM
View Complete Forum Thread with Replies
Sponsored Links:
This Square Grid Thing
I just wanna know how they do the square thing that if u put ur mouse over it then the square will have an outline or blink.
Here's an example
http://www.frostdesign.co.uk
http://grotesk.co.uk/flashhome.htm
Is this done by ActionScript?
Thanks 4 ur help
View Replies !
View Related
This Square Grid Thing
I just wanna know how they do the square thing that if u put ur mouse over it then the square will have an outline or blink.
Here's an example
http://www.frostdesign.co.uk
http://grotesk.co.uk/flashhome.htm
Is this done by ActionScript?
Thanks 4 ur help
View Replies !
View Related
This Square Grid Thing
I just wanna know how they do the square thing that if u put ur mouse over it then the square will have an outline or blink.
Here's an example
http://www.frostdesign.co.uk
http://grotesk.co.uk/flashhome.htm
Is this done by ActionScript?
Thanks 4 ur help
View Replies !
View Related
This Square Grid Thing
I just wanna know how they do the square thing that if u put ur mouse over it then the square will have an outline or blink.
Here's an example
http://www.frostdesign.co.uk
http://grotesk.co.uk/flashhome.htm
Is this done by ActionScript?
Thanks 4 ur help
View Replies !
View Related
Good Way To Dragdrop Mc To A Sticky Grid With Grid Cells That Animate.
Is there a way to get mc._dropTarget to recognize a hidden MC it drops on?
I have am trying to drag drop a movie clip item onto a 9 by 6 grid. The user should not see the grid. Each grid cell has a number of properties, including an animation that plays in it depending on what is dropped in it. What is the best way to do this. I came up with two ways:
A. Do the math:
1. Figure out what the drop point x and y values would convert to in the grid to find the grid cell it applies to.
2. Attach a new movie clip animation to that cell's centered x,y point to show something happened there.
B. Fill the grid with Movie Clips:
Use the mc._droptarget to see what grid cell movie clip was dropped on and then change its animated state to show something happened there.
The problem with A is that it is a little slow and cumbersome.
The problem with B is that I can't let the user see the cell movieclips. mc._droptarget only works to detect if a mc was dropped on visible graphic area of another mc as far as I can tell.
I could sure use some help on this. Is there a better way?
- Wade
View Replies !
View Related
Grid Thumbnail With Dynamic Grid Lists
After 3 days of browsing and searching any sollution for my problem I decided to ask you directly here. I really like the thumbnail gallery for its simplicity and beauty. But I would like to ad or vertical scroller (I'm unable to find it here too, maybe I'm blind, just I'm more at the end of my seeking options) or a make a grid thumbnails, that will show 2 columns of thumbs and 5 pictures in each columns, then under the 2 columns i would like to ad a sort of arrow or button that if my gallery have more then 10 pictures it will go on the next thumbnail list. I'm not looking for any extra fading effects or special movements. Just would love to have a single thumbnail grid on side, with option to have lists of thumbnails by 10 if there is more then 10 pictures or so. If somebody can please redirect me or help me I would be very happy, also other ppl here that are seeking for the similar. thank you
View Replies !
View Related
Making A Thing Any Of Which Will Interact With Any Of Another Type Of Thing
Well i know that title was a bit vague but heres what im trying to do, ive been larning to use flash for the past couple weeks, I'm using flash MX, i am expeirienced in other programming languages. What id like to do is to make an object, in this case a turet, which has code in it and can be duplicated, i know how to do that part, but, i want to be able to make it and copy it, and also have an enemy i can copy, a zobie, and have any of the turrets shoot at any of the zombies that get close. They cant all be pre scripted with eachothers names because i want to be able to create either after the program starts.
Basically, the zombies come out all over during the program and the player clicks where he wants to put turrets and those turrets shoot at whichever zombie is closest to them. Im sure its not that hard, and probably would involve arrays, but since im still learning how flash works im not sure how it can be done. Any help is apriciated, thanks. While i wait for a reply I'm going to read some more on how arays work in flash since i think they may be the answer.
View Replies !
View Related
Help With Accessing Grid Spaces In A Grid
Hi Guys
I need a bit of help with my coding. I'm building a small editor that allows users to place electrical components onto a grid so that they can see how electricity works. I have built a grid using an array and for loops and attach movieclips dynamically to that grid. What I want the moviclips to do is to look in the four spaces either side of itself i.e. up, down, left and right. I have managed to pull the grid coordinates out of the grid which enables me to tell the clip which grid space to look at but have been unable to successfully get the code to work.
Here is my code:
myGrid = [[1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1]];
var board:Object=new Object();
board.tileWidth = 30;
board.tileHeight = 30;
board.depth = 1;
board.path = this.grid;
function buildGrid(map){
var mapWidth = map[0].length;
var mapHeight = map.length;
for (var j:Number = 0; j<mapHeight; ++j){
for (var i:Number = 0; i<mapWidth; ++i){
var Tilename:String = "cell"+j+"_"+i;
var x:Number = i*board.tileWidth;
var y:Number = j*board.tileHeight;
var type:Number = map[j][i];
board.path.attachMovie("tile", Tilename, ++board.depth);
switch(type){
case 0:
board.path[Tilename].dropable = true;
break;
case 1:
board.path[Tilename].dropable = false;
break;
}
board.path[Tilename]._x = x;
board.path[Tilename]._y = y;
board.path[Tilename].gotoAndStop((type+1));
//trace(board.path);
//trace (i);
var depth:Number = 2001;
power.onPress = function(){
this.startDrag();
}
power.onRelease = function(){
this.stopDrag();
trace("drop - "+this._droptarget);
var drop_target = eval(this._droptarget);
if (drop_target != null){
if (drop_target.dropable ==true){
//drop_target.gotoAndStop("topsource");
trace("drop on tiles");
trace("we are dropped!");
this._x = 250;
this._y = 60;
_root.board.path.attachMovie("powersource2_mc", "powersource", depth);
_root.board.path.powersource._x = drop_target._x;
_root.board.path.powersource._y = drop_target._y;
_root.board.path.powersource.onPress = function(){
_root.board.path.powersource.startDrag();
_root.board.path.powersource.swapDepths (2001);
}
_root.board.path.powersource.onRelease = function(){
//this code gets the grid/cell/i_j reference and converts it to numbers that
//gives the x and y position within the array
var gridPos = this._droptarget;
var xcellRef = gridPos.substring (12);
var ycellRef = gridPos.substring (10, 11);
//these variables turn the string values into numbers
var Gridx:Number = xcellRef - 0;
var Gridy:Number = ycellRef - 0;
trace ("current x position is::" +Gridx);
//trace ("curent y position is ::" +Gridy);
//var gridCheck:Number = Gridx+1;//check to the right
//trace ("the square on my right is::" +gridCheck);
if (Gridx+1 == _root.board.path.brightlamp){
trace ("something is there!");
}else{
trace ("nope nothing here!");
}
snapto=30;
_root.board.path.powersource._rotation += 90;
Newx = Math.round(_root.board.path.powersource._x/snapto)*snapto;
Newy = Math.round(_root.board.path.powersource._y/snapto)*snapto;
_root.board.path.powersource._x = Newx;
_root.board.path.powersource._y = Newy;
stopDrag();
}
}else{
this._x = 250;
this._y=60;
}
}
}
}
}
}
buildGrid(myGrid);
sorry about the long post but any help will be greatly appreciated!
Tegalad
View Replies !
View Related
Grid Equations | Convert Array To Grid, And X/y To Array Pos
Grids? inside Grids? What?!
So recently I have been getting into grids for interactivity solutions surrounding drag/drop of movieClips. Without doing any internet searching (good/bad?) I sat down with a pad and pen and tried to calculate an equation to help control the code for a couple reasons.
First; I had been using something to increment the rows and columns which let the columns determine when a new row would start. This is messy and just bloats the code.
Code:
(not actual code)
for ( var i = 0; i < len; i++ )
{
if( column > totalcolumns )
{
column = 0;
row++;
}
else
{
column++;
}
xPos = column * columnSpace;
}
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
[converts array of items to grid positions]
1 . 2 . 3 . 4 . 5
6 . 7 . 8 . 9 . 10
11. 12. 13. 14. 15
Second; I wanted to determine where a drop occurred in a grid without doing hitTests on more than one item and trying to rationalize < > positions. So I ended up writing out a bunch of numbers, looking at the remainders and eventually leveraging % . (which I later found out is what everyone else probably uses ? the easy way). But how can I make the grid react to my [ _xmouse , _ymouse ] position when dragging an item?
Code:
(actual code)
var newY = Math.floor( i / cols ) * ySpace;
var newX = ( i % cols ) * xSpace;
[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
[converts array of items to grid positions ( with less code ) ]
1 . 2 . 3 . 4 . 5
6 . 7 . 8 . 9 . 10
11. 12. 13. 14. 15
To solve the second problem I worked backwards and was able to write a way based on [x,y] that finds a position in a grid array and splices my drag item right inside to temporarily resort on the fly. So onMouseMove it looks like all the items adjust to the item I am dragging when over it's future position in the current grid.
To get the position, it looked something like;
Code:
function getGridPos ( newX, newY, array, cols, startX, startY, xSpace, ySpace)
{
var len = array.length;
// max bounds
var xMaxPosition = cols * xSpace + startX;
var yMaxPosition = Math.floor( len / cols ) * ySpace + startY;
// percentage of width/height
var xpos = ( ( xMaxPosition - startX ) / xSpace );
var ypos = ( ( yMaxPosition - startY ) / ySpace );
// convert to position in array
var xposProduct = Math.floor( ypos ) * cols
var yposProduct = Math.floor( xpos );
// position in array
var newPos = xposProduct + yposProduct;
return newPos;
}
// get array position from x,y
var arrayPosition = getGridPos ( _xmouse, _ymouse , tempArray, cols, startX, startY, xSpace, ySpace );
// put inside temp array
tempArray.splice( arrayPosition , 0 , my_mc );
// sort new items
arrayGridSort( tempArray, cols, startX, startY, xSpace, ySpace );
[p = mouse position ]
1 . 2 . 3 . 4 . 5
6 . 7 p8 . 9 . 10
11. 12. 13. 14. 15
[converts x/y position (p) to an array position]
[1,2,3,4,5,6,7, p, 8,9,10,11,12,13,14,15]
[resulting grid resort ]
1 . 2 . 3 . 4 . 5
6 . 7 . p . 8 . 9
10. 11. 12. 13. 14
15
So this works great. I?m able to know exactly where a point converts to an array position which helped me build a class for all future projects, GREAT 2.0! Now I can have a grid resorting when I just drag over and and the array position is known before I drop the item I'm holding - with drastically less code than I had been using previously!
HERE IS THE PROBLEM / CHALLENGE
So for complication sake (and this is more of a challenge than a problem ) what if I want to do the same thing but make groupings? Like, for every 2 columns - items space out 50 extra pixels and likewise for the y values? I understand how to make that function one way, but I have no idea on how to convert that back into an array position as I have been using in the previous example.
Code:
[ colGroups of 2 , colSpacing of 100 ]
1 . 2 . . . . . . 3 . 4 . . . . . . . 5 .6
7 . 8 . . . . . . 9 .10 . . . . . . .11.12
. . . . . . . . . . . . . . . . . . . . . .
13.14 . . . . . 15.16 . . . . .. . p17.18
19.20 . . . . . 21.22 . . . . . . 23.34
Now it?s easy to make that go one way;
Code:
// original xGrid equation
var newX = (i % cols) * xSpace;
// additional xGrid Groupings equation
var xGroups = 2;
var xGroupSpace = 100;
newX += Math.floor( (i % cols) / xGroups ) * xGroupSpace;
And While that is all said and dandy? What the heck is the reverse of that function to put it back into array form? The problem is just that my current reverse equation really only works on the percentage of the width/height - and that does not take segments into consideration. (solution: bezier hybrid maybe?)
So anybody a math whiz out there? Can I get a little Penner help? I don't need this done ASAP but it would be cool to not have to look back on this problem again.
Thanks!!
View Replies !
View Related
Grid?
Is there any way to disable the grid so that you can move objects around on the stage freely? I don't view the grid when I am creating things, but I am tired of not being able to line certain things up because an object seems like it has to line up with the grid. Is there any way around this because this has been frustrating me beyond belief. Thank you in advance for any help you can provide me.
View Replies !
View Related
Help With Grid
I'm creating a project to layout pages of a book onto a poster, so that pages can be easily rearranged using drag and drop. So far I have used ActionScript to draw a grid, where the user can enter the number of pages he/she wishes to use and it best fits to the screen resolution. I'm not that great with Flash MX and so I have a few questions for you all, if it's not too much to ask.
1) How can I use ActionScript to create draggable, changeable text (with a limit on width and height)?
2) How can I make the text snap-to my grid boxes?
Thanks for your time.
View Replies !
View Related
Xml In Grid.
Could someone help me with binding xml to a grid like this one
I am trying to make a gallery which would place a thumnail node, from the xml, in each cell.
View Replies !
View Related
About Grid's
I have quite new in actionscript and my english is too not very good
I try to write paint-by-numbers application in Flash 8.
I have knowledge how to create grid, how to scale movieclips and etc simple stuff!
But i have some questions too:
1. How thin grid I can create with readable numbers in grid cell???
(Now I have 60x60 grid 700x700 pixel Scene size, is this the maximum limit when I can read numbers? Or there is some tricks to get smaller numbers to be readable in grid cells! I need only numbers in cells!)
2. Can I fill grid cells dragging mouse over them? Like selecting box on grid and this box will be filled? Or dragging line, etc ...
3. Is there easier way to make clickable grid, than putting movieclips side-by-side. Probably not!
I have hi-level PHP and Javascript programming knowledge, but not Flash and Actionscript. thats why maybe stupid questions here!
Thanx to everyone who understood what I asked and can answer those newbie questions! Maybe some have sample scripts or links where I can find solutions to my questions....
//Muhv (from Estonia)
View Replies !
View Related
Grid With AS
Hello,
I would like to draw a grid with AS and would appreciate all your help. I have two movieclips:
1: hr_mc horizontal line
2: vr_mc vertical line
I am able to render either hr or vr but cannot seem to get them to render together. I would highly appreciate your help.
Attach Code
function DrawGrid()
{
this._x = 170;
for(i=0; i<=10; i++)
{
_root.attachMovie("VL_mc", "VL_mc" + i, i,{_x: i*20, _y:200});
_root.attachMovie("HL_mc", "HL_mc" + i, i,{_y: i*20, _x:200});
}
}
DrawGrid();
View Replies !
View Related
Grid
I am trying to make a Grid that is equal to the width and the height of the flash movie. I have a movieclip called box which is 30x30, and want it to repead along the x to form columns and along the y to form rows so that it makes a big rectangle of smaller squares. For some reason it looks like this:
+
+
+
++++++++++++++
Instead of:
++++++++++++++
++++++++++++++
++++++++++++++
++++++++++++++
Here is my code:
ActionScript Code:
onLoad = function () { boxWidth = box._width; stageWidth = Stage.width; rows = stageWidth/boxWidth; trace("Number of Rows:"); trace(rows); // boxHeight = box._height; stageHeight = Stage.height; columns = stageHeight/boxHeight; trace("Number of Columns:"); trace(columns); // boxX = 0; boxY = 0; // for (i=1; i<=columns; i++) { for (j=1; j<=rows; j++) { // Create and Orient MovieClips duplicateMovieClip(box, "boxC"+i+"R"+j, i+j); // this["boxC"+i+"R"+j]._x = boxX; // this["boxC"+i+"R"+j]._y = boxY; // trace("Created Box Number"); trace(i+j); // boxX += boxWidth-1; } boxY += boxHeight-1; boxX = 0; }};
Any help would be greatly appreciated
View Replies !
View Related
Grid Fun
Hi,
I am trying to make a map made up of lots of little dots. With the code below I create a grid of dots and then mask it with a vector world map. This actually works but sends my cpu to 100%, is there a better way to do this?
Code:
numItems = 5500;
numColumns = 100;
cnt = 1;
startX = startY=0;
padding = 1;
_root.setMask(_root.map);
for (var i = 0; i<numItems; i++) {
this.attachMovie("dot", "dot"+i, i, {_x:startX, _y:startY});
startX = (cnt%numColumns == 0) ? 0 : startX+this["dot"+i]._width+padding;
startY = (cnt%numColumns == 0) ? startY+this["dot"+i]._height+padding : startY;
cnt++;
}
View Replies !
View Related
Grid
I am trying to make a Grid that is equal to the width and the height of the flash movie. I have a movieclip called box which is 30x30, and want it to repead along the x to form columns and along the y to form rows so that it makes a big rectangle of smaller squares. For some reason it looks like this:
+
+
+
++++++++++++++
Instead of:
++++++++++++++
++++++++++++++
++++++++++++++
++++++++++++++
Here is my code:
ActionScript Code:
onLoad = function () { boxWidth = box._width; stageWidth = Stage.width; rows = stageWidth/boxWidth; trace("Number of Rows:"); trace(rows); // boxHeight = box._height; stageHeight = Stage.height; columns = stageHeight/boxHeight; trace("Number of Columns:"); trace(columns); // boxX = 0; boxY = 0; // for (i=1; i<=columns; i++) { for (j=1; j<=rows; j++) { // Create and Orient MovieClips duplicateMovieClip(box, "boxC"+i+"R"+j, i+j); // this["boxC"+i+"R"+j]._x = boxX; // this["boxC"+i+"R"+j]._y = boxY; // trace("Created Box Number"); trace(i+j); // boxX += boxWidth-1; } boxY += boxHeight-1; boxX = 0; }};
Any help would be greatly appreciated
View Replies !
View Related
XML Grid
I need some help with flash gallery I purchased from istock. It has rows going vertical. I managed to change it to go horizontal. I want to have both horizontal and vertical (i.e) FWA site. I am attaching a snapshot and the script that I am thinking needs modification. Please help and thanks.
_global.Timer = function ( _listener ) {
this.$counter = 0;
this.$delay = null;
this.$startNum = null;
this.$stopNum = null;
this.$step = null;
this.$int = null;
this._listeners = new Array ();
this.addListener ( this );
this.addListener ( _listener );
};
var XN = _global.Timer.prototype;
AsBroadcaster.initialize ( XN );
XN.start = function ( _delay, _step, _startNum, _stopNum, _loop ) {
this.$delay = ( _delay ? _delay : this.$delay );
this.$step = ( _step ? _step : this.$step );
this.$startNum = ( _startNum ? _startNum : 0 );
this.$stopNum = ( _stopNum !== undefined ? _stopNum : this.$stopNum );
this.$counter = this.$startNum;
this.$loop = _loop;
this.stop ();
this.$count ();
};
XN.stop = function () {
this.$stopCount ();
};
XN.resume = function () {
this.$count ();
};
XN.$count = function () {
this.$int = setInterval ( this, "$update", this.$delay );
};
XN.reset = function () {
this.$counter = this.$startNum;
this.$resetTime ();
};
XN.$resetTime = function () {
this.stop ();
this.resume ();
};
XN.$stopCount = function () {
clearInterval ( this.$int );
};
XN.$update = function () {
if ( this.$counter <= this.$stopNum ) {
this.broadcastMessage ( "onTimerCount", this.$counter );
this.$counter += this.$step;
};
if ( this.$counter >= this.$stopNum ) {
if ( !this.$loop ) {
this.stop ();
this.broadcastMessage ( "onTimerFinished", this.$counter );
} else {
this.reset ();
this.broadcastMessage ( "onTimerLoop", this.$counter );
};
} else {
};
};
delete XN;
MovieClip.prototype.alpha = function(accelerate, boundary) {
var accelerate = accelerate;
var boundary = boundary;
this.onEnterFrame = function() {
if (this._alpha>boundary) {
this._alpha -= accelerate;
if (this._alpha<=boundary) {
delete (this.onEnterFrame);
}
}
};
};
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
header = [];
titles = [];
descr = [];
images = [];
links = [];
total = xmlNode.childNodes.length;
for (z=0; z<total; z++) {
header[z] = xmlNode.childNodes[z].childNodes[0].firstChild.nodeValue;
titles[z] = xmlNode.childNodes[z].childNodes[0].firstChild.nodeValue;
descr[z] = xmlNode.childNodes[z].childNodes[1].firstChild.nodeValue;
images[z] = xmlNode.childNodes[z].childNodes[2].firstChild.nodeValue;
links[z] = xmlNode.childNodes[z].childNodes[3].firstChild.nodeValue;
//links[z] = xmlNode.childNodes[z].childNodes[4].firstChild.nodeValue;
}
DuplicateMc();
} else {
_parent._parent.mc_error.gotoAndStop(2);
_parent._parent.error.text = "Sorry, xml file not loaded";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("xml/last_added.xml");
sety_ar = new Array ();
index = 0;
iloscWyswietlana = 5;
var t = _global.t = new Timer ();
t.addListener ( this );
delete t;
function DuplicateMc() {
ile = z - 1;
szerokosc = 265;
wysokosc = 250; // This controls the spacing between each content
liczba = 1;
for (p=0; p<ile; p++) {
s = attachMovie ("zestaw", "zestaw"+p, p);
y = Math.floor (p/liczba);
pozycja = y%iloscWyswietlana;
s._y = (5); // Controlls listing order for content - list horizontal
s._x = (wysokosc+5)*pozycja+2;
s.title_txt.text = titles[p+1];
s.desc_txt.text = descr[p+1];
s.img_container.loadMovie(images[p+1]);
s.mc_button_link.link = links[p+1];
s.num = p;
s.mc_button_link.onRelease = function() {
var l = this.link.split("#");
if (l.length>1) {
this.getURL(l[0], l[1]);
}
}
if (links[p+1].length<8) {
s.mc_button_link._visible = false;
}
s.mc_button_link.onRollOver = function() {
this._parent.desc_txt.textColor = 0xC40000;
this._parent.borders.gotoAndPlay(2);
}
s.mc_button_link.onRollOut = function() {
this._parent.desc_txt.textColor = 0x737373
this._parent.borders.gotoAndPlay(11);
}
sety_ar.push ( s );
s.mc_button_link._visible = false;
};
_parent._parent.resizer_1.resizer_2.prev_btn._alpha = 30;
_parent._parent.resizer_1.resizer_2.prev_btn.enabled = false;
_parent._parent.resizer_1.resizer_2.prev_btn.useHandCursor = false;aktualizujWyswietlanie ();
}
function aktualizujWyswietlanie () {
ukryjWszystkie ();
wyswietlOdpowiednie ();
};
function ukryjWszystkie () {
for (var i=0; i<sety_ar.length; i++) {
var s = sety_ar [i];
s._visible = false;
s.fade._alpha = 100;
};
}
function wyswietlOdpowiednie () {
for ( var i=0; i<iloscWyswietlana; i++ ) {
var s = sety_ar [ index+i ];
current_pos = (index/iloscWyswietlana)+1 ;
total_pos = Math.ceil (z/iloscWyswietlana);
_parent._parent.dragline.pos_txt.text = current_pos+"/"+total_pos;
_parent._parent.dragline.header_txt.text = header[0];
s._visible = true;
s.fade._alpha = 100;
};
_global.t.start ( 100, 1, 0, iloscWyswietlana, false );
this.onTimerCount = function ( _count ) {
var s = sety_ar [ index + _count ];
s.fade.alpha(5, 0);
if (links[s.num+1].length<8) {
s.mc_button_link._visible = false;
}
else if (links[s.num+1].length>8) {
s.mc_button_link._visible = true;
}
}
}
function forw () {
if ( index < z - iloscWyswietlana ) {
index += iloscWyswietlana;
aktualizujWyswietlanie ();
_parent._parent.resizer_1.resizer_2.prev_btn._alpha = 100;
_parent._parent.resizer_1.resizer_2.prev_btn.enabled = true;
_parent._parent.resizer_1.resizer_2.prev_btn.useHandCursor = true;
};
if ( current_pos == total_pos ) {
_parent._parent.resizer_1.resizer_2.next_btn.enabled = false;
_parent._parent.resizer_1.resizer_2.next_btn.useHandCursor = false;
_parent._parent.resizer_1.resizer_2.next_btn._alpha = 30;
};
}
function prev () {
if ( index > 0 ) {
index -= iloscWyswietlana;
aktualizujWyswietlanie ();
_parent._parent.resizer_1.resizer_2.next_btn._alpha = 100;
_parent._parent.resizer_1.resizer_2.next_btn.enabled = true;
_parent._parent.resizer_1.resizer_2.next_btn.useHandCursor = true;
};
if ( current_pos == 1 ) {
_parent._parent.resizer_1.resizer_2.prev_btn._alpha = 30;
_parent._parent.resizer_1.resizer_2.prev_btn.enabled = false;
_parent._parent.resizer_1.resizer_2.prev_btn.useHandCursor = false;
};
}
View Replies !
View Related
Help With Grid...
Im trying to make a grid for thumbnails. 5 thumbs across then start a new row.
example....
•••••
•••••
•••••
•••
So here is the code im using. Ive really need help on this, because every time i think i figured it out. Im wrong.
Code:
function thumbnails_fn(k) {
thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {
target_mc._x = thumb_mc._x+(target_mc._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {
p = this.pictureValue-1;
nextImage();
};
target_mc.onRollOver = function() {
this._alpha = 50;
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);
}
View Replies !
View Related
Xml Into Grid
Hi.
I have thits function to load my images into flash from an .xml document. What i want is to place the images in a grid with 2 columns in the X direction instead of one as it is now. I cant really figure out how to do.. A techish loop or something?
Code:
function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();
for(var i:int = 0; i < xmlList.length(); i++)
{
imageLoader = new Loader();
imageLoader.load(new URLRequest(xmlList[i].attribute("thumb")));
imageLoader.x = 249;
imageLoader.y = i * 70 + 78;
imageLoader.name = xmlList[i].attribute("source");
addChild(imageLoader);
imageLoader.addEventListener(MouseEvent.CLICK, showPicture);
}
}
My XML has this structure:
<image>
source and descripton and that stuf
source and descripton and that stuf
source and descripton and that stuf
source and descripton and that stuf
...continuing
</image>
View Replies !
View Related
Grid Movement
[swf width="550" height="400" background="#FFFFFF"]http://www.arcadenetwork.com/worlds/worlds.swf[/swf]
This is a project i'm currently working on. Could anyone tell me how I could make a character move from one cell to another in straight lines taking the shortest route - (not travelling diagnally over squares)?
Thanks
Gary
View Replies !
View Related
Imported .JPG To A Grid ?
Is it possible to do this with ActionScript.. I've a photo that I imported into Flash and made into a movie clip... so far so good
What I would like to do (if possible) is take that single MC and make into (say) 9 smaller MC's.. each containing part of the original photo..
so MC(1) would be the top left bit of the photo,
MC(2) would be the top middle of the photo
MC(3) is the top right of the photo
etc etc
So I could then move each part of the photo (like a jigsaw puzzle)
View Replies !
View Related
Creating A Grid
I have two input boxes named optionx and optiony. A person can enter a number value into these and a grid will draw itself being optionx wide and optiony high.
I have a MC 4 pixels wide that when duplicated optionx times can form one row. I have;
setProperty ("node"+i, _x, i*5);
so that there is a 1 pixel gap between each duplicated square to give the impression of a grid.
What I am having trouble with is getting the squares to move down a line once they have reached the optionx value to draw the rest of the grid ie optiony value. And then stop once the whole grid is drawn.
Any help/hints would be really appreciated.
cheers
View Replies !
View Related
How To Duplicate A Grid Of Mc's..
Hi, I am wondering how you would go about duplicating a grid of movieclips on the stage..
I can generate them in a row next to each other, but after 5 have been created I want to go to the beggining again and duplicate more on the next row.
Eg if the user entered 20 mc's I could generate a 5x 4 grid of mc's.
Does anyone know how this can be done easily in actionscript?
Thanks
View Replies !
View Related
Defining A Grid
Can anyone explain to me how I'm supposed to define a grid? Like, if i wanted to make a chess game.
I looked at some source, and realize I can create rows and coulms using two arrays with For loops, but how do I define the position of each row/column/cell using x-y coordinates so that a piece on the grid can be moved to specific square?
Thanks.
CountBule
View Replies !
View Related
Functioning Grid
I posted this before, but got no answer. Maybe some more info is in order.
I've been unable to find any tutorials or info regarding the use of a grid. I want to define a grid not unlike one in a chess game. I want to be able to move pieces around (and ultimately save their position). However, I have no idea how to define such a grid in Actionscript. The best example I have is a connect four game I d/led as an example. The following code defines the game grid...
// connect4 jim burton mar 2002 j.b@dynamitechicken.com
// initialise the array of places on the board
// Define 2D array object of the form places[row][column]
// with properties
// x: positions x pos
// y: place's y pos
// state: (empty, red, yellow) the status of each
places = new Array(7);
for (var r = 0; r<7; r++) {
// new row
places[r] = new Array(7)
for (var k = 0; k<7; k++) {
// new column
places[r][k] = new Object()
places[r][k].x = 65+(k*50)
places[r][k].y = 85+(r*50)
places[r][k].state = "empty"
}
}
emptySpaces = 49
its pretty apparent how the Array and For loops work to create the the rows and columns. What part confuses me is "places [r][k] = 65+(k*50)" and the other line below it. Exactly what does this do?
If anyone can explain this to me, or show me a better way to establish a grid, I'd be most grateful.
View Replies !
View Related
10 X 10 Duplicate Mc Box Grid?
What I want to do is lay one hundred boxes 10 high, buy 10 wide, using actionscript. How can I position them so that I am only using one box on stage and it duplicates itself and layes itself in the right position all evenly spaced. I have this code that is on the first keyframe and a box 20 pixels buy 20 pixels on the stage named, "box". This lays them ten wide and does a fine job , but how could I get them to line up ten high buy ten wide?
_root.box._visible = 0;
for (i=0; i<10; i++) {
_root.box.duplicateMovieClip("box"+i, i);
_root["box"+i]._x = 100+i*45;
}
View Replies !
View Related
XML Data Grid
I am trying to break apart and understand the BlackAdder Component Set that I got from Macromedia.com that includes the XML Data Grid which I am specifically try ing to break apart. I dont understand this code really. Could anyone please expound on this for me?
[code]
Main = myXMLData.firstChild;
Record = Main.firstChild;
i = 1;
while (Record != null){
ColumnName = Record.firstChild;
this["myRowArray"+i] = new Array();
while (ColumnName !=null){
if (i == 1){
myHeaderArray.push(ColumnName.nodeName);
}
this["myRowArray" + i].push(ColumnName.firstChild.nodeValue);
ColumnName = ColumnName.nextSibling;
}
i = i + 1;
Record = Record.nextSibling;
}
NumRow = i;
View Replies !
View Related
Grid Zoom In/out
Any ideas where I might find a .fla for a grid
effect equal to the one on this link;
http://www.frostdesign.co.uk/
i.e you click a square on the small grid and it then
'grows' to the full size of the screen. Click again then
it zooms back out.
Thanks.
View Replies !
View Related
RPG Player Grid
I'm trying to develop a 'grid', each tile 36x36 pixels, to track characters, as well as to designate whether Collision Detection is present on any given tile. How do I refer to each tile (_root.tile1) in my code, and designate it as a non walkable surface or not? Ultimatly, the movement code will ref. the MC's _x & _y pos. then check it against the grid code to see whether or not he can step in the tile.
any ideas? Thanks guys!
-Tyler
View Replies !
View Related
Problems With A Grid
for about the fifth time, im making a map out of map pieces, like corners, horizontal connectors etc, and im having a problem. not sure what it is, the code seems fine. i assure u the draw() function works so i wont bother putting it up.
code:
lib=new Array()
lib[0]=new Array([0, 0, 0], [1, 1, 1], [0, 0, 0])
lib[1]=new Array([0, 1, 0], [0, 1, 0], [0, 1, 0])
lib[2]=new Array([0, 1, 0], [1, 1, 1], [0, 1, 0])
lib[3]=new Array([0, 1, 0], [1, 1, 1], [0, 0, 0])
lib[4]=new Array([0, 0, 0], [1, 1, 1], [0, 1, 0])
lib[5]=new Array([0, 1, 0], [1, 1, 0], [0, 1, 0])
lib[6]=new Array([0, 1, 0], [0, 1, 1], [0, 1, 0])
function parse(a, s, lib){
function box(a, y, x, j, i, s){
c=createEmptyMovieClip(x*i+'b'+j*y, k)
c._x=x*i*s
c._y=y*j*s
hex=(lib[a[y][x]][j][i]) ? '0xcccccc':'0x000000'
draw(c, s, s, hex)
k++
}
for(y=0; y<a.length; y++){
for(x=0; x<a[y].length; x++){
for(j=0; j<lib[a[y][x]].length; j++){
for(i=0; i<lib[a[y][x]][j].length; i++){
box(a, y, x, j, i, s)
}
}
}
}
}
map=[[1]]
parse(map, 8, lib)
can anyone see a pproblem?
View Replies !
View Related
Grid Scale
Hi I am trying to learn how to reproduce the portfolio section on :
http://kurtnoble.com
I have worked out the grid moving and loading swf into the sections but need help in how to set up the brown box which fades in scales and then fades to white using action script.
Please take a look at the attatched to see how far i have got.
any help would be great
mark Newbie.
View Replies !
View Related
Fine Grid
How can I create a fine grid over some graphics? Should I do this in flash or photoshop? Because I would like some animations to happen below the grid but above the background graphic.
View Replies !
View Related
Data Grid
I have created a site all in flash and the client is now asking for a listing of all their stores to display in one of the sections. I pulled a customer list from their data base and I have about 175 listings all over the over the world. Any ideas on a nice easy way to format dynamic text in flash. I need a table structure but I noticed that table tags are not supported in flash text boxes.
Any ideas or solutions are welcome.
thanx.
View Replies !
View Related
Data Grid Xml
hello,
Ive been trying to import an xml doc into a flash data grid component. When i run it, it looks as though it has filled the grid, but with blanks.
Any ideas???
View Replies !
View Related
Assistance With Grid
Hello
I am wondering how I can create a grid of squares that when I click on them I can switch the color between black and white.
Imagine a chess board, but all squares are white to begin with. Each square when clicked should turn black. If clicked again, they should revert back to white and so on. The matrix of squares I plan to use is quite large so obviously an array should be used to store the on/off state of each square.
Any help on this matter would be great.
View Replies !
View Related
Grid Placement
Hey freinds.
So, what I have is a basic script to make an object snap to a position on a grid depending on where the mouse is:
For refernce sake, 'map', is the grid in which the script is applied to, being a small block, 20 by 20px.
code:
onClipEvent (enterFrame) {
_x = math.round((_root._xmouse-10-_map._x)/20)*20+10;
_y = math.round((_root._ymouse-10-_map._y)/20)*20+10;
if (_root._xmouse>_parent.map._x && _root._xmouse<_parent.map.mapwidth+_parent.map._x && _root._ymouse>_parent.map._y && _root._ymouse<_parent.map.mapheight+_parent.map._y ) {
_visible = true;
} else {
_visible = false;
}
}
However, when I make the map move, (just adding _parent.map._x++ on the script above), the object snaps to a grid that isnt relative to the map. So while the map creeps away, the object stays in the one place.
help appriciated
thanks everyone
View Replies !
View Related
Grid Of Diamonds
hi there,
i know there is probably a logical way to do this, but at the moment this is the only thing i can think of.
im building a dynamic mask made up of grid of diamonds which scale up to fill a space. In order to do this the diamonds must tesellate, which means that they dont arrange themselves like a normal square grid, where one square appears directly under the other and next to each other.
(sorry if im confusing you, im not very good at explaining myself)
at the moment i am using this code to generate my grid of diamonds:
code:
function buildMask(mask) {
var maskWidth = 13;
var maskHeight = 6;
for (var i = 0; i<maskHeight; ++i) {
for (var j = 0; j<maskWidth; ++j) {
duplicateMovieClip("diam", "diam_"+i+"_"+j, i*100+j*2);
setProperty("diam_"+i+"_"+j, _x, i*50);
setProperty("diam_"+i+"_"+j, _y, j*25);
trace (i);
}
}
}
buildMask();
stop();
but the problem i am having is that this grid doesnt tesselate the diamonds to make up one full square, because it is arranging the diamonds as if they were squares. one under the other and one next to each other.
i cant see a way around this. what i thought maybe was to have the script determine between odd and even numbers and shift the line of the grid accoringly, but i dont know if that will work.
if you have any ideas, please help. i dont think anyone will be able to understand what im asking for but if you have any ideas, please let me know.
thank you
Ross
View Replies !
View Related
Creating A Grid
hi.
i'm creating a grid and i can place everything in nice columns but i cannot figure out how to create a new row. here's the code i use:
code:
var numColumns:Number = 7;
var columnWidth:Number = Stage.width/7;
var numRows:Number = 6;
var rowHeight:Number = Stage.height/6;
var firstDay:Number = 1;
for(i=0; i<= lastDay; i++){
var dateClip = _root.createEmptyMovieClip("dateClip"+i,i);
dateClip.createTextField("day"+i,i,0,0,30,30);
dateClip["day"+i].border = true;
dateClip["day"+i].text = i;
dateClip._x = columnWidth * i;
firstDay++;
if(firstDay == 7){
// start a new row
firstDay = 0;
}
}
how do i go about creating a new row in that 'if' statement? i don't want to hardcode any values in there.
thanks. fumeng.
View Replies !
View Related
Another Grid Question...HELP
Hi there!
Since I'm not to strong with AS I hope someone can help me out here again!
I need to populate a grid with duplicates of a clip I'm going to use as a transition effect. The problem is that the grid needs to be filled in such a way that the squares are positioned with a 7 pixel distance between them (in 2 lines and 4 rows). My second (and probably biggest) problem is that they need to be positioned in random order AND with a delay of some sort...
I'm completely blank on these subjects and would really like to some day NOT have to work with annoying art-directors and their great ideas
Please help!!!
View Replies !
View Related
Building A Grid
hi everyone,
i am trying to build a grid, so that it looks like a certain picture (my background picture) is devided to squares, each square pops up one after the other, forming itself from a dot into a full square (as if coming from a distance). of course, im trying to aviod making each square a movieclip on its own, but rather something more simpistic.
could anyone give me a hand ?
thanx,
dor88keys.
View Replies !
View Related
|