Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Make Dynamic Objects To Be Clipped Off The Stage



Hi everyone:


Say, if I create a sprite like this:

Code:
var s:Sprite = new Sprite();
//Do some drawing on it
addChild(s);
and, say make that sprite move accross the screen. How can I make it to be clipped when it leaves the stage area (the same way as it happens if I drag a stage object off the stage with a mouse)?

Thanks.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0
Posted on: 10-16-2008, 08:23 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Can I Make Objects Outside Of The Stage Visable?
i made a dropdown menu for the top of my website. the problem is the links list is a bit lengthy and goes off of the stage. so is there a way for those links to remain visable even if they extend off of the stage and even go over other html stuff on my page?

Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?

Create Array On Stage, Mathematically Referring To Objects On The Stage
Ok what I want to do is create a set of small images on the stage and name them sequentially like you would an array, then refer to them mathematically in actionscript. I tried naming them as an array but it says that the name is reserved for the system or something. Does anyone know how to get an array of objects onto the stage, or have an idea of something else I could do to get the same effect?

Best Way To Hide On Stage Objects When Other Objects Need To Be Shown?
A typical nubee question..What is the best way to hide objects on sage when a button from navigation is clicked and in response other information or objects need to be shown instead of the one previously on stage?

Help: Stage Objects Get In Front Of Script Objects?
This is getting me mad...

addChild(my_script_object);

I can't see it...

If I try trace(numChildren) I get 10, so then I try addChildAt(my_script_object,9) and still cant' see it.

If I delete all the objects in stage then I finally see it.... If I delete one by one I find my_script_objects gets beneath a bitmap placed by hand by the designer.

Any ideas?

TIA

Best Way To Hide On Stage Objects When Other Objects Need To Be Shown?
A typical nubee question..What is the best way to hide objects on sage when a button from navigation is clicked and in response other information or objects need to be shown instead of the one previously on stage?

How Do I Use Clipped Jpeg's?
This might be more of a photoshop question than a flash one, but here goes nothing.

Basically, I want to be able to clip out the backgrounds on some jpegs. Does that make sense? In other words, I want to be able to use non-rectangular images. If I use a photoshop .psd file with the background erased, it works fine. However, when I convert the .psd to a .jpeg, photoshop adds a white fill to the erased background, thusly returning it to a rectangular shape. Obviously I can't populate my flash file with .psd's and expect it load in a reasonable amount of time. What should I do?

CONTROL IS CLIPPED
I create a custom control in a FLA, and compile it to a SWC. It works no problem, even the ActionSciprt.

When I place theat control in a new FLA, it is clipped. I only see the lower right, because it thinks the center is upper left. Adding a 2nd control then makes the first available. WHAT THE FUGK IS THAT ABOUT? Also, to move either control, you have to grip it by some new blue rectangly that is no part of the control. This, also, is way off center.

MM DO YOU EVEN FUGKING TEST YOUR CODE?

CreateTextField Text Being Clipped
Hi

I'm having trouble with createTextField. The text field is being created in nested mc's made dynamically with createEmptyMovieClip. They're buttons. Some of the text fields created are fine, but in a good few of them it appears to be clipped on the right. What could be the cause? Here's the script (part of a loop) ....

code:
var style_fmt:TextFormat = new TextFormat();
style_fmt.font = "Book Antiqua (embedded)";
style_fmt.size = 11;

submenuName.push(submenu[j].attributes.name);
subText = submenu_btn.createTextField("subText", 10, -50, 0, 100, 16);
subText.text = submenuName[j];
subText.autoSize = "center";
subText.antiAliasType = "advanced";
subText.embedFonts = true;
subText.setTextFormat(style_fmt);
subText.textColor = 0x8AAFE0;
subText.selectable = false;


I've traced the _width of the text field and parent mc. They both come out the same.

thanks
mark
flash8

Why Aren't The Graphics Clipped Off . . . .
Is there a method to clipping off graphics outside the stage area? Or do I have to make sure the graphics fit the stages' dimensions perfectly? Because when I publish the project the scenes graphics play outside the stage area when the window is enhanced to a larger view. The only instance this does not happen is when it is html.

Thanks, RB

MP3 Audio Clipped When Importing
When I import an MP3 audio file into Flash CS3, the beginning of the clip (maybe 3-5 seconds) is clipped off. When I import as a wav file it imports fine. If I play the MP3 file in the windows media player it plays fine as it does if I import it into Captivate.

To top it off, this just started happening. Does anyone have any suggestions on what might be causing this? I did just start using Audacity to do the editing and output and wonder if there is something it is doing to the file.

Jennifer

Start Of Audio Gets Clipped
The start of my audio segments sometimes get clipped. This happens when they're placed at the start of the movie (in frame one). Does anyone know why this happens and how it can be corrected? I've added some silent time at the start to correct this but is there an easier way to do this? Most of the time the clipping doesn't happen.

Script Fonts Getting Clipped In Flash
We are working on a flash presentation that is being output to DVD and with the above font, which our client wants, and the top of the capital letters are getting clipped off when we output to video from flash. Does anyone have any suggestions as to how we can get around this? I have images as examples but don't see an option to upload. Please let me know any kind of work around that is out there for this.

Thanks,
Jeremiah

Depth And Dynamic Objects/Attaching Scripts To Objects
I am having some problems with my Flash MMORPG created in Actionscript 3.0 that I am working on, not really errors, but more how to do something, in theory. I have 2 problems. First, my game is at a 45 degree angle, so it requires some depth handling(like one object is over another object when it should be behind that object). I am not sure how to go about this. I was thinking that each object's depth should be it's y position if it's origin was at it's feet. But that idea didn't go well, because the depth is limited by the number of children. What is the average way to do this? Next, I am trying to make dynamic objects, so that all I would do is copy and paste an object, or create a new class of it and it would work. What I mean is, the character checks a collision for each object, but if I copy the object with the same name, it doesn't work. In AS3 you can't attach scripts to objects anymore, so I am running into a lot of problems with that. How would I go about fixing this? Thank you in advance.

Moving The Stage After Resizing - Or Moving All Objects On The Stage? Heeeelp
Hello! I'm in dire need of help!

I've been forced to resize the stage of my movie but as the stage is expanded to the right and down everything ends up in the wrong place. So I wonder:

Is there any way to move the stage rather than the contents thereon?

or

is there a way to move all the content on all layers and even all scenes simultaneously?

or

is there a way to expand the stage equeally on all sides rather than just right and down?

THANKS ALOT TO WHOEVER COULD HELP ME!


Freddy D, Stockholm, Sweden

Objects Off Stage
I am loading a small movie inside a larger movie. The smaller movie has object off the stage that move across. When I play the small movie by itself shows just the movie stage. But when I load this into the larger movie stage I see all the off stage objects on the smaller movie.

What am I doing wrong?

I Can See Objects Outside The Stage :(
hello,

im testing my flash site and everything looks
pretty good BUT when i resize the window to see what happens....anything thats in the flash file shows up even though it isnt on the stage.
how can i limit the window so it doesnt resize.

i didnt design the site to look good if someone resizes the window. i have very custom edges and if you resize the window the design falls apart.

did i screw up or do flash designers have a work around for this.

also, is it a BAD idea to design this way (framing the edge) because of peoples tendancies to want to resize their browser windows?

Off Stage Objects
I was under the belief that objects off (to the side of the stage) were not visible. When I "test movie" though they are clearly visible. Am I doing something wrong, possibly they need to be masked?


Thanks
Stuart

Objects Off Of Stage
i have a flash movie i made.... when i load it into an empty movie clip in a new flash document, it plays but shows all the items that were off of the stage and on the area around it - when these items are only supposed to be seen moving onto the stage. does this make sense? how do i make it not show any area off of the stage?

thanks a ton in advance
cosmo

MVC And Objects Already On The Stage
So I'm finally really digging into design patterns with AS3 and I'm finally getting the hang of it. I'm currently floating through Adobe's "Advanced ActionScript 3.0 with Design Patterns" by Lott and Patterson.

For the MVC pattern, where exactly does an object fit in that has already been placed on the stage?

The problem comes up because an object on the stage at compile time is immediately instantiated without any real control as to "how" it is instantiated (afaik). The above book's clock example shows adding objects dynamically through an Abstract view, but that view requires arguments, and I don't see how you can pass those arguments at compile time.

Just a bit confused how to combine this together. Check out the clock example here:
http://rightactionscript.com/aas3wdp/

Does MX Allow Objects Outside Stage?
may b its just me but, i remember placing instances outside the stage area and MX doesnt allow it 4 some reason or i'm totally missin somethin??

hog!!~~

Objects Outside Of The Stage
Hello,

As all of us know the objects that are placed outside of the stage are not visible. But is it possible to access and alter these objects. I'm asking that, because of security reasons. I don't want that the user access these objects even if they are not visible. So is it safe to place them just outside the stage.

Any suggestions will be helpful. Thank You.

Can Anyone Tell Me How To Mask Off Stage Objects
Hi.
can anyone tell me how to make the off stage objects not to show on the movie when it's maximized or fullscreen.
thankx for your time.

Moving Objects On The Stage Help
Hello,

What I am trying to do is;

Assume there are 5 playing cards on the stage spread out evenly across the stage, and what I want to do is, when you move the mouse of each card (should I make them a button or movie instance?), the card will move to center of stage and go from about 20% of its size to 100% by the time it is in center screen. But this will have text on it, so at 20% you can't read it until it gets to center and is at 100%. Is this actionscript? I am not familiar with that other than gotoAndStop and so forth.

Ok, yes I am new to Flash MX, but I am learning more everyday from all of you, so can anyone please help me?

Thank you

Thorrax

Objects Visible Outside Stage?
is it possible to make an object remain visible even when it moves or extends outside of the normal stage area?
HOW?

Stage Aware Objects
Hi People,
Is there a script or extension that causes a mov to alighn it self to the edges of the screen no matter what the size of the browser is.
Check out this example:
http://www.bentleymotors.co.uk/bentl...ctlanguage.jsp
This flash site shows a logo in the upper right that moves it's placement according to the Monitor.
If you test it by using different size monitor sizes you will notice that
the logo always stays on the right but the rest of the movie stays the same.
You see that by the links at the top do not move.
So my question is again how is it possible to or what script would I use to tell an object, be it graphic or movie, to be aware of the size of the stage and align to the right .
This is a very cool trick.
What's really cool is the html page seems set at a percentage but the top of movie file grows or expands instead of just enlarging.
This is crazy.
Any help on this would be appreciated.
Thanks,
Joseph

How Do I Prevent Objects From Being Seen Outside The Stage?
When I watch my animations I don't want the objects to be seeable when outside the white box stage. I know you can use masks but is there a real way to do this? If there isn't then I don't get the point of the designated stage area....

Thanks in advance.

Objects Off Stage Showing
I thought it didnt happen, but long objects off stage show up in my .exe and .swf files, and they print as well.

I thought things off stage were not supposed to show. is there a setting or way to block out the off stage images until they scrolling onto the stage? (other than covering with background matching color)

Thanks
Steve

Objects Showing Off Stage
I thought it didnt happen, but long objects off stage show up in my .exe and .swf files, and they print as well.

I thought things off stage were not supposed to show. is there a setting or way to block out the off stage images until they scrolling onto the stage? (other than covering with background matching color)

Thanks
Steve

Objects Showing Off Stage
I thought it didnt happen, but long objects off stage show up in my .exe and .swf files, and they print as well.

I thought things off stage were not supposed to show. is there a setting or way to block out the off stage images until they scrolling onto the stage? (other than covering with background matching color)

Thanks
Steve

[F8] Stage Objects Not Right In Flash8
Hi,

A Summary.

The Object Instances from Flash 8 are not the same as those which come with the Flash MX 2004 D.R.I.A. coursework, which I'm currently going through.

The parameter names are different and I'm somewhat confused as to why.

eg

Flash MX2004 Group Name
Flash 8 Pro groupname.

etc.

I have Input Text boxes, checkboxes not behaving properly with Actionscript and now radio boxes where if I set an inital value it ignores other items in the same group and cannot switch off.

Any ideas what I can do or an explkantion as to why this is wrong in Flash 8? I desperately want to learn Flash properly but it seems the course I paid for and attentded a few year ago could well be defunct.




Outline

I did the Flash D.R.A.I. course a few years ago (flash MX) but didnt get a chance to practice or use any of it. I have recently decided to work through it again and have run into problems while manipulating push buttons and checkboxes.

I have created object instances, two of which need to be cleared when the user selects a push button with a clear function attacted to it.

I have named them correctly and I have typed in the correct actionscript commands. I have even checked the actionscript against the solution files and everything is exact. Yet the flash movie doesn't behave correctly. (eg the 'clear' button isnt working)

I then noticed that the object instances on my stage seemed different to the ones from the solution files.

They had the correct name etc.., but the checkbox from the solution file seems to be a symbol movie clip(???!!??) yet mine wasn't. and the Order_ID Input text had loads of superfluous parameters selected in the property inspector, which I did not set and do not seem to be able to change.

So obviously it was the objects on my stage which are wrong and to check this I copyied and pasted the instances objects from the solutions file stage onto my stage and hey presto they work.


My question is. Why is this happening. Why is the check box a movie clip symbol, which you arent supposed to be able to set parameters for anyway.? Bascially, help!!!

Here's my code, which works


/***********************************************
included ActionScript files
***********************************************/


/***********************************************
object constructors and object creation
***********************************************/


/***********************************************
functions and object methods
***********************************************/
orderID_txt.onChanged=function()
{
message_txt.text="You Entered "+orderID_txt.text;

}

clear_pb.clear=function()
{
orderID_txt.text="";
back_ch.setValue(false);
message_txt.text="";
}


/***********************************************
run at once commands
***********************************************/

message_txt.autoSize=true;
message_txt.textColor=0x630000;
message_txt.text="new message";

clear_pb.setLabel("Clear");

clear_pb.setClickHandler("clear",clear_pb);

Spacing Objects Out On The Stage...?
Hi guys

i'm trying to find a tutorial for spacing objects out on a stage...
Say for example I have 20 spheres on the stage different sizes I want to create a script (OOP probably) that will ensure that the spheres don't overlap etc.

Does anyone know of any tutorials or can suggest a way for me to go about writing such a script?

Many thanks.

[CS3] Detecting All Objects On Stage
How can i find every object on the stage and place them into an array?

Stacking Many Objects In The Stage
Im trying to make a slide show of many pics (sliding from right to left) but there is a problem. They wont fit in a straight line when stacking them in the stage. There is just not enough room to stack them all in, and then make the sliding! What can i do?
I have attached the sample but i haven't put it all to be working properly, i have just added the extra samples i wanted, so you can get an idea when the fitting is beginning to become a problem!

AS3 Find Objects On A Stage
How can I access instances of an object that i added on a stage. I create buttons with the use of class and add them on the stage giving them some label name that are read from an XML. All works well and the buttons are displayed on the stage but i want to know if there is a way to access them from within the stage.

Moving Objects On Stage
I recently was asked to make sort of a slideshow, not a problem.
My question is, since there were 100 objects at once to be moved at the same time in the same direction, is there a simpiler way to make everything move at once instead of making them all move one at a time?

All Objects On Stage Of Particular Class
Is there way to get an array or other collection of all the objects on the stage of a particular class? Or, at least to loop through all the objects on the stage so I can test them for their class?

Example: I have defined a class called "attractor" which extends MovieClip. Objects of this class have effects on objects with the class "attracted", which has an array property to hold references to all the "attractor" objects currently effecting it. I want to define a function that will find any "attractor" objects on the stage add them to the "attracted" object's array.

Thanks for any help you can offer.

All Objects On Stage Of Particular Class
Is there way to get an array or other collection of all the objects on the stage of a particular class? Or, at least to loop through all the objects on the stage so I can test them for their class?

Example: I have defined a class called "attractor" which extends MovieClip. Objects of this class have effects on objects with the class "attracted", which has an array property to hold references to all the "attractor" objects currently effecting it. I want to define a function that will find any "attractor" objects on the stage add them to the "attracted" object's array.

Thanks for any help you can offer.

How Can I Show Objects That Are Off The Stage?
When the browser is big, I want to show the objects that are off the stage.

how do I do this? I tried to follow directions in a book I have but it's not working.

thanks

How Do You Move Objects Across Stage?
Hi i can't seem to move the picture to the stage..I loaded the picture in but when i press play all it does is show the picture...i want the picture to load to the x and y cordinates of 0,0 (center of stage) and it doesn't matter where the starting point is...can somebody please help? Here's the code so far...please tell me what i should do to fix the problem

var startX:Number = myImageHolder._x
var startY:Number = myImageHolder._y
var endX:Number = 0;
var endY:Number = 0;


myImageHolder.onEnterFrame = function () {
if (this._y > endY && myImageHolder._x > endX)
{
myImageHolder._y += ((endY - startY)/100);
myImageHolder._x += ((endX - startX)/100);
trace("x/y start:"+myImageHolder._x+"/"+myImageHolder._y);
trace("x/y end:"+endX+"/"+endY);
}
}

// create the XML variable
var xml:XML = new XML();
xml.ignoreWhite = true; // you must ignore whitespace
xml.onLoad = function() { // the function that is called when the xml is loaded
var nodes = this.firstChild.childNodes; // tells you the number of child nodes
numOfItems = nodes.length; // tells you how many items you have

for (var i = 0; i<numOfItems; i++) { // attach icons
myImageHolder.loadMovie(nodes[i].attributes.image);// attach image to the myImageHolder MovieClip
nextimage();
myText.text = nodes[i].attributes.caption; // set the text
}
}


xml.load("xml/images.xml");// load the xml

Manipulating Stage Objects
Hi all,

I'm working on a movie that at some point in the timeline has a dynamic text field. I want to populate this field in the background depending on what I get passed into the movie. The name of the field is "PhoneNumber". In AS I try to do this, but it's not working:

PhoneNumber.text = "000-000-0000"

I keep getting this error:

1120: Access of undefined property PhoneNumber.

This has been keeping me up for the past 3 hours and I'm starting to hate it. Could someone tell me how to reference objects on the stage and edit them like I'm trying to do with this text field.

Thanks in advance!

Deleting All Objects On Stage
Hi guys,

sometimes AS3 keeps driving me mad. In my application I have a function which indicates the application to restart. As everything in the application is built by classes, I used weak references for the listeners in these classes. So far, so good. Removing everything from the stage works fine as well, BUT also I used the weak references the garbage-collection doesn't kill all of the objects.

Is there any way to definitely kill all the objects that are currently on the stage including all their listeners or pointers?

Thx for any reply
hellslawyer

Loop Through All Objects On Stage?
Is it possible to loop through all of the objects on the stage of a movie?

Say I have a movieclip that I placed 10 TextFields and 2 Combobox Controls on (not dynamically, at design time).

How would I loop through all of the objects?

I have tried the


ActionScript Code:
for (var obj in this)
{
trace(this[obj]);
}

but that does not trace anything, like it isnt getting into the for loop at all.

Finding An Objects Stage
hello,
i'm trying get the stages "Document Class" (_root) of an object in its controller class with the following code:

ActionScript Code:
var targetClass:Class = Object(this.stage).constructor;

but it gives me #1023

what can i do to this?

thanks for any help

Hide Objects Out Of Stage
When using full browser flash and resizing the browser window, the flash scales, but when the browser window gets to narrow e.g., any content/objects/shapes outside the stage are visible as well. Is it possible to use full browser flash, scaling the swf, but hiding the outer stage content somehow?

Mouse Out Of The Stage (even If I Have Objects On It)
How can I detect when the mouse is out of the stage (even if I have objects on it) ?

If I use:

1) stage.mouseOut, it doesn't work because I have buttons on the stage, and it detects when the mouse goes on the buttons (and it is not anymore on the stage)

2) mouse coordinates, it doesn't work because if i move the mouse out of the stage sometimes the last xMouse value, (or yMouse) is > 0.

thanks

Tracing Out Objects On Stage
I want to build an array of all of the dynamicly generated movieclips that are currently on the stage. Is there someway to trace this out?

Most greatful for any advice...

Aligning Objects On The Stage
Does anyone knwo how I can align my MC's to the center of the stage? I've used the Align Panel but when I export my movie all the MC's (menu, borders and background - the lot!) are placed to the left of the window. Any idea why?

Sorry if this is a real noob Qs...

wB

Printing Everything On Stage EXCEPT A Few Objects?
Hey guys,
i just need to know how i would go about printing everything on the stage except for a few things which i define, also all the lines on the stage are dynamic will they print?

(*** edit: I know how to print, but have never actually used it because i dont have a printer, so i cant test ***)

Copyright © 2005-08 www.BigResource.com, All rights reserved