ActionScript 2.0 :: Removing Rectangles Drawn Using Code?

Aug 11, 2011

I have written code to draw a rectangle around each movieclip on the stage when the user clicks a "Show Hotspots" button in the movie. However, when the user (me in this instance) clicks the button a second time, I want those drawn rectangles to disappear. How do I clear a rectangle that is created through code?

View 4 Replies


Similar Posts:


ActionScript 2.0 :: XML Drawn Rectangles To Movieclip Array?

Dec 27, 2007

I am using an external custom class to draw xml driven shapes in a movieclip. take a look at [URL] for a better idea of what I am working on. I am looking to turn each shape (which would be a booth) into a button...so that I can click each booth and have some info come up about it. I am having a hard time calling the array from the main movie.

View 1 Replies

ActionScript 3.0 :: Use Image Instead Of Plain Rectangles By Modifying The Code?

Aug 19, 2011

It is a wonderful code. But I would like my own images instead of the rectangles that actionscript generates. How to modify the following code,This is whole code I have on my project:

Code:
package
{

[code]....

View 1 Replies

ActionScript 3.0 :: Draw Multiple Rectangles With Mouse And Allow Exclusion Of Individual Rectangles

Mar 28, 2010

I have the following AS code to draw a single rectangle using mouse, but I need a different code that allows drawing multiple rectangles and the selection/exclusion of individual rectangles like a modeling tool (eg.: MS Visio).

View 2 Replies

Actionscript 3 :: Add Rectangles To Get The Bounds Of All The Rectangles

May 18, 2011

Is there a way to add a grid of rectangles together so that you can get a "container" rectangle (the bounds) of all the rectangles put together?

View 1 Replies

ActionScript 3.0 :: Getting Rid Of Horizontal Artefacting With Code-drawn Gradient?

Oct 2, 2011

I'm building a video player for my own use and I'm drawing all graphics with AS3. I've attached a screen shot of this problem, and the code. I'm keeping this brief because I think the solution should be simple but I can't find it after a few days of tinkering. You will see from the attached screen shot, I hope, that the video shell base which is 1000 x 100 pixels is not perfectly smooth. And it would be nice and smooth if I drew the graphic in Flash and just built a simple movie clip. But with the graphic drawn with AS3, there's lots of horizontal artefacting. How do I get rid of all the horizontal artefacting lines in the code gradient? The only solution I can find is adding blur with Tween Lite. Which I've turned off, reducing X & Y blurr to zero. But shouldn't it be possible to get a perfectly smooth gradient WITHOUT dozens of horizontal artefacting lines and without having to use a blur from a Tweener engine? I've tinkered with the hexadecimal colour values and increasing and decreaing the Array to more and less colors. The aretfacting persists.

private function M1 ():void {
// Matrix and shape of video shell and gradient
var type:String = GradientType.LINEAR;

[Code].....

View 0 Replies

ActionScript 2.0 :: Removing Lines Of Code?

Jan 5, 2009

I've toyed with this script for some time now and I am having issues removing lines of code and still getting my script to work. Basically I want to keep how this code loads and centers the parts of that code that refer to "mc" but I want to take out anything that refers to "bkg". I have gone through the code step by step to comment out areas but when I get to the very bottom, if I comment out this line:

Code:
function loadBKG():Void {
loader.loadClip("sgbg.jpg", bkgHolder);
}
//Start Loading
loadBKG();

then my script breaks and nothing loads. My main goal is to remove everything that is loading in the background image as I want to replace with better/other code that handles loading a fullscreen image better.

Here is the entire code I am using:

Code:
stop();
Stage.scaleMode = "noscale";
Stage.align = "TL";

[code]....

View 1 Replies

IDE :: Removing The <noscript> Within Dreamweaver Code?

Feb 12, 2009

I inserted a flash/javascript into dreamweaver and it looks great when testing locally... Once uploaded to the server the flash does not display.. It looks like it is going to (says loading, etc...) but then no animations...I also tried removing the <noscript> within dreamweaver code, and still nothing....

View 1 Replies

ActionScript 3.0 :: Optimizing Code For Removing Lag?

Oct 14, 2011

I recently completed the battle engine for my game.But the problem is that it is lagging horribly.optimize the code(because the graphics I'm using are really very basic)

View 13 Replies

ActionScript 1/2 :: Removing _root Code Does Not Work?

May 5, 2011

I've tried removing or using this and code dose not work.
 
[Code]....

View 2 Replies

ActionScript 3.0 :: Tutorial: Removing Things Using Code

Apr 15, 2011

This is the place to discuss anything regarding the Removing Things Using Code tutorial

View 2 Replies

Actionscript 3.0 :: Professional : Removing An Event Listener In Code?

Mar 20, 2012

i have a movie clip named "contact" inside this movie clip made the same object into a 2nd imbedded movie clip named "em_contact" inside this I did a frame by frame animation and added a new movie clip symbol of a piece of paper named contactbtn_mc on this frame, I added an event listener for a click that acesses on the root level a symbol named contact_mc i told it to go to and play frame 2 that plays out an animation of this object moving into the screen.

my problem here is i asked earlyer on how to stop the em_contact to stop listening for the mouse click once it is clicked. I made the code it come up with no errors but it does not stop the event listener the event listener is still there bellow is my code.

import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
import flash.events.MouseEvent;

[code]....

what i want to happen here is for the event listener once it is click to stop listening for that event becuase i have a mouse event inside the "em_contact" movie clip on an object named "contactbtn_mc". and that one has a click event on it as well but when i click on the contactbtn_mc the animation above plays out as well.

View 1 Replies

ActionScript 3.0 :: Removing Eventlistener On Main Timeline Using Code Within Mc?

Feb 2, 2011

I have an event listener on my main timeline and I have an mc with some AS which sits on the main timeline. I was just wondering if the following code is correct if I wanted to remove the event listener on the maintimeline from the AS written in the mc.

MovieClip(parent).removeEventListener(Event.REMOVE D_FROM_STAGE,
MovieClip(parent).removedFromStageHandler);

View 8 Replies

ActionScript 3.0 :: Does Removing White Space In Code Lower SWF Size

Nov 25, 2008

I am working on a Flash project where file size optimization is critical. I am curious if removing white space from the code (which lowers the size of the AS file) will reduce the size of the finished SWF or if the Flash compiler already does this?

View 2 Replies

ActionScript 2.0 :: Removing The OnEnterFrame At The Beginning Of The XML To Variables Line Of Code, So That Is Stops Running?

Mar 26, 2006

I have a bunch of thumbnails i'm getting from XML that have this code on them...

Code:
for (e = 0; e < total; e++) {
_root.web_thumbs.thumb_button.duplicateMovieClip("button" + e, e + 12);
_root.web_thumbs["button" + e].c = e;[code].....]);

It loads the XML variable fullimg into an empty movie clip on its own layer in the timeline.The movieclip, "container", is assigned this code, but the code isn't on the movieclip, it's on a frame designated for just actionscript.This is the code

Code:
container.onEnterFrame = function() {
this._x = int(content._x - (content._width / 2) + 30);
this._y = int(content._y - (content._height / 2) + 30);
}

The Problem Is...When there is no image loaded into the movie clip, it works fine, and shifts around depending on the location of the other movie clip, "content". But, once there is an image loaded into "container", it stops shifting around depending on the location of "content", and just sits in its last location.The only thing i can IMAGINE being problematic is, on another frame, where I have the XML being cut up and assigned to variables, at the end I have a remove _root.onEnterFrame, removing the onEnterFrame at the beginning of the XML to variables line of code, so that is stops running.

View 2 Replies

Actionscript 3 :: Random Point Between Two Rectangles?

Jan 16, 2011

I'm making a top view zombie survival game in AS3. I want to spawn the enemies in waves defined by "frames", or the difference between a bigger rectangle and a smaller one within it, like a picture frame. Right now here is my code, which is pretty inefficient. I was wondering if there was a better way. This code doesn't work right either, all the enemies spawn in the bottom right of the screen:

public static function waveOne():Point {
var inner:Rectangle = Waves.WAVE_ONE_RECTANGLE_1;
var outer:Rectangle = Waves.WAVE_ONE_RECTANGLE_2;[code]....

View 1 Replies

Actionscript 3 - What Is The Box Model For Flash Rectangles

Jun 29, 2011

In CSS, we have a box model to define how border, margin, padding, and fill contribute to the total width and height of a rectangle. I'm porting some of my HTML/CSS design into Flash and can't quite figure out what Flash's box model is. In Flash, I've created a rectangle with gradient fill and a non-scaling 1 pixel stroke. I'm trying to get pixel-perfect positioning and sizing, but the experience has been unpredictable. I'm not really seeing a pattern to the following questions. The answer really changes depending on the exact circumstances.

When you set x and y both to be 0, where does the border lay? Is it off the screen? Is it being cut in half by the origin? Or is it completely visible?When you set width to 100, is the fill 98 wide or 100 wide?What happens to the 1px thick border when the rectangle is not positioned at whole number coordinates?

Example:

var sh:Shape = new Shape();
sh.graphics.lineStyle(1.0, 0x00FF00, 1.0, false, LineScaleMode.NONE);
sh.graphics.beginFill(0xFF0000, 1.0);
sh.graphics.drawRect(0, 0, 100, 100);

[code]....

I tried to create a 100x100 square at x:10, y:10. When I measured the total width and height in Photoshop, it came out to be 101x101.One would either expect the final dimensions to be 100x100 (border on inside) or 102x102 (border on outside).

View 2 Replies

ActionScript 3.0 :: How To Draw Grid Of Rectangles

Oct 9, 2009

I have been learning how to draw rectangles. How would I draw a grid of rectangles so each is separated by some spacing? For example 4 col x 3 rows.

View 9 Replies

ActionScript 3.0 :: Contain Rectangles With Scrollable Container?

Jan 17, 2010

I created a small rectangle and made it into a symbol movie clip. then I went inside of it and added a small 100x100 image on the left side along with a description of the image on the right side filling up the rest of the space.

I now want to somehow put it in a container that will automatically add a vertical scrollbar on the right side and somehow add more rectangles on top of each other. perhaps the scroll bar wont be initially on the screen until the container fills to have more than 5 rectangles in it or so.

Is there a component I can extend somehow to add this kind of functionality or does one already exist that I can use?

View 3 Replies

ActionScript 3.0 :: Dynamically Add Rectangles To The Stage?

Jul 21, 2010

I'm trying to develope a simple game, but i'm facing a problem, that I think it is simple for yours who have experience in AS3.I trying this:

Quote:
...LOOP.........
var dynamicObj:MovieClip = new MovieClip();

[code].......

View 3 Replies

ActionScript 2.0 :: Multiple Rectangles Size And Pos?

Mar 22, 2004

I have 5 rectangle mc's. All different sizes and different positions.

I have a final size and position.

I want to click on 5 different buttons and make the corresponding mc grow and move to the desired final size.

View 14 Replies

Professional :: Drawing With A Pencil - Circles And Rectangles?

Jan 21, 2012

When I am drawing with a pencil, the line looks like the shape I want to draw, but when I stop drawing, the shape reshapes to another shape whick looks like circles and rectangles = it does not look like the shape I wanted to draw. What is the problem?

View 1 Replies

Professional :: Rectangle With Arbitrary Number Of Rectangles?

Mar 27, 2012

I'm trying to figure out how to tile a rectangle (the stage) with an arbitrary number of rectangles. Simple tiling where all the tiles are the same size and simply stacked in a grid.I'm doing this with a resizable layout and a number of tiles that is arbitrary and will change over time.

Given a more or less 4:3 or 16:9 monitor I would like a solution that tends toward minimizing the perimeter of the tile and being similar in aspect ratio to the screen. I realize that if I have a prime number of tiles that I won't be able to make a nice grid, but other than that it seems there should be some way to do this.Lets say I have 231 tiles I need to arrange. The factors are 1, 3, 7, 11, 21, 33, 77 and 231.If the screen is really, really wide 1 x 231. Wide but not not as crazy wide as before 3 x 77. And most likely 11 x 21 is what I would need.So is there an easy way to do this on the fly? Is there a pre-calculated way to make it easy?

View 1 Replies

ActionScript 3.0 :: Creating A Series Of Solid Rectangles?

Jul 13, 2009

Fairly new to ActionScript 3. I am creating a series of solid rectangles which will be acting as butttons for my site, a new rectangle is created by looping through an XML List, 1 rectangle for each title in my List. They will be displayed 1 above another down the left hand side of my screen.

What I want to do, if possible, is create a vanishing point on the right hand side of my screen which the rectangles will use to alter their perspectives.Obviously the rectangles with a far different Y position to the vanishing points, will display with a greater perspective.

View 2 Replies

ActionScript 3.0 :: Find If Two Rectangles Are Intersecting When Rotated?

Aug 9, 2011

I have two sprites that are drawn as rectangles. I want to know if the rectangles are intersecting. I run into trouble when the objects rotate.

View 2 Replies

ActionScript 3.0 :: Draw Random Colored Rectangles

Jan 20, 2011

I am trying to draw random colored rectangles. I want to have them everywhere. Repeat them at X and Y. Its just repeating at X. Dunno why it dont want to take "for loop" at Y position

[Code]....

View 6 Replies

ActionScript 3.0 :: Making Rectangles & Collision Detection

Mar 28, 2011

Although, The amount of material online is quite confusing, As there usually is more than one way of doing a task. The part that i am up to is making collision detection work. Let me explain some background first, so you can understand how im trying to make it work. Steps

[Code]...

View 4 Replies

ActionScript 2.0 :: Multiple Rectangles Size And Position?

Mar 22, 2004

I have 5 rectangle mc's. All different sizes and different positions.I have a final size and position.I want to click on 5 different buttons and make the corresponding mc grow and move to the desired final size.

View 14 Replies

ActionScript 2.0 :: Drawing API - Rectangles Replication / Echoing

May 11, 2004

I have a pretty simple script that allows you to draw multiple rectangles using the drawing API in MX. I need to create multiple MC containers, so that I can later do other functions to these areas. Now, why the rectangles are drawing in the way they are. If you copy this script into a blank file and run it, you'll see what I mean. Why is it duplicating/replicating/echoing as you draw? If you debug and list Objects, it is creating the MCs properly, so where are these other lines coming from?

Code:
drawLevel = 0;
drawOK = "yes";
this.onMouseDown = function() {
if (_root.drawOK == "yes") {
this.createEmptyMovieClip("rect"+drawLevel, drawLevel);
[Code] .....

View 5 Replies

ActionScript 2.0 :: Draw Lines Or Rectangles With A Commandline?

Jul 17, 2002

Is there any possibility to draw lines or rectangles with a commandline in ActionScript?

View 4 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved