ActionScript 3.0 :: Clear All The Primitives From The Scene3D?
Jan 15, 2009Once you populate a Scene3D with primitives (say in a for loop), how do you clear all the primitives from the Scene3D?
View 3 RepliesOnce you populate a Scene3D with primitives (say in a for loop), how do you clear all the primitives from the Scene3D?
View 3 RepliesAges since I last played with away3d, totally forgot how to use it.What do I do if i want to add a Sprite or object capable of adding Sprites to my Scene3D?
Edit: Using the MovieMaterial in not a possibility due to YouTube disabling Draw() on their APi
Types like Movieclip , String, Object act as references when declared and defined, while types like int, Number are primitives. Why such difference has been made. Why not all of them can be primitives ?
View 1 RepliesI'm working on a game whose background has many layers that each scroll at different speeds.
Inside each layer I have a Sprite, I've started using graphics.beginBitmapFill, but what I've found is that the graphics.clear() function doesn't actually clear the contents set by the previous call to graphics.begin.BitmapFill. Each frame, I adjust the matrix to shift the layer as needed. Then, I call graphics.clear() and graphics.beginBitmapFill() with the adjusted matrix. Since my layers have alphas in the bitmap, I can see the contents that was drawn the previous frame.
I have created a few flex primitives on screen via action script. Now based on business logic, I need to make changes to some of these primitives such as: changing thickness, direction of arrowhead etcOne thought was to assign id's to these primitives as they are built- how do I do that?e.g. I get a line built as below
var myShape:Shape=new Shape();
myShape.graphics.lineStyle(thickness,color);
myShape.graphics.moveTo(XFrom,YFrom);
[code].....
As primitives are copied as 'value' not by Reference, this doesnt work:
ActionScript Code:
var myPrimitive1:int = 10;
var myPrimitive2:int = myPrimitive1;
myPrimitive2 = 20; // i want this to affect myPrimitive1 too
My goal is to pick a random property on a data Object() and alter that. My approach was to put all the Objects properties into an array, and then randomise that array, and pick the first element. The only problem is of course that, that element is no longer a Reference to the original, so If I change that it wont alter the original...
ActionScript Code:
// Create Data Object
var myObject:Object = new Object();
myObject.primitiveVar1 = "string1";
[Code].....
I was in an AS3 course last year and the instructor mentioned that the Oval Options of an Oval Primitive -- start angle, end angle, inner radius -- could be animated in AS3.Does anyone know if this is true, and if so, what are the Classes involved? I've been through everything I know and I can't find a reference to it.
View 6 RepliesI need a compiled and ready-to-use Flash lib, which is able to draw in browser basic primitives (contours, points and labels, not just a charts), described in XML given to the script. It is desirable that the library had at least basic functionality for styling displayed objects: gradients, borders, basic animation, HTML markup. GPL and other free licenses are preferred.
View 1 RepliesI am trying to animate a few primitives that have been created dynamically with tweener. It works if the tweener method is inside the loop, but not when it is outside.
[Code]....
I have a bounded object, created using primitives lines in Action Script- either an oval or a triangle. Is there any way I can fill the contents in a specific color
Just to clarify on this- the shape could be in two ways
a) drawing a isoceles triangle based on a variable apex angle
b) two curved lines to form a "lens"
I am not sure if I can use the fill function, as I am not drawing a inherently bounded shape- the closed nature is based on my calculations
[Code]....
[Code]...
doesnt clear the line when mc1 moved ? How solve tihs problem?
I am creating a wizard-like form. At the end, I give the users an option to start over.At this point, I want to blank out all TextInput fields in the application.I wrote some code that does the trick, but I am wondering if there is a better way?
Code:
private function clearText(obj:Object):void{
try{
[code]....
I have a project I am working on in which I would like to teach how to cash a scratch off card. I have made the scratch and made it so it will "scratch", however my masking technique seems to not be working how it should...
The idea is that the user would "scratch" the card and then hit "Next" after that it would load a new frame (Progress Bar would move) and then do what they need to on that frame, and so on.
However it would seem that Flash is keeping the users "drawing" and still allows them to draw after the first frame, which is not what I want.[code]...
this might be a very simple thing to do, buuuut... I've got two UILoaders on my stage, when you click various buttons it makes various pics appear in them, I want to put a button on my main stage that would clear the images out of the UILoaders when it was clicked, and would just leave them blank. Is this possible?
View 1 RepliesI have a similar problem where I want a text field that by default has the word NAME in it, to become empty when a user clicks on it.
The text field has the instance name 'nam' and is inside a movie with the instance name 'input_text'.
I've searched around and found samples of code where everyone keeps suggesting this:
Code:
textboxinstancename.onSetFocus = function() {
textboxinstancename.text = "";
};
[Code]....
Code:
var moo : Vector.<SomeClass> = new Vector.<SomeClass>();
moo.splice(0);
[code]......
I'm doing 3d gallery in AS3 and i have run in to huge problem. After ActionScript creates 3d sphere it doesnt go away no mater if i go forward or backwards in timeline.
View 0 RepliesAt the moment I have Clock and if I start it a message appears just above the clock saying "Timer started" and if I press the stop or reset, another message appears saying "Timer stopped" or "Timer reset", the only problem with it is that the previous message(s) are still on the screen.
I have an example attached below. I am wondering is there any way to get the textfield to refresh/remove the previous message before showing the current one?
I've got a video page with an XML based playlist all contained in one swf. I can us flash vars to load in variables to the swf to make it play a specific video (eg.[URL]), if you would like to link directly to a video.Is there a way that when i than click to play another video from within the playlist, that it would also clear the variable from the URL? Or have it update the variable (so it would switch from ?vidID=13 to ?vidID=20 for example), and do so without reloading the swf? (the swf loads with a main video page, which lists new videos etc., and than you can choose videos from the playlist)Right now, when you direct link to a video, than choose another video to watch it keeps the same video ID within the URL... which can be a problem if people just copy the URL thinking that is the correct one.
View 2 Repliesit looks like the problem is that the interval has not been clear so every time i click away from my slide show (for example navigate to my contact swf) and then come back to the slide show the pictures keep looping on top of each other and fading at the wrong times too.
var id, current;
var k = 0, p = 0;
var slide = 1;
function loadXML(loaded) {
[code]....
I have two key frames on the Stage. The first one is empty; the actual movie starts from the second frame. Under some circumstances I have to clear everything on the stage and reload the movie. I remove all the movie clips and go back to the first frame. Unfortunately, it doesnt work with components. Can somebody tell me how I can remove everything from Stage? I tried btn.destroyObject(btn._name) but it seems it doesn�t work (the object cannot remove itself). And after several times I move back to the first frame, the components go broken
View 3 RepliesI have a mp3 player in my site and i have 4 difrent albums in 4 difrent XML files..how to unload-clear XML.When i stop sound and try to load new XML it still play songs from previous XML file
View 1 RepliesI have to input feilds. Inside the feilds (through variables) I have "username" writen. How can I clear this feild when the user focuses on the feild?In a frame script I have:
if (selection.getFocus() == _level0.loginPageMC.userTxt) {
userTxt = "";
}
[code]....
Whats the action script to clear a text field?
View 4 RepliesI made a shared object whiteboard but I have a stupid problem with removing objects. This is function to clear shared object :
public function clearShape (so:SharedObject):void {
trace('clear:', this.name);
delete so.data[this.name];
[code].....
I have an external swf that plays an intro in multiple frames of various actionscript fade ins and fade outs. I use a setInterval command on frames that I want to stay up for a period of time:
[Code]...
I'm doing a simple navigational menu and the idea is that when you rollover certain buttons, a linked movie clip appears in a certain spot and any other linked movie clips disappear off the stage. I heard about a bug with AS3 in CS4 and tried the following method but it's not working. All the movie clips stay on the stage. Nothing disappears. Where am I screwing up?
[Code]...
is there a way to clear an XML object of its data to allow it to load new data from the same URL?
View 21 RepliesI would like to be able to clear SWFs from the cache in AS3
View 12 Replieshiya all, i was wondering if there was a command to clear everything off the stage.
View 1 Replies