Flex :: Sprites Are All Draws From X - Y Coordinates That Receive From XML

Jun 2, 2010

The orange square is the currently selected selected sprite. The sprites are all draws from coordinates that i receive from XML. var sprObject:Sprite = new Sprite();

[Code]...

What I want to do is the following. If I'm currently on the orange square and I use my keyboard direction buttons (up/down/left/right). I want to deselect the current sprite and select the next sprite in the appropriate direction. The problem I'm having is that I cannot get the x and y coordinates of the drawn sprites. If I look in the array, the x and y coordinates of the sprites are all 0. If I can retrieve that I can write an algorithm to determine the next sprite to select.

View 1 Replies


Similar Posts:


Actionscript 3 :: Convert Global Coordinates To Local Coordinates Of A UIComplenent In Flex Project?

Dec 19, 2011

I was trying to convert global coordinates to local coordinates of a UIComplenent in my flex project using below code using below code

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point

uic is UIComponent in which I have subclass of Sprite for drawing something I have set the sprite's mouseEnabled and mouseChildren to false to not interrupt the mouse event. above code is within uic's mousemove event where I was tracing the gp and lp gp was giving correct value and suprisingly lp was giving negetive values. when I move the move to the top left corner of uic i expect lp to be 0,0 but it is giving the -width of of uic. I broke my head for hours and ended up finding an alternate by using offsets. Infact my original code was much simpler like this which was same issue

var lp:Point = new Point(e.localX,e.localY);

I am not sure what exactly is causing this problem. the workaround had lot of issues and it creating a mess in my rest of the algorithms.Just now I found even more interesting thing (which is actually weird). for some reason I went and create a new lp2

var lp2:Point = new Point(e.localX,e.localY);

now surprisingly it was giving correct values as expected and I went back and changed the code as

var gp:Point = new Point(e.stageX,e.stageY); //global point
var lp:Point = uic.globalToLocal(gp); //local point
var lp2:Point = new Point(e.localX,e.localY);
var lp2:Point = uic.globalToLocal(gp);

now it is expected to have all the lp, lp2 and lp3 variables to be same but weiredly lp two is giving wrong value and lp2 and lp3 were giving correct. I am suspecting using the variable lp has something to do. I am not sure about that but above proves it so right now I am using lp2.

View 1 Replies

Flex :: Keyboard - Flex Air Receive Input When Unfocused?

May 12, 2011

I am trying to find out how to continue to receive keyboard input to my app when the app is not focused. For example, if I dock my app to the system tray, is there a way to continue to receive keyboard input to be fed to the app?

View 1 Replies

Flex :: Two Overlapping Buttons Receive The Same Click?

Dec 20, 2009

I need to create a workaround for a button issue. I don't know how to have one button created by one class send a click event to another item created in a different class

Therefore, I'd like to place both of my buttons on top of one another, alpha one of them out and have both buttons receive the same click.

View 1 Replies

Rails Best Way To Receive Xml Data From Flex Application?

Feb 2, 2010

i'm able to display xml content on my swf file but how can I send the changed xml file back to my rails Server?

View 2 Replies

Receive An Image File Through Flex's HttpService?

Jun 30, 2011

I've written this piece of code to use a PHP script to send data to Flex.[code]...

If there is no way to use HttpService for this end (i.e. send image files), how can one do it then? I've seen it in an app I worked on so I'm positive it can be done.

View 2 Replies

Flex :: Adding Sprites To Canvas?

Apr 30, 2011

First off I have this MXML:

<mx:Panel x="270" y="10" width="690" height="680" id="mainContainerPanel">
<mx:Canvas x="270" y="10" width="670" height="640" id="canvas" initialize="onInit()">

[Code]....

The circCentre Sprite never appears on screen and I don't understand how I can get it to appear.

View 1 Replies

Flex :: Programmatically Set Focus To HorizontalList So That It Could Receive Key Events?

Oct 26, 2009

look at the code:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:creationComplete>

[Code]....

As you see, I try to make my HorizontalList focused when application is loaded. And I actually receive Received focus message in console. But I expected that I would be able to navigate over list elements with arrow keys after setting focus. But that's not the case. They work only after clicking component with mouse. How to make list have focus and respond to arrow keys?

View 2 Replies

Flex :: Bottom Uicomponent Does Not Receive Mouse Events

Apr 19, 2010

I have a base ShapeContainer(UIComponent). I add a uicomponent which has mouse down listener to ShapeContainer. the listener works great. When I add a simple sprite(draw square) on the ShapeContainer, The listener does not work any more. In the code, if I comment below line, The event listener works fine.

[Code]....

View 2 Replies

Flex :: Console - Send / Receive Same Window In TextArea

Apr 21, 2010

Any example of a telnet/chat or other console like FLEX application where you can use the same TextArea as input/ouput area. I've been trying to modify the app at: [URL] but so far, computer says no. All the implementations I've seen use a combination of TextInput and TextArea.

The challenge is that we'll be using this app to telnet into some old routers and we'll need to do a fair amount of copy/pasting. Based on what I've seen, it seems that I would need to point the mouse into the TextInput in order to be able to right click and paste, which is not very sleak.....

View 1 Replies

Java :: Flex Socket - Can't Receive The Command From Server

Aug 20, 2010

I am writing a online game with flex and java server and I have a big problem. In normal case, my game run smoothly but some time the clients can't receive the command from server. I found that if server send message too fast or client is doing something when server send message, the game client can't detect for a new message so my game is freeze. I only tested with 4 clients and I don't know what happen when thousands clients online in the same time. So terrible :(. In the game client, I use one EventDispatcher class to dispatch any command from the server. Do you have any solution to warranty that client must receive any message from server when the connection is still alive or server must know if client received the message or not. I use flex 3 with Socket (binary) and Java QuickServer.

View 1 Replies

Flex :: Actionscript Graphics Connecting 2 Sprites

Dec 28, 2010

Is it possible to draw 2 rectangular shapes of "Box A" and "Box B" and place them apart, next, adding a magnetic line (black line) between them which will keep them connected without having to manually update the line xy position?

View 1 Replies

Flash :: Flex 4.6 Increasing Socket Receive Buffer Size?

Apr 5, 2012

I am having an issue with sockets where the data I'm sending is getting truncated on the client side (Flash/Flex). The data that is sent by my server is full and in tact, but flash does not wait the appropriate amount of time before firing an event saying to read the data. This results in the data not getting fully read and (as such) I can't parse the object out of it after that. We are exploring the possibility of stripping the object into smaller chunks, but the idea is for it to be as lightweight as possible so we would much rather get it to work the way it's supposed to than patch in a temporary solution.I'm not entirely sure if referring to it as the receive 'buffer' is correct, as some computers are able to receive all of the data and others are having it truncated (which means the buffer is adequate but flash isn't waiting the appropriate amount of time to dispatch the event for whatever the reason).

View 1 Replies

Flex :: Adobe - Send/receive Data From/to Media Server

Oct 27, 2009

i want to make a simple chat with flex as3 and red5 media server

my idea is that i send from the swf a message to the server and the server sends it to all the swfs (including the one that sent the message)

i just don't know how to to send and receive and how to receive from the server

View 2 Replies

Android :: Air Native Extension - Receive Broadcast In Flex Application?

Jan 31, 2012

I am developing application with Adobe Flex on AIR platform. Using native extension for Android, it is possible to send SMS from my Flex application. Would it also be possible to receive SMS with my application (receive Broadcast carrying information about incoming SMS)? More generally, is it possible to receive Android Broadcasts in my Flex application?

View 1 Replies

Flex :: Controlling The Properties Of A Sprite's Child Sprites?

Dec 23, 2009

I have a sprite in which I have added other sprites. Something like:

var sp_main:Sprite = new Sprite();
var sp_group:Sprite = new Sprite();
for(i:int = 0; i < 10; i++)

[Code]....

View 1 Replies

Flex - Display An ArrayCollection Of Sprites In A List Component?

May 22, 2009

I have an arrayCollection of objects that extend Sprite, and have bitmaps within them. I want to display these in a list (or some other component that would allow a user to scroll through them, and see their associated data.)

When I do: myList.dataProvider = myArrayCollection

the list just shows a bunch of lines of [Object, Item] instead of the visual sprites.

Here is a simplified version of my Object:

public class myUIC extends UIComponent

[Code]...

Tried many different ways to get it to show up in a List, but can't do it.

View 4 Replies

ActionScript 2.0 :: Converts 3d Coordinates To 2d Coordinates - Difference Between MoveTo And LineTo?

May 21, 2007

I was reading the 'Isometric Transformations' tutorial by Danko Kozar and I have a few questions. I understand what all the code does, but not how it does it. First of all, how does the following code work:

transforms x,y,z coordinates into Flash x coordinate
xFla = function (x, y, z) {
// cartesian coordinates[code].....

I understand that it converts 3d coordinates to 2d coordinates, but I don't understand how. What numbers whould be punched into x, y, and z to acquire certain desired effects?Also, what's the difference between moveTo and lineTo:

red line
style(1, "0xFF0000", 100);
plot(0, 0, 0);
draw(200, 0, 0);

View 4 Replies

Flex :: Using NetConnection And URLStream To Send/receive Data At High Frequency

Jun 17, 2009

I'm writing a Comet-like app using Flex on the client and my own hand-written server.

I need to be able to send short bursts of data from the client at quite a high frequency (e.g. of the order of 10ms between sends).

I also need the server to push short bursts of data at a similarly high frequency.

I'm using NetConnection.call() to send the data to the server, and URLStream (with chunked encoding) to push the data from the server to the client.

What I've found is that the data isn't being sent/received as soon as it's available. For example, in IE, it seems the data is sent every 200ms rather than as soon as NetConnection.call() is called. Similarly, URLStream isn't making the data available as soon as the server is sending it.

Judging by the difference in behaviour between the browsers, it seems as though the Flash Player (version 10) is relying on the host browser to do all the comms. Can anyone confirm this? Update: This is very likely as only the host browser would know about the proxy settings that might be set.

I've tried using the Socket class and there's no problem with speed there: it works perfectly. However, I'd like to be able to use HTTP-based (port 80) connections so that my app can run in heavily fire-walled environments (I tried using a Socket over port 80, but that has its problems).

Incidentally, all development/testing has been done on an internal LAN, so bandwidth/latency is not an issue.

Update: The data being sent/received is in small packets and doesn't need to be in any particular format. For example, I might need to send a short array of Numbers, and this could either be encoded in AMF (e.g. via NetConnection.call()) or could be put into GET parameters (e.g. using sendToURL()). The main point of my question is really to see whether anyone else has experienced the same problem in calling NetConnection/URLStream frequently, and whether there is a workaround (it's also possible that the fault lies with my server code of course, rather than Flash).

View 2 Replies

Java :: Push Data From BlazeDS Without Receive Message From Flex Client?

Dec 9, 2009

I am using BlazeDS for data-push feature in my Flex application project. From the official tutorial, Getting started with BlazeDS, it shows messaging example with producer/consumer from API. but how can I implement server side which doesn't need to be invoke from Flex client, but from within server-side instead. I got some idea but I don't know how to do because I'm a Flex developer, not Java developer In Google, there's a tutorial show about I need to extend ServiceAdapter class in Java-side, which extends Invoke method. Do I need to extend other class instead of this to do what I want?

View 3 Replies

Flex :: Force Delay Render Until Receive Data Before Drawing To Screen

Mar 13, 2010

In my Flex application, using a custom control, I am making a JSON request to grab some data from the server. My rendering depends on this data such as knowing how many boxes to draw. How can I either force the rendering to wait until I've got the data before drawing to screen or have the boxes draw once we receive the data? I have an event listener for Event.COMPLETE for my JSON request and in there, I call methods that add to the control. I've tried invalidateDisplayList but that doesn't seem to do anything for me?

View 1 Replies

Flex :: Operator Console App - Listen Java Socket To Receive XML Data?

Jul 13, 2010

We are in the middle to evaluate the technology choice to re-design an operator console application. The operator console as a hosted contact center has the abilities to queue the inactive calls, and hold, answer, transfer the active calls.

The legacy operator console used Java Swing. We want to use the latest RIA technology (Flex/Silverlight) to retire the legacy one. But the question is Flex/Silverlight can implement the functions like hold, transfer the calls? Based on my experiences, Flex can listen Java socket to receive XML data? Does it work well to receive voice data?

View 2 Replies

Flex :: Add An EventListener To A MoiveClips/Sprites's ScaleX Change Event?

Jun 5, 2010

How can i trigger an event for the scaleX property change of the movieClip or Sprite in Flash AS 3.

View 1 Replies

ActionScript 3.0 :: Converting Papervision Coordinates Into Cartesian 2D Coordinates?

May 3, 2010

Im making a little app in flash using papervision I want to make a regular movieClip show up in the same place as a papervision object. The coordinates seem like perspective is affecting the number displayed.

View 2 Replies

IDE :: SWF That Draws Outside Its Bounds?

Mar 3, 2009

I opened up the NY Times homepage, and they have this giant Apple addvertisement that has animations over the entire top half of the page, outside the area occupied by the swf.

View 1 Replies

ActionScript 1/2 :: Random Card Draws

Dec 26, 2010

There's something I'm trying to make but I just can't seem to figure it out. I want to make something that allows a person to build a deck of cards from multiple sets of cards. I also want a button that can be clicked to randomly choose a card from the created deck. For example: lets say there are four sets of thirteen cards (hearts, diamonds, spades, and clubs). The user can select which of the four sets will be included in the deck. Once the sets are chosen the user can click a button and one card will be chosen from the selected sets. What is the best way to handle something like this? Is there a tutorial that explains how to do something like this?

View 3 Replies

ActionScript 2.0 :: Make A Square That Draws Itself

Nov 16, 2005

i want to know how to make a square that draws it self in actionscript;I was thinkning line tos but can someone help me clear it up

View 14 Replies

IDE :: Line Automatically Draws As Symbol?

Feb 28, 2009

I'm having an issue with Flash CS4. I'm not sure what I toggled, but when I draw a line or shape it automatically converts it into a symbol. How do I disable this? It's very annoying to have to break apart each line as I draw it.

View 1 Replies

ActionScript 2.0 :: Using Whatever LineTo(); Draws As A Mask?

Apr 30, 2005

The effect I would like to create is as follows: I have an image movieclip named "myImage_mc", and I want to create a spray paint effect, where the user "paints" whatever myImage_mc is using the lineTo and lineStyle commands. I have the lineTo stuff all done, the problem i have is trying to make whatever the user draws a mask that shows the image.Here's my code so far:

Code:
this.onLoad = function() {
_root.createEmptyMovieClip("empty_mc", this);

[code].....

View 1 Replies

Flex :: Getting The Global Coordinates Of A Component+flex?

Feb 20, 2012

I have a texInput component,which is placed inside containers like following

<s:BorderContainer ...>
<mx:VBox ...>
<mx:HBox ...>
<mx:TextInput ...>

[code]....

Now after initialization i want to get the location of my textInput with respect to Application.I tried with with localToGlobal(PointofLocalCoridnate), then it is not giving the correct location of textInput.

View 8 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved