Simple Square
Hello,
I am new to AS3 and having a hard time getting a simple square to display dynamically, here is my setup -
main.flv
Code:
var test:HelloWorld = new HelloWorld();
HelloWorld.as
Code:
package { import flash.display.Sprite; import flash.display.Shape;
public class HelloWorld extends Sprite { public function HelloWorld() { var rectAndCircle:Shape = new Shape(); // Set line thickness to one pixel rectAndCircle.graphics.lineStyle(1);
// Draw a blue rectangle rectAndCircle.graphics.beginFill(0x0000FF, 1); rectAndCircle.graphics.drawRect(125, 0, 150, 75);
// Draw a red circle rectAndCircle.graphics.beginFill(0xFF0000, 1); rectAndCircle.graphics.drawCircle(50, 100, 50);
// Move the shape to the right 125 pixels and down 100 pixels rectAndCircle.x = 125; rectAndCircle.y = 100;
addChild(rectAndCircle); trace("Test"); } } }
I know it is calling the method correctly because it is displaying "Test" on the console
TIA Will
DevShed > Flash Help
Posted on: July 28th, 2007, 03:31 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Resizing A Square Simple No?
Hello world!!!!
I want to have a button change the dimensions of a square in my flash document.
It sounds simple enough to me but after a day of searching i am very frustrated, i don't know nearly enough about flash to know where i should start looking to find the answer myself. And all the examples i find in forums are over complicated or have little or no explanations.
Someone point me in the right direction please.
desperate? i think so.
Trouble Getting A Simple Button To Work To Square A No.
Hi,
Very very new to Flash...having trouble doing this quite basic tutorial....
basically i want to take in a no. from an input box - square it - by clicking on a button - so that the result is then displayed in a separate text box.
basically i have created the two text boxes (one for input and the other dynamic) - also i have the button up on the screen, also i have the code in the acion panel - yet i can't seem to get it the whole thing to function properly at all -
also in the turorial i am using - it says the following..................
{ in the properties panel, click the parameters tab - click the click handler - and type the name of the function (HandleSquareButton) you wrote to take care of these button clicks.. }
............yet within parameters there is no..."Click handler" that i can see in either flash 8 or flash MX.
so can anyone help??!!!
regards
gib.
How Do I Cut A Square Out Of A Larger Square Using Actionscript
I want to use actionscript to draw a square in a larger square that appears as a hole or window in the larger square. I know how to use AS to draw a square, but I can not seem to find a way to cut one square out of another. Does anyone know how to do this?
Square Has To Fly Away
Yo
Checkin' things out and trying to get a square to vortex out when clicked. How can I do this??
tnx
The Technicolour Square
hi!
I'd like to know how can I modify the colour of a rectangle by mousing down it (if there's a way to do it).
Any idea will be wellcome.
Thankx!!
Expanding A Square
Hey, I'd like to have the out line of a square (which will act as a mask) expand (technically keep the top of the square in one spot while dragging the bottom part of it towards the bottom of the screen. I'm not sure how I would do this, also, would it be best to make the square a graphic or image?
thanks
Tyler
How Do I Make A 3D Square
I am trying to make a 3D square rotate and dont know where even to start. is there any scripting involved???
Thanks for taking the time to look at my question.
Stef.
Non-square Shape
I made a shape in photoshop and I pasted it on my flash movie, and it made a square outline on it. Where there was suppose to be no color (in the square outline in the spaces where there was no picture)it automatically put white. And it wouldn't let me erase it. I want to put a graphic underneath the the one I'm talking about, but the white part covers it. Can anyone help?
Not A Square Page.....
hi there...
i need some help on this simple question.....i think most of the flash mc will be in a square type.....i want a little different that the first screen will be in a square type but when user click on the button "help" it will come out a small oval or any shape that's not square.....i think it's a simple question and thanks in advance those can answer my question....
lazyapril
Big Blank Square
ok. so i made my site, exported it as a .swf, then put a link to it on my site, and i get a big white square. any advice?
this is the address : sofancy.querinrecords.com
Circle To Square
i'm trying to change a circle to a square, but the shape tweening wouldn't work. any suggections?
Zoom Square
Hello,
i am looking for a certain efect:
it's a square divided in 9 parts. Each part has something in it. When u put your mouse over that small square it becomes bigger and the other 8 smaller but the big square is allways the same size...
Cheers,
Miguel
Thrown Square
Ok, is there anyone out there that would know how to create the effect of a flat square getting essentially thrown on to the screen where it lands flat and then is pulled towards us in a flash.
Perhaps an example of this can be seen here.
http://jaijin.com/andru/ (enter 1,2 for the password to enter)
Any help
Square In Parts
When I draw a square the out line and fill are all parts. There must be a switch that I'm missing when I want the square to be a solid unit, lines and fill as one part.
Bob
Circle To Square? Possible?
yeah im a crazy beginner and i wanna turn a circle into a sqaure. how the mother do i do that? i thank in advance whoever helps me. it is ten thousand times appreciated!
--crazy joolie
Withe Square?
Hi,
I try to publish a .fla from a client and I just have a withe square for .swf !
It's possible that he block the publishing of his file ?
Where can I Disable that ?
the .swf seem to be empthy (24k)
any other suggestion about the problem ?
Pleasssssssssssssssse help me... It's urgent and I try and try and try... with NO result !
Thanks a lot
10 Square Preloader?
Help please!
I want to make a preloader that has about 10 squares that light up/fade to white. every 10 percent or so.
Is this hard? Does anybody have action script they can offer?
Thanx!
How Do I Create A Square?
I need to create a square which will represent a wall, whereby the user types into 2 text fields one displaying the thickness of the wall and one displaying the length of the wall. And then when you click a button it creates the wall/square.
for example,
Thickness(inches)= 8
Length (meters) = 20
CREATE WALL(BUTTON) //this button then creates the wall/square
And then for the user to be able to Drag the wall anywhere on the screen.
Please can anyone help me with ?
it will greatly appreciated!
Resize Square
hi,
i wanted to know ho do i increase the size of a squre box by tweening. when i do it the normal way in flah the box does resize but only toward the left hand side and the upper side. i wantyed to know how to resize a box symmetrically from either side.
Square With Corners
When you draw a square ouline using rectangle tool (using stroke only/no fill) then increase the line thickness the corners become rounded.
How do you draw square corners at this thickness?
How do you make the line thicker than '10'?
+
Non-square MC For StopDrag()
I am trying to develop a drag and drop system that has dynamic 'dropzones'(moveTo() & lineTo()). These dropzones need to initate a function if the dragging object is dropped on. However, I need these dropzones to be rhombuses, not squares.
It appears that _droptarget and hitTest() use the square(x,y,height,width) of my dropzones making them bigger than they are suppose to.
Is there a mathematical way to determine whether or not the draggable object was dropped onto the rhombus hotspot?
Square Navigation
i have a square divided into four smaller squares. When you rollover either of the four small squares, i wanted it to grow and almost fill the main large square with the other 3 squares just sort of shifting over to accomodate the growing square. Then when you roll off it, it shrinks back to it's original size.
How do i do this in actionscript without buttons and tweening?
any feedback is appreciated.
Expanding Square
a saw a cool effect often done on steves-templates.com, where a square expands first by its corners and then kinda stretches out from its sides. how do i do that?
Square Brackets 2.0
Hi
Just a question on square brackets
what are they used for? it seem to be a reference to a variable but im not sure
and could some one give me an example of where you would use one and for what reason
Thank you
Moving Square
Hi...
I want to make a flash page with a square (containing text and pictures) that moves horizontal when the menubuttons are pressed.
I've found an example af the effect here...
http://www.fiveight.com/
But I can't figure out how it's done
Can anyone help me out??
Thanks in advance
J-12
Do Textboxes Have To Always Be Square?
What if I wanted to make one the shape of a heart? and have the text stay within the confines of the heart?
any tuts or geniuses can help? Yes, I searched.
How To Draw A Square With As3?
I am trying to draw a rectangle that starts off small and then expands to become the border of my flash site are there any tutorials on drawing anything like this???Thanks
Square's Properties
I created a symbol with the instance name of square. in actionscript code (actions), i want to see a little window displaying the squares properties. for example, when i type "square." then a little window displaying a list of properties should appear but it is not. is there a way to get it to appear?
Square Roots
Hi, does anyone know if there is a way to display a square root symbol in a text box as part of the actionscript code. For instance the square root of 4. I just want to display the problem not the calculation. Thanks
Square Symbols
How can i make symbols is Flash that are not surrounded with a square box. Like i want to make a round hill were you can walk up.
But when i hitTest the object it already hits the hill before.(cause of the sqare box)
please help
thank you
Resizing A Square
Hi guys,
Can someone please help me. I'm looking for a way to resize a square in actionscript 3. The code I already have is this.
ActionScript Code:
function onOver(e:MouseEvent):void
{
var itemName:String = e.target.name;
if (itemName.match("item1") || itemName.match("item2"))
{
var item:Object = e.target;
while (e.target.width < 300)
{
item.width += 1;
trace(e.target.width);
}
}
}
Problem is, that this causes 'item1' to resize to 300 too fast (sub 0.01s). I'm VERY new to AS3, so if there is a way of making it resize to 300px in another way that won't make it change so fast, please let me know.
Thanks!
Square In Flash?
Hi! How it is possible to draw a square in Flash if co-ordinates are is in XML? Please help with a script.
Square Array
Hi!
I want to create a rectangular array from a number of images. Basically something like this:
-----
-----
-----
I want to do this using actionscript with duplicateMovieClip and setProperty commands.
Here is what I have so far
i=1;
while(i<5) {
duplicateMovieClip(square, "square" + i, i);
setProperty("square" + i, _x, 75);
setProperty("square" + i, _y, 40);
setProperty("square" + i + ".mask", _x, 80*(i-1));
trace("square" + i);
i++;
}
This duplicates the mc square 4x and changes the position of 'mask' within the clip to be in one row.
On the next row, the parent clip square should remain in the same location, but the 'mask' mc needs to move in x and y direction as well... and so on.
This is in principle a relatively easy problem, but I can't get my head around how to make the mask clip move in the y direction every time a row is complete.
Any suggestions?
Thanks!
Square Art Generator...
http://www.michael.harvardroad.com/images/blocks.html
This is not a big deal at all, and please be nice about it, but it's just a cool little thing, a skill builder type thing, anyway if you guys would like the source code it is at this link...
http://www.michael.harvardroad.com/f...topic.php?t=52
-Michael
** WARNING ** this code is not optimized yet!
Circle To Square
I am a newbie, I was wondering on how to animate a circle changing to square.
Mysterious Square
I'm building a shopping cart for a gallery site. I hadn't even worked on it for a week, but when I checked it yesterday, there was a strange problem. When you click directly on the datagrid a mysterious green square appears. The square doesn't inherit the transform of the data grid, but it does inherit the alpha value. The really strange thing is that it only happens when I post the files online. There is no problem when testing locally. I've talked to tech support and they were stumped.... Can anyone help? (please don't try to purchase anything, the site is far from finished)
the data grid comes up when you press add to cart or show cart http://danielbourdet.com/susanbourdet/SBgallery.html
Square In Flash?
Hi! How it is possible to draw a square in Flash if co-ordinates are is in XML? Please help with a script.
How Can I Confine This To A Square?
I have a ball that follows the mouse, but I need to confine it to a box shape. I can do it with the dragable buttons but not this MC that follows the mouse.
Here is the code I have attached to the ball MC:
PHP Code:
onClipEvent (load) {
_x = 0;
_y = 0;
speed = 5;
}
onClipEvent (enterFrame) {
targetx = _root._xmouse;
targety = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (targetx-_x)/speed;
_y += (targety-_y)/speed;
}
Cheers.
Flipping Square
was wondering if anyone knew how to do this, if they'd seen a tutorial somewhere or if it's at all possible.
I want to take a square and then slowly turn it over to reveal an image on the otherside. Best anaology is in a stadium when they make the people hold up those coloured cards and then flip them over to reveal an image...thats kind of what I wanna do.
Any help is appreciated
Fill A Square?
How can I fill a square made with:
Code:
createEmptyMovieClip("Line",1);
Line.lineStyle(1,0x000000,100);
Line.moveTo(20, 20);
Line.lineTo(30, 20);
Line.lineTo(30, 30);
Line.lineTo(20, 30);
Line.lineTo(20, 20);
I have tested to write
Code:
Line.beginFill(0x00ff00, 100);
Line.endFill();
after it but it dident happen anything.
Please help me
Square Art Generator...
http://www.michael.harvardroad.com/images/blocks.html
This is not a big deal at all, and please be nice about it, but it's just a cool little thing, a skill builder type thing, anyway if you guys would like the source code it is at this link...
http://michael.harvardroad.com/forum....php?p=238#238
-Michael
** WARNING ** this code is not optimized yet!
Square Particles
Hey im tryin to make a web site with dreamweaver and some flash integraton, but there is a problem i have not used flash very much. Anyway i was wondering if anyone could help me with my site.
I want to know how to make a flash effect that has square particles appearing around an object, text in my case, aligned in a grid. It is something similar to the flash effect on this site, the background grids;
http://www.templatemonster.com/show....g2=&order=date
Please help.
Is there a place where i can learn layers and what action script to use?
P.S. If anyone else has any neat ideas for my site feel free to shout em out. Its a Computer business called Lucent.
PEACE
PLEASE POOL OF SQUARE HELP
I DON'T KNOW WHAT I AM DOING WRONG, BUT I CAN'T CREATE THE POOL OF SQUARES AND THE .FLA FILES IN THE KIRUPA SITE ARE NOT AVAILABLE.
CAN SOMEONE UPLOAD THE FILE PLEASE.
THANK YOU !!!!
Square Preloader
I have seen a few of those preloaders that have empty squares and as they get closer to 100% they fill
like this:
Code:
0% = □ □ □ □ □ □ □ □ □ □
10% = ■ □ □ □ □ □ □ □ □ □
20% = ■ ■ □ □ □ □ □ □ □ □
30% = ■ ■ ■ □ □ □ □ □ □ □
40% = ■ ■ ■ ■ □ □ □ □ □ □
50% = ■ ■ ■ ■ ■ □ □ □ □ □
60% = ■ ■ ■ ■ ■ ■ □ □ □ □
70% = ■ ■ ■ ■ ■ ■ ■ □ □ □
80% = ■ ■ ■ ■ ■ ■ ■ ■ □ □
90% = ■ ■ ■ ■ ■ ■ ■ ■ ■ □
100% = ■ ■ ■ ■ ■ ■ ■ ■ ■ ■
How is it done. Thanks
Thanks,
Emdiesse
Line Square
i want to know how to make a square that draws it self in actionscript
I was thinkning line tos
but can someone help me clear it up
Square Brackets
Html Conversion square brackets I trying to send varible name that is followed by square brackets out of flash such as product[]
i need to have the square brackets in order for html to read the variable.
this is my code
on (release) {
// Initialize form variables:
formData = new LoadVars();
formData.userid = "B1";
formData.product= "hat" ;
formData.price = "125.00";
formData.qty = "";
formData.product[] = "";
formData.color = "";
// Get combo box selections:
formData.qty = quantity_cb.getValue();
formData.product[]= size_cb.getValue();
formData.color = color_cb.getValue();
formData.send("http://www.thesite.com/cf/add.cfm", "_self", "POST");
}
any ideas
Square 1 With Video
i am a huge noob when it comes to working wite video. could someone point me in the right direction of a tutorial for creation or download of a video player that would support an mpeg4 file?
any help would is incredibly appreciated.
cheers,
trig
Square Effect
Can someone tell me how to do this effect?
http://store.jumpeye.com/squareeffect/index.html
|