AS3 :: Good Library That Makes Objects Detection In It?
Aug 10, 2011Does anyone knows a good library that makes objects detection in AS3?
Im looking for something similar to detect an hand, like kinectic.
Does anyone knows a good library that makes objects detection in AS3?
Im looking for something similar to detect an hand, like kinectic.
I need a 3D library that works well with Flex... NOT Flex Builder - the free Flex SDK.
View 1 RepliesPoint me to a robust and well documented Date library for AS3. Specifically, I'd like one that works (at least in principal) like the Java date formatter, so that you can pass in a string of a specific type and get back a date object that can then be easily translated to an alternate timezone, etc. Working with the native Date object is an incredible PITA for when one needs to do things like this... I'm hoping I won't have to re-invent this wheel from scratch.
View 2 RepliesI have a potential project where a 3D object will need to be generated based on user input.
Is there a good 3D drawing library available for ActionScript?
I have Object "A" that moves around and collides with other objects. There are hundreds of other different objects it can collide with. The only way (I found) to test for collision is to loop through every other object. That seems rather inefficient considering I don't even know how many objects exists. Other objects are constantly created and deleted. So this loop would be rather complicated.Is there a way for object A to receive what other object it collided with so that I can then do some code on that other object. Any way to avoid looping? I later need to find out how to detect what objects are near (within x pixels or so) of object A to decide with which one to interact. Maybe that could also be used now to limit the test of collision? Or maybe it gives someone an idea of what to try?
View 4 Replies[Code]...
I have a serious problem with Action Script. I'm about to code a new Jump&Run game with a simple gravitation Engine. And this is where I got my problem I can not solve! When moving the player through the levels, I want to move the layers instead of him. So the player stays somehow where he is but the enemies, ground, items ... move around - as in most of these games. The gravitation is intendet to affect every item/enemy (by ENTER_FRAME) and moves every object downwards until it hits the ground.
The problem is, objects of different Layers somehow don't get the right hitTest information. So when having two objects - the first on the same layer as the ground, moving both, everything is fine. But as soon as I put the object into a separate container like "itemsContainer:MovieClip" and I move that, the object doesn't get the right result for hitTestPoints. (Maybe it has something to do with localToGlobal??)
[Code]...
I am creating a scheduling application that shows projects (wrapped within a canvas) on a 2 week calendar timeline.If the user decides to move a project over by a day, i need to check and see if the moving project would then overlap with any other existing projects. If it does, one of the two projects would need to move down the screen along the y axis until the two projects no longer overlap.I've created a function that loops through a repeater item which is used to create the projects... the end result of this function is an arrayCollection that holds:
0. the id number within the repeater
1. the project title
2. x coordinate
3. y coordinate
4. the width of the project
5. the height of the project
I have also created a function that takes the two objects within the array collection and determines if they're overlapping.I can not, however, figure out a working loop that goes through the array collection, compares each item within it, checks to see if they overlap, moves the project if they do overlap, and then continues onto the next project.
Also, I need to make sure that moving one project will not make it overlap with another.I ended up having to reset each elements y value to 0 each time any project is moved and then re-evaluating whether or not they collide.
I want to detect collision for several different objects, but want to keep the code as short as possible. whether I can use an array to hold the different movieclips and then detect collision with the entire array, or if I have to create a class and do it that way.
View 1 RepliesI'm making (or rather trying to make) a collision detection demonstration for my Media Studies coursework using a game as an example. However, I use FOR and duplicateMovieClip to create both a) the enemies and b) the bullets. how to register collisions with these objects.
Also, if anyone has any tips for using an array instead of the endlessly repeated "else if (x<num) {" lines, that'd be great to know!
For some reason I can't upload the ZIP file with the Flash in it on this Mac, but I'll upload it back on my own PC soonish. I'm not letting all this stuff I've typed out go to waste!
Looking for a programming book that is in tutorial approach. Example this chapter teaches you how to do a login form. In the second chapter it teaches you how to integrate the login for to another app.Basically I'm looking for a book that teaches you real working application rather than abstract ideas. Programming language I have in mind is Adobe Air/Flex, Visual Basic. Functions I have in mind should at least cover Drag and Drops, Integration to a web form (form entry) and customizable interfaces.The languages i had in mind isn't fix. If you know a programming platform that has little code or easy to learn but still be able to develop a cool application.
View 3 Repliesa little while ago I saw something on this website:[URL]...I decided I wanted to recreate something like it.
They're using javascript, I'm using ActionScript, anyway.I'm trying to create collision detection for an array of movieclips inside a for loop. Right now I have it that upon holding down the mouse, the same movie clip will fall onto a ground object (and bounce up occasionally,) I'm trying to make it to so each ball could stand on top of each other. I've used collision detection before for separate objects, but never for instances of the same object inside a for loop.
I'm running a HitTestPoint to detect when two of my mc's collide, but I don't want them to be able to go right through each other. Someone suggested I find the x,y coords of the moving object when the collision occurs, then update that mc's coords to this x,y each time a collision occurs. I've been Googling but came up empty. Below is my code
private function __checkHit($evt:Event):void {
if (this.coin_mc.hitTestObject(target)) {
if (!hitting) {[code].....
a way, to manage a multiple collision detection with pixel level detection, for objects, not necessarily circles, irregular objects.
View 5 Replieshow to work out the direction of the mouse on stage and say from this:
"if the mouse goes from the left to right (visa-versa) once, add score +1" and "if the mouse speed which is player controlled - slows down - to then display an error graphic"
Is there any as3 based source code that accomplishes pitch detection or beat detection accurately? Doesn't have to be both, if you know of at least one of those,
View 4 RepliesIs there a way to access or iterate through a list of all objects exported to ActionScript from the Flash IDE? I'm looking to save myself some hassle by just iterating through selected MCs and processing them in a certain way, without knowing their names.
View 5 RepliesI was trying to set up library movieclips to extend an abstract class so they could share common methods, but can't, as all library movieclip objects have to extend MovieClip.My second thought was then to at least insure that all of these objects - which each need their own class now -- implement the same functions -- so I have the following
Code:
public class MyClass extends MovieClip implements MyInterface and then in MyClass I have a function that implements someFunction in MyInterface.I keep getting error 1044: Interface method someFunction in namespace MyInterface not implemented by class MyClass.
does anyone know if it's possible to use variables to call objects from your library onto stage like this:I have an object in my library called Level01 as is it's linkage
Actionscript Code:
var MyMap:String = "Level01";addEventListener(Event.ENTER_FRAME,LoadMap);function LoadMap(event:Event) { var myLVL:MovieClip = new MyMap();// how do you use the variable
[code].....
I have a question about a library one would create inside a Flash document. I have a bunch of pieces of graphics objects inside a library for a FLA file. I then drag these pieces onto stage to build a more complex object. I then select all those pieces and group them and convert this new object into a movie clip. From there I move it into the library for that FLA file. I notice there is both a graphic for this object plus the movie clip for that object. To me these are 2 separate objects. So when I delete the graphic of the object, it also deletes the movie clip I created of the object.
View 5 RepliesI want to have a canvas with some "floating" property. Basically when I add child to it, the child should float at the top. When I add the second child, it should float above the previous one. For example the canvas width is 100, and I have two VideoDisplay with width 100 and height 75.
canvas.addChild(video0);
// Or canvas.addChildAt(video0, 0);
// video0 should be at x=0 and y=0
canvas.addChild(video1);
// Or canvas.addChildAt(video1, 1);
// video1 should be at x=0 and y=0, while video0 x=0 and y=75
I've been heavily mired in 3D recently, and decided to pay a visit back to good ole Flash.
My problem is this. I'm extending the MovieClipLoader class to create a Preloader Class (yes I'm sure it's been done fifty billion times but). I'm trying to refer to a symbol in a common library, the preloader symbol itself.
Inside my class I have this
Code:
function onLoadStart(target){
baseClip.attachMovie("preloaderTemplate_mc", "preloader_mc", 500, {_x:0, _y:20, _xscale:75, _yscale:75});
baseClip.preloader_mc.gotoAndPlay(1);
}
baseClip is a MovieClip object which takes a MovieClip passed to the constructor of the class in the FLA. (say a container movieclip which has a target clip preloaded into it) The class does load the target clip into the baseClip, but doesn't show the preloader, which makes me think I'm not referring to it properly.
I have a fairly complex symbol with a few moving parts, and I want to be able to access a label on the symbol to add text. When i just load the clip
PHP Code:
var x = new fm_Input(); // instanc in libraryaddChild(x);
it shows the default text.
[code].....
I'm currently working on a game. I'm breaking down each piece of the game into individual classes and movieclips. The intro begins by going to the main menu which is a MC in my fla library. This is called through the document class. then all actions the main menu MC performs are commanded through the MainMenu class. When starting the actual game, MainMenu calls a function from the document class, after it is removed from the stage, that puts an empty movieclip called Level on the stage.
View 2 RepliesFor whole damn month I spend writing script for a actionscript application on Flash CS5. I had my Window$ Crashed!! and when I tried opening the flash file, it says "error opening File!". my swf is sized 0 KB, I even bought a decompiler, Trillix Flash Decompiler and tried to decompile the swf, it says swf corrupt. Now all I have is some classes and external swfs. Those thousands of as3 codes inside the fla file and the library objects are all gone.
View 2 Replieshow do I load library objects by string list using Flash and AS3? I need to understand string lists, arrays, and sprites better.
WHAT I WANT TO DO Load enemies to stage using a string list "Orange ball, red ball, green ball etc"
EXPLANATION The tutorials I've been given are too basic, or they are incomplete examples that don't explain the classes being used.
Trace statements are not showing me how I'm accessing the name or class of an object.
[Code]...
I'm working on a simple image processor in AS3 and as usual I almost had it finished when an annoying little problem appeared. I want to open an image using a dialog box, and once the image is open I want the "selectBtn" (which is in my Library) to disappear. However when I try the code below I get a: "Error #1009: Cannot access a property or method of a null object reference". I'm sure it's something simple but I just can't figure it out!
// declare variables
var image:Bitmap;
var loader:Loader = new Loader();
[code]....
I want all my libray object that are classes to load on frame 2 except for one which is the preloader class I want this to load on frame one.
I can go into my publish setting and set frame two for all the classes to load, but then my preloader class isn't available until frame two.
can I write a line of code that will make the preloader class available on frame one instead?
I am using CS3. And this is all about understanding Identifier and Class from the symbol property under Linkage.
I read some articles where all are using class instead of attachMovie() method on TimeLine.
Its confusing to me and couldn't able to make it work.
The article I read says that attachMovie() method will be in class file.
I have a class. Let's say it's a video player and I have a library of art for it. So I now want to load the swf of this video player into another project and type it as videoPlayer (class file).
The problem with this is the class starts looking in the parents library for the linked art. A simple fix is copy over all the objects with a linkage id from the original video player fla. But I would rather not to reduce file size.
I am a flash developer and I've got some experience in games and applications, but there is a problem that always comes back and that I solve in sometimes discussing manners, but I've decided to find the "good way" of doing it.Ok, here's my problem :I have a game where I set the publish setting to export in Frame 10. Most of the graphic content is already on the stage on the frame 10, but there are a few MovieClips that I add and remove using AS from the stage (a "How To Play" movieclip, for example).All the movieclips I want to use with AS are set to export in Frame 10 and are used in different custom classes.Everything works just fine if I set everything to export on Frame 1 and all my graphics are on frame 10, but not if I export in any other frame than 1.The workaround I've found is to create an instance of the objects I want to load outside of the stage, but I hate that way of doing things :I get no error if I create an instance of my movieclips through AS, but they won't show up when added to the display list (yes, I know how to use addChild )
View 5 Replies