When rotating a display object (around its center) the visual corner of the element moves (the actual x and y of the "box" remains the same). For example with 45 degrees of rotation the x coordinate will have increased and the y coordinate will have decreased as the top left corner is now at the top center of the "box".
I've tried to us...
Hi!
I defined a simple event class:
public class NewMoveEvent extends Event
{
public function NewMoveEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=true)
{
super(type, bubbles, cancelable);
}
}
}
Then in custom mxml component, I defined a button which triggers it:
<mx:Panel xmlns:mx="http://www.adobe....
Hello,
I'm trying to build a calculator in Flex / actionscript 3 but have some weird results using the class Math :
trace(1.4 - .4); //should be 1 but it is 0.9999999999999999
trace(1.5 - .5); //should be 1 and it is 1
trace(1.444 - .444); //should be 1 and it is 1
trace(1.555 - .555); //should be 1 but it is 0.9999999999999999
I kno...
I created a game but I made the game a little too big. It would be alot of hard work to shrink all the objects in the game and resize the stage using the properties. I notice that in debug mode the whole screen can shrink when you adjust the window. Is there some code I can use to this on it's own? and will it be costly on performance ??...
Hello,
I would like to code a calculator in Flex but can't find any fixed-point libraries on the web.
For the calculator, I need more precision then IEEE 754 can guarantee. For example:
trace(1.4 - .4); //should be 1 but it is 0.9999999999999999
Can someone suggest a good fixed-point library please ?
Thank you in advance
...
Just checking to see if anyone uses kongregate. If so, I am having issues.
When I connect to kongregate locally on debug mode it works fine. but when I upload the game to their servers, I get the following error.
TypeError: Error #1010: A term is undefined and has no properties.
at com.objects::Engine/GameMenu()
at Function/http://adob...
I have an event listener applied to an xml load and it currently traces out the values it grabs which is fine, but what I want it to do is return an array for me to use. I have the Array creation and return working from "LoadXML" (it returns the array) but I can't get this to work with an event listener.
The event listener runs the "Loa...
I am trying to make a flex application where it gets data from a telnet connection and I am running into a weird problem.
To give a brief introduction, i want to read data from a process that exposes it through a socket. So if in the shell i type telnet localhost 8651i receive the xml and then the connection is closed (I get the followi...
How would you adhere to the "Tell, don't ask" principle (henceforth "the principle") in the following simple scenario? In a Tetris game, I have Board, BlockGrid and Piece classes relevant to the following example:
public class Board
{
private var fallingPiece:Piece;
private var blockGrid:BlockGrid;
...
public function mo...
I am creating a game that uses tiling and xml files. I am trying to retrieve these files from an outside server. When I run the program in debug mode on my local machine, it works great. But when I upload to a server. I get this error
SecurityError: Error #2122: Security sandbox violation: LoaderInfo.content:
A policy file is required,...
OK!! I built a game that grabs a tileSheet (bitmap image) and some xml files from an outside source (not from the library). Turns out that this is a bad idea if I want to post my game on most sites. Cause majority sites only give me ability to load a single file. NOW, I need to figure an alternative.
I tried doing the cross-domain thin...
Hi,
I want to read an xml file placed in the same folder as the swf. Note however there is no webserver running.
<![CDATA[
private var my_req:URLRequest = new URLRequest("assets/GmetadOutput.xml");
private var loader:URLLoader;
public function startup():void {
output.t...
is it possible to embed sources dynamically. instead of doing this
[Embed(source = '../../../../assets/levels/test.xml')]
I could probably do something like this
var src = '../../../../assets/levels/test.xml'
[Embed(source = src )]
...
Hello, in my case I click a button. it calls changeTabState() ; it changes the state and then needs to select a tab using selectedIndex. but that does not work properly.
If i go back go the main state and click the button again, it works as it should.
Help! What should I do 'register' the tab navigator component in my new state?
Butto...
I am trying to embed a movieClip with flashDevelop but apparently its not working because its not recognizing the movieclips that are within it. here is my code
package com.objects{
import flash.display.MovieClip
import flash.text.TextField;
import flash.events.*;
import flash.text.TextFormat;
[Embed(source='../../...
What is the differences in use of these two objects?
Which one should be used for a "Youtube-like" video player with a custom skin and playlist?
...
I have a server that I have written in Python and I'm trying to connect to it via Flash's XMLSocket. I know for sure that this server is working properly as I have used it successfully with multiple non-Flash client applications. For right now, I just want to connect to the remote server with an SWF residing on my local disk. From what I...
Hi,
I know singleton class is not supporting in Flex.Because it does not access private constructor.
But i want to make a class is singleton class. Please anyone can explain with example.
Thanks,
Ravi
...
When I try to compile my application in flash develop. it wont compile. even if I put a simple trace in the Main class. Nothing happen. the sdk is in the correct place.
...
In my little scratch built flex game framework, I have defined a class called ThreeDPoint, that carries an x, y, and z co-ordinate set to track my in-game objects, called Actors. I also use the class to create movement vectors that stack up and are added together every frame to create a cumulative movement vector for each Actor.
I made ...