Read Multiple AMF Objects?
Sep 28, 2010I'm trying to write a very plain game client to get some practice with Actionscript 3 and the Flex Framework.[code]...
View 1 RepliesI'm trying to write a very plain game client to get some practice with Actionscript 3 and the Flex Framework.[code]...
View 1 Repliesim creating a small drag and drop game in AS3-
I have 4 objects and 4 targets,
I want to be able to drag any of the 4 objects onto any of the targets, right now all I can manage is to allow each object drop onto one specific target only.
I thought by calling all my target names by the same instance name eg target_mc that would work but only one target will ever work.
I am working on a native extension for Flash. I am going to invoke my native methods from Flash and pass Dictionary objects where those objects have various data members of various data types. These property types are dynamic and might not be known at compile time.So I found that we have a method called FREGetObjectProperty that says it can return the value given the property name. But in this case since we dont know the property name since it is dynamic, how to extract the property names and values from the Dictionary objects?
View 2 Repliesi am working on a native extension for Flash. I am going to invoke my native methods from Flash and pass Dictionary objects where those objects have various data members of various data types. These property types are dynamic and might not be known at compile time.
So I found that we have a method called FREGetObjectProperty that says it can return the value given the property name. But in this case since we dont know the property name since it is dynamic, how to extract the property names and values from the Dictionary objects?
Is it possible with actionscript to create objects then when sent through XMLsockets can be read by Java's ObjectInputSteam?
View 1 RepliesI currently have an over, out and click event for 8 different objects. The over and out events are identical for each (tween expands object and then shrinks it back for the out state).I have previously asked for an easy way to declare those events, and now I was looking for an easier way to handle them.
Here's my code:
//-----------GARAGE
function growGarage(e:MouseEvent):void{
scaleTweenX = new Tween(map_garage, "scaleX", Elastic.easeOut, 0.648, 1, 0.5, true);
[code]....
I've tried using a single function and then using "this" as the object of the tween but that expanded the entire stage.
What's the best way to say:
if(this.object in same array as that.object)
with multiple arrays containing multiple objects?
I have a class which at the moment is quite messy/repetitive:
public class AvFramework extends Object
{
// vars
[code].....
Writing a couple of vars to a txt file is relatively easy.I store them as .sql (sort of) layout, so that i can import them into mysql later.But obvious this is not necessary..
The thing i am struggling is how do i read these vars back into flash[code]...
Im trying to make my TextArea read multiple lines to a string
Hello
my name
is Bryan
in the textArea
outputs to HellomynameisBryan
how can I get it to output with line breaks?
I would like to see a line of a text file on the frame that I want (and view it in a dynamic text). This is my text file:
Foo
Candy
Bar
Dog
This is my code in the first frame:
var myTextLoader:URLLoader = new URLLoader();
firstLine.wordWrap=true;
firstLine.autoSize=TextFieldAutoSize.LEFT;
myTextLoader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void {
[Code] .....
With this I can see "Foo" in the first frame. How could I see "Candy"? a second frame. Is it repeated all this code again? Is there any way to just invoke the Lines array:
Array = e.target.data.split (/ n /)
And obtain the desired Item?
I have need to simultaneously move a slider (called "shadeGrabber") movie clip and a mask. I'd like to do this by dragging the slider and seeing the mask move with it.
The example movie clip on the left (called "PICTURE_WIPE") is what I'm going for, but interactive instead. I'm working in the movie clip on the right (called "PICTURE_WIPE copy 2")
Here's my code, for quick reference (found on the "AS" in the "PICTURE_WIPE copy 2" movie clip:
[Code]....
I am building a scrolling image bar, so I've created code that works perfect on one object. However, I need this code to apply to multiple objects at once so that they will move left and right and resize independently from each other (to give this sort of 3d revolving look). Other boxes will be to left and right of the current black box. Code is below as well as link.
Code:
function mousetracker(object){
boxstartx=object._x;
boxstartwidth=object._width;
[code]....
I am creating a small game for a project im doing it is only ten levels long but I wish to include feature such as saving etc. I have one some research on Shared Objects and it seems to be the best method. The idea I wish to execute is to have at the end of a level after reaching the levels goal have a piece of code that runs and saves that the next level has been unlocked. This seems relatively simple. However i have done things awkwardly i think, instead of creating the whole game within a single fla. each level is a seperate file, eg. level1.fla, level2.fla etc. Is it possible to use the same shared object across multiple .fla's?
View 3 RepliesIm trying to make a small game. Could someone take a look at the CS4 and CS3 fla files attached and tell me how to make the game reset when the red circle touches the block boxes.
View 7 RepliesI hv make a movieclip it's linkage name is thumbmc,I make its duplicate instances 10 times and load external thumbnail jpg's,I give names to these instances to th0... th9, all events and effects working fine but i m opening a large image while clicking on any thumb..the problem is.. i want when i click on any thumb then all thumbs will be fly and goes out of screen,, but when i try to tween then it shows error.. th0 object not found.......
code is like this
// Making thumbs by this code
for( var i:Number=0;i<9;i++ )[code].....
I would like to know if I can get an error or some other problems when I try to tween several objects like this and using an onComplete-property:
TweenLite.to(restartBtn, .5, {alpha:0});
TweenLite.to(mainMenuBtn, .5, {alpha:0, onComplete:quitFadeIn});
What I want to do is fade out several objects at once and when they finished a special function gets called. Are there other possibilities when using tweenlite available or do I have to use timelinelite?
I have many black boxes fallling down and i want the game to reset when the black boxes touch my red circle. I used this code for my boxes:
ActionScript Code:
this.createEmptyMovieClip("canvas_mc",10);
myInterval = setInterval(addbox1,500);
function addbox1() {
[Code].....
I call a function with some saved animation code where I just need the selected (mouse clicked) object to animate. On the first occasion when you click the object, that object animates just fine. The problem is, if you click another object, that new object and the prior one(s) you clicked on all animate as well.[code]
View 0 RepliesHow to set hit test for multiple objects..?
View 3 RepliesI just wanted to know if there is a way to startdrag() multiple objects at once. I don't want to use the mousemove/enterframe + x And y offset method of dragging, but just use the built-in startdrag method. Making startdrag function multiple times with different objects didn't work.
View 3 Replieslets say i have 3 MovieClips: Tank1, Tank2 and Tank3. And i want to set them hittest or other setting. Its not wery dificult to do that, but i dont want to write the code if i create Tank4... I want my code to get all the tanks with a number, ant set them a setting, because there may be hundreds of tanks... I know it's posible on AS2, but i don't know about AS3.
View 1 RepliesI would like to know if I can get an error or some other problems when I try to tween several objects like this and using an onComplete-property:
[Code]...
I have a bullet movieclip and it moves. I've put a hitTest on its onEnterFrame so that it checks if it hits its target, whose instance name is mmbug and the target flies around. That's easy and works cool.[URL]there's only one wasp present at a time and it works)Now what I want to do is duplicate the wasps so there are more flying around at one time, but how would I do the hitTest on the bullet then, because you have to specify it an exact instance name. If I make all the wasps have the same instance names it doesn't work.So obviously I'd have to give them names of mmbug1, mmbug2, mmbug3 etc. But how would I check on the hitTest if it hits any of them, since you have to put in an exact instance name in the hitTest?
View 5 RepliesI hv make a movieclip it's linkage name is thumbmc, I make its duplicate instances 10 times and load external thumbnail jpg's,I give names to these instances to th0... th9, all events and effects working fine but i m opening a large image while clicking on any thumb..the problem is.. i want when i click on any thumb then all thumbs will be fly and goes out of screen,, but when i try to tween then it shows error.
code is like this
// Making thumbs by this code
for( var i:Number=0;i<9;i++ )
[code].....
I was wondering if someone could point me in the right direction or share how to create a preloader the preloads multiple objects in sequence.Example:Now Loading: Moviesafter that completesNow Loading: Imagesafter that completeNow Loading: Sound
View 2 RepliesMy goal is to create multiple objects that fall downwards. The problem now is that the object stays in the left upper corner. I've linked the object to actionscript with the name "object". Can someone help me?
This is my code:
Code:
var namer:MovieClip = this.createEmptyMovieClip("objectHolder", 1);
for (i=0; i<=count; i++) {
var newName:String = "object"+(count);
[code]....
this problem has been solved. i only had to remove the "else{ return false;}" bit. I'm an animator who kinda wants to be able to do some actionscript but who isn't that good at it. atm I'm trying to make something which contains a hitTest() which should check if my movieclip (doll_mc) is touching any instance of "ground".
My attempt to make a code for this has dramatically failed and this is all I managed to make which does make a bit of sense: var nrOfgrounds:Number = 2; /*this is the number of instances, which should be kept up-to date with the project, of course.*/
setInterval( groundCheck(doll_mc), 25);function groundCheck(obj:MovieClip):Boolean{ /*returns boolean groundCheck(<objectName> [in this case, "doll_mc"]); */ for (var i:Number = 1; i <= nrOfGrounds; i++) { /* <- i've got a feeling like this bit ain't working properly*/
[Code]...
just to see what would happen, and yes, this time groundCheck(doll_mc) would only be true when doll_mc was touching ground2_mc, but not when touching ground1_mc. therefore there must be something wrong with that one bit of code, but I can't figure out what!
I have an extremely simple fla, that I wanted to add one thing to, but can't get it to work right. There are 5 layers, each one has 1 key frame and that's it.
1. "Actions" Layer
Code:
startDrag("mask", true);
[code].....
For instance, I have a bullet movieclip and it moves. I've put a hitTest on its onEnterFrame so that it checks if it hits its target, whose instance name is mmbug and the target flies around. That's easy and works cool. ( see [URL] , there's only one wasp present at a time and it works) Now what I want to do is duplicate the wasps so there are more flying around at one time, but how would I do the hitTest on the bullet then, because you have to specify it an exact instance name. If I make all the wasps have the same instance names it doesn't work. So obviously I'd have to give them names of mmbug1, mmbug2, mmbug3 etc. But how would I check on the hitTest if it hits any of them, since you have to put in an exact instance name in the hitTest?
View 5 Replies