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




Stage Object



Hey all,I'm using the scrollbar class from the as3 tutorial, except that I'm doing it all with code and it's called about 4 or 5 classes deep. My question is, how do I set a stage.addEventListener from inside the class? I know you can't do it that way, but there must be another way to register a MOUSE_OFF while off the scrollbar thumb.TIAc



Actionscript 3.0
Posted on: Mon Sep 29, 2008 4:18 am


View Complete Forum Thread with Replies

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

Position Object By Center Of Other Object And Stage Left...?
lol! :lol:

what i mean is i have an object (mc = main_logo) that centers itself upon load:

main_logo._x = Stage.width / 2;
main_logo._y = Stage.height / 2;

and i want another object (mc = helmet) to always load up 2/3rds to the left (x axis) of main_logo's center (counting left to right, 2/3rds between main_logos center and stage left border) and 200 pixels above (y axis) main_logo's center.

i know i keep asking these things and i'm not trying to have you all do every little thing for me, i am trying to learn this! it's just that my brain operates differently and i have to assimalate information by what i'm trying to accomplish...

thanks!

Moving An Object Thats Off The Stage Onto The Stage
For a Flash class thats coming up we need to do a little game. Now my idea is to make a GTA 1 style game. We have the car movements down but what i'm having trouble with is making the car stay centered and moving objects that arnt currently onto the screen onto the screen. EG Car is in the center (Always stays in the center) Car moves forward, the background (Road, buildings etc...)Move down the screen and new objects apear on top the screen and move downwards or right, left upwards depending on the direction the car is moving. Any help would be greatly appericated.

If An Object Is Off Stage...
All i am trying to do is add a simple event that makes "tri" invisible when it is off stage. I attmpted the following script...


ActionScript Code:
if (tri.x==<0){
    trace("Off Screen")
}

...and it throws up a load of errors. I thought this is all that it would take. Also I was going to simply make "tri" alpha=0 when off the stage, is there a better way? (bearing in mind that it will return to the stage. It is a elastic tween event that goes over the edges for a split second)

Thanks guys

Stage Object
Need a recomendation for Stage object.

What's the best way to use the stage object feature? Should I have a footer.swf that loads my main.swf, which loads all my other swfs? I'm trying to use a footer, I'd ike to align some other features, like maybe something "TL", "TR", "BL", "BR".

Delete Stage Object?
ive trieddelete and remocve movie ect...
but tose only work if yor deleting a movie that has been placed myduplicat movieclip or attach movie.
is there a way to delete an already placed object from the stage using action script?

2 Stage Object Problems
Hey everybody,

First, I have this code where w and h are textfields.
When I resize the flash (published as an exe) the flash never calls this function so w and h doesn't changes at all.

Stage.onResize = function () {
w.text = Stage.width
h.text = Stage.height
}

The Second problem, my flash movie is published as exe inside a CD. My flash must realize when the user restores the application size from the fullscreen mode, but Stage.width and height tells me the size of the Stage as I defined in Flash, but doesnt change when I am in fullscreen mode.

I know my englsih is just cruel, Im sorry about this. If someone understand my problems with the Stage.Object and knows the solution please let me know!

thanks a lot!

Check If An Object Is On The Stage
Hey,
i need to check if the object is on the stage. I need to do something like this:


Code:
for (var i in this) {
if (this[i] instanceof TextField) {
this[i].text = "show this text";
}
}
Thanks

Center Object From Anywhere On The Stage?
Hi everybody,

So far I did this:

- created a couple of dragable clips
- when a clip is double clicked it will start playing (an be scaled)

The problem I have is that when the user drags the clip to one side of the stage and double clicks it it will be scaled there and might be partly outside the stage. Now I would like to center the clip on the stage when it's double clicked and when the user moves tho mouse away from the clip (rollOut) the clip should be scaled back to it's original size and move back to the place where it was (away from the center of the stage).

I know I can use _x=centerx and _y=centery but this let's the clip just jump in to the center of the stage but I would like to have a smooth movement.

Any ideas?

Thanks a lot,
Cheers!

[F8] Making More Than One Object Appear On The Stage
Hi,

I'm making a space shooter game. I have a code that makes an asteroid appear on the stage and traverse it from right to left. I want to know if i can reuse the code to make more than one on the stage at one time. for increased difficulty.

My code is:


PHP Code:



var hit = false;
var obSpeed = 8;
function createObject(o) {
    ob = this.attachMovie(o, o, 100);
    ob._x = 750
    ob._y = random(550)+20;
}
function resetObject() {
    ob._x = 750;
    ob._y = random(550)+20;
    ob.gotoAndStop(1);
    ob.restart = false;
    hit = false
}
function moveObject() {
    if (ob._y<600) {
        ob._x -= obSpeed;
    } else {
        resetObject();
    }
    if (ob.restart) {
        resetObject();
    }
}




In the asteroid movieclip, there is a command to say that hit = true.

Anyone want to take a guess?

Object Placement On Stage
Hi all,

I currently have a flash file which i load several images and titles into from an xml file. Each of these is assigned to a movieclip and placed on the stage in a random position with a random scale.

What i would like to achieve is to have these movieclips appear on the stage in random positions but have them, as a whole, make the shape of a heart.

I can currently contain them within a square by making sure that the random x and y positions are within that size, but i am unsure if i can contain them within a curved shape.

If anyone has any ideas how then that would be great.

Cheers,

Leo

Hit Test Any Object On Stage
If i am preforming a hit test on a object can the hit test be configured to do something if the object hits any other object on stage?

if (MC.hitTestObject(Object)){

do something

}

I've tried using * as well that don't work had search around can't find anything can anyone help?

Reference Object And Stage
Hi all,

its me again with simple questions if you don't mind answering.

- i have 1 fla and 1 class file.

- inside fla, i' put one instance called "main" on the stage. And i put this code in frame 1:


ActionScript Code:
var obj:StageHandler = new StageHandler(main);

- inside class file, i put this code:


ActionScript Code:
package  {
   
    import flash.display.MovieClip;
    import flash.display.Stage;
   
    public class StageHandler {
       
        var _stage;
        var _main;
       
        public function StageHandler(main_obj) {
            _stage = main_obj.stage;
            _main  = main_obj;
           
            trace(_stage.stageHeight); // output: 400
            trace(_main.height);       // output: 200
        }
    }
}

it works perfectly. However i'm still confused with the as3 concept. in this class file, i successfully trace stage's height and main's height.

but, if i change the code in fla to:


ActionScript Code:
var obj:StageHandler = new StageHandler(stage);

and in class file to:

ActionScript Code:
package  {
   
    import flash.display.MovieClip;
    import flash.display.Stage;
   
    public class StageHandler {
       
        var _stage;
        var _main;
       
        public function StageHandler(thisStage) {
            _stage = thisStage;
            _main  = thisStage.main;
           
            trace(_stage.stageHeight); 
            trace(_main.height); //1120: Access of undefined property main.
        }
    }
}

i cannot trace any main's properties. why is that? isn't "main" inside stage?

How do i access "main" via _stage?



Thankyou all.

attached is the source.

Moving An Object In The Stage
Any help on this would be greatly appreciated. I have an object that is serving as a background for a flash website. The background object (a table) moves and rotates around when clicked, exposing different parts of the table on the stage when the user clicks.
Here is as close an example as I can find:
http://www.vermeersch.ca/

My problem is when i want to transition between two points on the table, the table has to rotate and move.. and by just using a motion tween between the two points results in the table rotating off the stage for a few frames (thus exposing the background and making it look really cheezy). I was trying my hand at using motion guides, but can't do it with any accuracy.

So, my question is: Is there a way to guide an object as it rotates and moves so that it doesn't move off screen? (there is plenty of room on the table if i can just guide its path through the 2 second transition). Thanks for any support.

Animating A Stage Object
I want to cause objects to move off stage after a button is pressed. I've looked at different as3 code examples but can't get them to work. My goal is to have several objects move smoothly off stage in the up, left, right, and down directions after button is pressed. Thanks

Object Relationships On The Stage
Alrighty i'm trying to expand my understanding of actionscript and am trying to figure out effects like the navigation at www.kurtnoble.com . I'm trying to make, for practice, four squares like their navigation where one expands and the others shrink to allow room for it. This can be used to do a lot of different things, i know, but i'm just using this to learn it.

I know in the nav on that site it's all relative to the left, and when you click a box, it scales to a certain size, changes the x coordinates of the other boxes, and has an easing equation with bounce when it moves them. I'm just not very good at math and always have trouble with stuff like this. Has anyone else done something similar who can give me some tips? Thanks.:-)

Alan

Accessing An Object On Stage
Hi,

I created an object, and saved it as a symbol with the export to actionscript checked. It's a horizontal line that I want to be able to move to a location on the page using actionscript.

How can I access the symbols that I create using scripts?

Thank you very much,
Lior

Stage Follow Object?
I'm having a hard time finding what I'm looking for and it could be because I'm searching the wrong terms. I'm making a timeline where I have a movie clip move along a motion guide. I would like to make it so that the object still follows along the path and instead of moving off the screen, have it be centered on the screen while the camera/screen follows along. Am I making any sense? Any help or guidance would be greatly appreciated.

Thanks!

Duke

Know If Object Is Stage Or Movieclip
I'm trying to make a function for centering movieclips to other movieclips, or centering the movieclips to the stage. My problem is movieclips use _width & _height and the stage uses width & height without the underscore.

I'm passing the 2 objects as parameters to the function "center" (reference for centering, and the object I want to center), but I don't know how to make the function know if I'm passing a movieclip or the stage.

I tried typeof which returns [object object]....

any ideas?

TIA!

Chase Object Around Stage
Hey guys,

I'm just learning Flash and AS3 so apologies if this is a really basic question. I'm trying to get the mouse to 'chase' (repel) an object (in this case a movie clip) around the stage without the object being able to leave the stage. At some point I would like to have a number of movie clips on the stage but for now one will do!

Anyone got any ideas on how to do this?

Thanks in advance.

Object Relationships On The Stage
Alrighty i'm trying to expand my understanding of actionscript and am trying to figure out effects like the navigation at www.kurtnoble.com . I'm trying to make, for practice, four squares like their navigation where one expands and the others shrink to allow room for it. This can be used to do a lot of different things, i know, but i'm just using this to learn it.

I know in the nav on that site it's all relative to the left, and when you click a box, it scales to a certain size, changes the x coordinates of the other boxes, and has an easing equation with bounce when it moves them. I'm just not very good at math and always have trouble with stuff like this. Has anyone else done something similar who can give me some tips? Thanks.:-)

Alan

Fix Object Inside Stage
ActionScript Code:
stop();
 
Stage.scaleMode = "noscale";
Stage.align = "B";
Stage.addListener({onResize:reposition});
 
function reposition() {
        var mc = _root.mainContent_mc;
        var newX = Math.floor((Stage.width - mc._width) / 2);
        var newY = Math.floor((Stage.height - mc._height) / 2);
        mc._x = newX;
        mc._y = newY;
};
 
function reposition() {
        var mc = _root.full;
        full._width = Stage.width;
        full._height = Stage.height;
        mc._x = newX;
        mc._y = newY;
};
 
reposition();


I need mainContent_mc to fix to bottom center, and full to fix to screen.

Currently the result is:

mainContent_mc fixes to bottom center, but full hangs off the bottom right edge.

Is there a way to do this?

If I change it to Stage.align = "TL"; it will reverse the problem...

Thanks.

Stage Object Scaling
Hey.

Anyone have any insight into how one can scale elements of the movie without scaling others.

Like having some elements be full screen (graphics) and other elements stay with a specified pixel size (fonts).

It is possible, I've seen it. Anyone wanna share?

thanks. :]

Sliding And Object Back And Forth Across The Stage...
I want to make an object slide back and forth very slowly across the stage... How can I do that?

I know I will be incrementing the _x value up to a certain point, then stop and start decrementing _x and looping through it continuosly.

I'm just not quite sure how to acheive this effect with ActionScript...

Thanks!

Preloader That Moves Object Across Stage
I am making a sight for a mechanic and wanted to have a preloader that had a small image of a tow truck that moved from the left side(0%) of the stage to the right (100%), you get the idea. How do I get the percentage to move the clip across the stage?

this is my biggest genius attempt so far, but it does'nt work:

perc = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100);
xperc = perc/780;
if (perc == 100) {
_root.gotoAndPlay(2);
} else {
nperc = perc;
tow._x =tow._x+= xperc;
nperc._x =tow._x;
}

any help would be much appreciated

Stage Object? Centering Movie
I just saw this featured link on the site that reminded me of something I've been wondering about in Flash. This is the link:
http://www.curvemusic.ca/
And I have seen other sites that do the same thing:
http://www.kurtnoble.com/
http://www.bukwild.com/
http://www.fabrislane.co.uk/launch.html

Basically, if you notice, the main part of the site is centered on the screen. But the entire page (including the background) is part of the flash file. If you resize your window it doesn't scale the movie, it just reveals more of the background and re-centers the content. Is this done using the stage object in actionscript? Can anyone provide an example or point me to a tutorial on how this is done?

Using Stage Object To Fill Background
Can someone point me to a tutorial or something that would teach me to do the following: I want a backround image to resize and always fill the entire browser screen while the main content stays centered in the middle of the screen and doesn't scale. An example FLA would be awesome!

I know I've run across this effect on the site before that involved using the stage object and object listener but I didn't need to do anything with it at the time and now I can't find it again...

As always, many thanks in advance!

Stage Scaling And Object Align
im lookin for a decent tutorial or something about how to get this scale/resize effect.

http://www.gskinner.com/site2_5/

http://www.ego7.net/

Detect Where A Moveable Object Is On Stage?
Hi guys, i have a moveable man in a game. I was wondering how i would detect where he was on the stage. I have tried using hittest with an invisible object but i can't get it to work.

Any ideas?

p.s the stage is split into a grid of 4, i want to detect which part of the grid he is in.

Thanks alot, Dave.

Background Layout Using Stage Object
im going to make my site size around 785x415 since thats what i gather is the right rate and im going to be using jpgs so im not going to use 100%.

but behind this, i want to have the screen completely filled with a constant background (lines, whatever). i read in this thread here in FlashKit that
that i need to look for the stage object if i want to have a background image that fills the screen.
is this the best way forward (using MX2004) ?

Bringing An Object To The Stage At A Set Location?
Hey;

I need for flash to put an object from the library at a set location when another object (which is falling) hits the ground. Basically I need to know if there is a way to bring an object in, at a certain place from a command line placed in another object in actionscript.???

Accessing An Object On The Stage From Within A Class?
It's me again

Naah, this is a simple one. I think. If I've created a label on the stage just by sticking the code below on the first frame of the .fla:


Code:
var imgLabel:Label = new Label();
imgLabel.text = "Hello World";
imgLabel.x = 100;
imgLabel.y = 100;
stage.addChild(imgLabel);
and right below that I'm creating an instance of an image-scrolly class (that extends MovieClip) with:

Code:
var mySlideShow = new FeaturedPanel("slideshow_name");
stage.addChild(mySlideShow);
... then how the heck do you get at the label, from the image scroller thing?

I've got a function in the FeaturedPanel class that's fired when you click an image within it, with just "imgLabel.text = imgCaption;" - and it keeps telling me "Access of undefined property imgLabel."

Nuh?

How To Check If An Object Exist On Stage.
once and for all someone give me an answer, for AS3.

people thi is how you rock:


ActionScript Code:
if (neslide.map) {
                //var maptween:Map = new Map(this,origwidth,origheight);
        getChildByName("neslide").nextFrame();
        }

not like this:

ActionScript Code:
//if (ApplicationDomain.currentDomain.hasDefinition(getChildByName("neslide").map)) {
                //var maptween:Map = new Map(this,origwidth,origheight);
        getChildByName("neslide").nextFrame();
        //}

How Can Class Object Add Itself To The Stage/root?
Hi there,

I'm writing a class that will act as built-in dropdown menu, but a lot more simplified. I found that when i define my dropdown by
Code:
var myDD:Dropdown = new Dropdown();
I have to add it to the stage by
Code:
addChild(myDD);
. These lines of code go to the 1st frame in the timeline, where also my class is imported.

But is it possible to make that class to add itself to stage? i believe it is, but somewhy I cannot access the stage. Tried to import that DisplayObject but lack of experience did not work well with it. So here I am, asking for your help.

Thanks in advance!
All the best!

Keeping An Object Coving The Stage
Any help on this would be greatly appreciated. I have an object that is serving as a background for a flash website. The background object (a table) moves and rotates around when clicked, exposing different parts of the table on the stage when the user clicks.
Here is the site so far:
http://www.personal.psu.edu/jwc5062/

My problem is when i want to transition between two points on the table, the table has to rotate and move.. and by just using a motion tween between the two points results in the table rotating off the stage for a few frames (thus exposing the background and making it look really cheezy). I was trying my hand at using motion guides, but can't do it with any accuracy.

So, my question is: Is there a way to guide an object as it rotates and moves so that it doesn't move off screen? (there is plenty of room on the table if i can just guide its path through the 2 second transition). Thanks for any support.

Chk If Stage.focus Is A TextField Object
I have a stage with many objects.

At a certain pt of time. if i need to know if the current stage.focus is focusing on a TextField. how do i check?

as in I do not want to write sth like
if(stage.focus == TextField1)...

bcoz there are variable number of text fields. I want sth like

if(stage.focus is a type of textfield)

how do i go abt it? thanks!

Limit Object To Stage Boundary
How do I limit an object, so when I use the keyboard controls to move the object it won’t go over the stage boundaries?

I have used the Stage.width and Stage.height classes to stop the movie clip at the stage edges, but the movie clip only seems to stop at the registration point of the object. This means that whatever the registration point is, it stops at that point.

I would like the object to stop exactly at the edges of the stage. Any ideas?

Keeping An Object Only On The Stage And Only Controling It There...?
If you check out this http://www.zen57616.zen.co.uk/excession/ (its a demo, yes I know frames are bad etc)...I have a little sliding bar which moves with the mouse on the menu, however if you click off the movie area on any part of the website it will follow the mouse presses. This could be very anoying for people so is there any way to make sure it is only controlable on the stage area?



Sorry if thats badly explained.

Button Click Object Appear On Stage
how can i able to click on the button and the object will appear onto the stage? Can anyone show me or direct me to any tutorial which can guide me?

thanks!

Aligning Object To Stage With Actionscript
I have a dynamic text box pulling info from an xml file. After the text loads the box resizes with autoSize.
Any ideas on how i can get the box to align to the center of the stage after that with actionscript??
I've looked around and can't seem to find a solid yes or no anywhere.
Or if that's impossible, is there any way to vertically align the text, which would negate the need for the resize and align.

Thanks

Constructer Arguments Stage Object
Hi Everyone

I have a game I’m currently working on and I’ve got some library movie clips with actionscript attached, the constructors for the actionscript files have several arguments obviously when I instantiate the movieclip via code with the new() statement I simply pass those arguments in no problem, but how do I pass in the arguments when I drag an instance to the stage from within flash. All I currently get is an error message “incorrect number of arguments”.
Any help greatly appreciated its driving me nuts not knowing how to do this

Centering A Nested Object To The Stage.
hoy hoy,
I have a picture of a mine which is nested within an object, nested within another obect. Now what i want it that on the keypress of shift, i creates the mine image at the same postion of the tank.

The issue is that the main obect that is nesting the mine moves, thus not creating at the the center, rather on that postion of the object.

here are how my images go by instance names;
1. Tank Stays in the center
//////
/////
1. Land (moves) -- 2b. map -- 3b. All objects that hitTest
|
2a. Objects
|
3b. All the objects that dont get hit(in here is my mine.)

Dynamically Add Video Object On Stage
Hello there.

I've got into a problem when working with the Video object in Flash 7.
I created a MovieClip with a video instance inside, named "video".
This MovieClip is associated with an action script class called "FlashVideo",
witch creates a NetConnection and a NetStream object to play a FLV video.

This is the class (quite simple):


ActionScript Code:
class FlashVideo {     public var video:Video; // Refer to the video instance inside the MovieClip     public function FlashVideo() {         var nc = new NetConnection();         nc.connect( null );         var ns = new NetStream( nc );         this.video.attachVideo( ns );         ns.play("http://www.helpexamples.com/flash/video/water.flv");    }}


Now I add an instance of the MovieClip on my stage, but the video doesn't play...
Any hints about this?

Thanks,
Ian L.

Stage = Object Null Reference
I want to make a scrollbar class, just for pratice, but have one problem.
The scrollbar is already draw in a movieclip, I am doing the class and using the following code:


stage.addEventListener(MouseEvent.MOUSE_UP,soltar)

or

root.addEventListener(MouseEvent.MOUSE_UP,soltar)

They both return same error:


TypeError: Error #1009: Cannot access a property or method of a null object reference.
at scrooler$iinit()


Someone knows why?

Create An Object When A Certain Movieclip Is On Stage
Hello all,

Currently, I have a few movieclips on stage. These movieclips are animated, and will show up on stage depending on the animation. For example, one could show up starting on frame 5, and the next coudl show up starting on frame 8.

These movieclips will be passed into my classes when I create a new object. As I am putting all of my code in a document class, the code will get executed once the movie finishes loading. In this case, any objects created that are passed the movieclips which are not yet on stage will toss a nasty error.

I am thinking about using ADDED_TO_STAGE to listen when these objects are on stage, and then create the objects.

In that case, how would i be able to listen for that event? Would i have to attach the listener to the movieclip i m listening for?

Cheers

Accessing Object On Stage From Class
Hi,
I'm creating a game and I want to test if an object (created by a class)
hit the main character (created on the stage)
I tried referencing the main character in the class (parent.main_character),
but it states that it doesn't recognize that instance name.

How can I reference an object on the main stage through a class?

Thanks.

[beginner] Reference Object And Stage
Hi all,

its me again with simple questions if you don't mind answering.

- i have 1 fla and 1 class file.

- inside fla, i' put one instance called "main" on the stage. And i put this code in frame 1:


ActionScript Code:
var obj:StageHandler = new StageHandler(main);


- inside class file, i put this code:


ActionScript Code:
package  {        import flash.display.MovieClip;    import flash.display.Stage;        public class StageHandler {                var _stage;        var _main;                public function StageHandler(main_obj) {            _stage = main_obj.stage;            _main  = main_obj;                        trace(_stage.stageHeight); // output: 400             trace(_main.height);       // output: 200        }    }}


it works perfectly. However i'm still confused with the as3 concept. in this class file, i successfully trace stage's height and main's height.

but, if i change the code in fla to:


ActionScript Code:
var obj:StageHandler = new StageHandler(stage);


and in class file to:

ActionScript Code:
package  {        import flash.display.MovieClip;    import flash.display.Stage;        public class StageHandler {                var _stage;        var _main;                public function StageHandler(thisStage) {            _stage = thisStage;            _main  = thisStage.main;                        trace(_stage.stageHeight);              trace(_main.height); //1120: Access of undefined property main.        }    }}


i cannot trace any main's properties. why is that? isn't "main" inside stage?

How do i access "main" via _stage?



Thankyou all.

attached is the source.

Stage Is Null Object In Fullscreen?
Hi,

Ive got an application working that displays pictures from an XML that updates every 10 seconds or so - well, works fine in a browser, but it breaks when going fullscreen mode. The application is meant to be run in full screen mode, but this prevents it from being done so.

I use MovieClips as my containers for these pictures as I animate them in and out, and added them to the display using "stage.addChild(mcName)". However, with MovieClips using the timeline, I tried just "addChild(mcName)" for the movie clips. That didn't work either.

I have tried using Senocular's TopLevel actionscript to help with this, as well as his Tip of the Day, but I couldn't get it to work, although that sounded like the ideal solution?

The bit of code that seems to break when going fullscreen is when it first access the stages properties through a custom function to check for a child of a particular name:


Code:
function childSearch(childName:String):Boolean {
var counter:Number=0;
for (var i:int = 0; i < stage.numChildren; i++) {
if (stage.getChildAt(i).name==childName) {
counter++;
}
}
if (counter==1) {
return true;
}
else {
return false;
}
}
There is probably a much neater/efficient way to write it, but I'm still new to programming in general...

It will break at "stage.getChildAt(i)...." saying "TypeError: Error #1009: Cannot access a property or method of a null object reference."

I had another function which involved another "stage.getChildAt(....." statement, which I removed, and the next error I got was the same thing, so it's got something to do with this (I can't seem to get trace's out of a flash debugger in a web browser). I do need this code because I depend on the names/index numbers of stage.children to remove them and appropriate other children.

I'm racking my head over this, I've read numerous other people having similar problems (albeit different applications?), and I've tried other things from this forum including:

http://www.kirupa.com/forum/showthread.php?t=259875
http://www.kirupa.com/forum/showthread.php?t=271955


If it works in non-fullscreen mode, and that the stage returns a list of display objects when traced non-fullscreen mode, how can everything be nulled when it goes to fullscreen? I think I'm at the end of my tether .... and running out of clever things to google!

Odd Trace On Object Stage Position
Hi,

I noticed odd trace that wonder whether someone can explain.

I've got the following code in an ENTER_FRAME event. It's used to move an object.


Code:
_vx +=0.2;
_vy +=0.2;

x+=_vx;
y+=_vy;

trace("_vx: " + _vx);
trace("x: " + x);
trace("----------");
The trace for the first 5 frames looks like this:


Code:
_vx: 0
x: 275
----------
_vx: 0.2
x: 275.2
----------
_vx: 0.4
x: 275.55
----------
_vx: 0.6000000000000001
x: 276.15
----------
_vx: 0.8
x: 276.95
Obviously, 275.2 + 0.4 doesn't equal 275.55.

Does anyone know the reason for this?

Thanks!
Dandylion13

Draggable Object Within Stage Dimensions
I've got a simple draggable box, but when it's dragged about the stage, I don't want it to "disappear" if part of it is beyond the boundaries of the stage (in my case 780x412).  Is there any way to stop a draggable object from "vanishing" beyond the border?

Thanks!

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