ActionScript 3.0 :: General Programming - Difference Between Using "this" And 'this' When Set A Variable?
Jan 30, 2010What exactly is the difference between using "this" and 'this' when you do something like set a variable?
View 2 RepliesWhat exactly is the difference between using "this" and 'this' when you do something like set a variable?
View 2 RepliesI have the following question: How can i load a dynamic xml, i.e. the .xml file that will be generated automatically and thus gets different names.I want flash to "listen" to a variable "file", that is "file" represents the name of the xml-file to load. Like showXml.swf?file=abcd1234.xml. btw i don't exactly use the xml extension so it becomes showXml.swf?file=abcd1234
I using a general name = "XMLtoLoad" to load my xml.My AS right now is somthing like:
file = XMLtoLoad;
_root.xmlDocument.load("XMLtoLoad");
how can i exchange a filename/url (like "XMLtoLoad") by a more general variable? Or maybe i should ask how can i convert the name after "?file=" to a URL within AS
Whats the difference between a variable and a function? Ive started reading an actionscript book.....and to me it seems there the same.
View 4 RepliesWhat is the difference between declaring a variable like this: variable = 1; and declaring it like this: var variable:Number = 1? Why is it better to use the second way?
View 4 RepliesI would like to know what's the difference when I write a temporary variable like this (these are just examples): version1
[Code]...
What's wrong and right? Currently I write it like version 2 and I'm not sure if I should change it to version 1. I know most developers write like version 1 but I'm a little bit confused because I am totally unaware about version 1. If I use version 1 does that mean that my value is stored explicitly in a temporary variable that is cleared in every cycle?
I have a flash doc with two MC's and two frames.In frame 1, the user can select one of the MC's, and in frame 2, he can move ONLY that MC.Is there a way to write a general code in frame 2 and not having to write an "IF" depending an extra variable I had to create?Because in the future I will have lots of MC's.Here is the little code I have and the link with the .fla
Frame 1
Quote:
stop();
extra_var = 0;[code].............
I'm sorry if this is the wrong place to post this, but I looked for a place to send general "feedback" and could not find one.I just wanted to let the management at Adobe know a couple things related to recent Public Relations blunders. Ever since the announcment that you were ending Flash Player for Mobile, I have had many conversations with people about this topic and there is SO much misinformation due to your announcement, it's going to tank Flash as a broader platform.
- Some think Flash doesn't work on Macs
- Some think the Flash player is cancelled on ALL platforms (PC included)
- Some think Flash in its entirety is coming to an end.
This perception seems to come from people of various levels of technical knowledge, from basic users where it's understandable they might be confused about the specifics of the recent news (but still not a good thing!) on up to key decision makers who don't know tech but are key to making certain spending decisions with regard to tech platforms (CEOs). This is a horrible place for Flash to be in right now and you need to quickly change the perception with a "Flash is alive and well" type of announcement.Remember, most people only retain sound bites and a few words from headlines. You may have announced "Adobe ends Flash Player for Mobile" originally, but what people retained was "Adobe ends Flash Player". You need to make a new announcement that the short attention span people will come away from with knowledge that all is well. "Flash not dead" for example.Man, whoever plans your PR needs to be fired. You could have killed off the Mobile player back before the MAX conference and then followed up with the news about Flash Player 11 and Stage 3D. That would have a perfect one-two punch, but instead you reversed it and all the excitement from FP11 @ MAX was blown away.
I'm completely new to Java. My task is to set up the client/server architecture for an upcoming Facebook game. On the server-side, I have:
[Code]...
Here I aligned Left Center...
How to generalise?
I have created three movieclips." image","crop","fixedPoint"
I am rotating the image 0,90,180,270,360..
image always align with fixed point.
ActionScript Code:
import flash.geom.Rectangle;
function alignObject()
{
[Code]....
I was just wondering, what is better in general? Having a TextArea component or just use a TextField with a scrollbar component over it? What consumes less memory? What is the implications of using a TextArea? Why use a TextArea over a TextField? I'm currently trying to deal with memory leaks and maintenance over time in my flash application, so every byte I save means a lot
View 1 Repliesi have a few problems that i have stumbled apon and i'm using Learning Actionsript 3.0 book to help me, but i am using FlashDevelop as my chosen editor for learning rather than Flash IDE editor, is it OK for me to upload my FlashDevelop projects for people to see and help? because like i said i'm using it for my AS 3.0 learning.Do many of you use FlashDevelop for your AS 3.0 code?
View 2 RepliesI was wondering what's the best way to manage an images depth. Currently I have 2 layers. On the top layer I have a png image of a window. The inside of the window frame is transparent so you can see though it. On the bottom layer I have a png image of a background that you cannot see though. I used addChild(MyMovieClip); to put an image onto the stage. It is in front of the window. I used addChildAt(MyMovieClip, 0); and the image ended up behind the background. I used addChildAt(MyMovieClip, 1); and the image ended up in front of the window again.
[Code]..
If I have a flex component that is a general popup, it's basically just a white popup that I pass an Array named "modules" to.[code]...
View 2 Replies new to ActionScript 3 and while I'm trying to write as "clean" code as possible (creating various custom classes instead of everything in the document class for example), sometimes I stumble upon behaviors that would not arise if I had put everything in the same place.I have a project which involves fireworks which is working fine, but I'd like to add a smoke trail to the rockets (a custom class rocket object) and so far I can't get it done.
So I will ask my question first: what methodology do you use in general when you want to make a custom class object leave a trail of particles behind it? Do you include the trail generation in the class? in a separate class? on the document class?what I've been doing (and what I feel is the "cleanest" and most reusable way to do it) is to put the trail generation in the custom class rocket object. This object is just composed of some graphics and the function that generates the particles(which are another custom class).The actual handling of the firing and the movement of the rocket is done by the document class.So the problem I'm having is that when I generate a particle on a frame, if I add it to the rocket object, it follows it (local coordinates), and if I add it to the stage then I can't remove it from within the rocket object...
I am currently making a game with Flash CS5 and AS3... namely Tetris I have created my main menu and the objects and so on and have a few questions
1) How do I quit the game should a player press the quit button?
2) How do I get a button (Z and X) to rotate an object whilst the object is moving downwards (it is moving downwards using the timer function)?
3) How do I get the object to stop once it reaches the bottom of the screen? (im thinking something along the line of the hit detect but havent had much luck)
4) Any ideas on how to get flash to detect if a line is complete and therefore delete it? (it needs to segment blocks off the graphic)
5) My final and most important question (the bit im working on at the minute) how do i get flash to call random functions so that random tetrominoes appear on screen so that the game is different everytime and the blocks are random as the player plays)
I have an awkward problem with a carousel I have built. When the images are scaled down to give the 3d 'flipping' effect, they start to flicker and cause the general movement to slow down. Someone mentioned cacheAsBitmap.. .
View 3 RepliesIs there a way to handle errors and exceptions in AS3 as one would do so using `set_error_handler` and `set_exception_handler` in PHP?
View 4 RepliesGiven the nearly plain-text nature of Flash, from a security standpoint, we must assume that your SWF can be decompiled into human readable format. That said, how can we ensure the validity of any online calls? For example, recording a high score might make a call similar to this:
Code:
var url:String = "http://someserver.com/tracker/scoreTable.aspx?mode=record&score=" + _userScore + "&checksum=" + MD5.hash( /* stuff */);
var loader:URLLoader = new URLLoader( );
loader.load( new URLRequest( url ) );
You can do all the MD5 hash checking to make sure the data received matches what was sent, but how can you verify the validity of the call? For instance, one could decompile the SWF and figure out how to build the query string manually, or they could reverse engineer it from monitoring the internet calls from the SWF itself. They could even use a run-time memory editor to change the figures that store the information while playing the game, so that when the recordHighScore call is made, it sends 1,000,000 instead of 1,000. How does one authoritatively validate data and protect against abuse?
I have creating a distributed note taking application in flex, it basically is a notepad I can keep in my desktop tray. When I add notes and goes back to a server and saves it in a database.
To am struggling to design the application correctly, I want to have a Syncing service that polls the webserver for changes and updates an Array of Note objects. The problem is that my note corresponds mxml component, aka SingleNote component. There are four different cases when being, a. a note is updated from the server poll, in that case I want to singlenote to update the settings b. a note is added to the array from the server, in that case a new SingleNote needs to be created c. a SingleNote is added from client, in that case a Note is added to array, and sent back to server d. a SingleNote is change from client, in that case the Note is updated in the array and sent back to server
The properties are SingleNote(Width, X, Y, Text).
We're running a permission-based audio stream to be amplified through in-store sound systems, but are unsure about basic hardware requirements. What basic features must all hardware have to log into our server via username/password and receive audio signal?
View 4 Repliese4x programming extension is native to Actionscript and makes sense to use it over Xpath or any other DOM interfaces. I would like to know from flex community if they had any bad experiences like performance, etc, or any other gotchas.
View 1 RepliesI haven't programmed in a while, and have kind of lost interest, but I want to get back, and I've enjoyed C# the most, a lot more than objective-c and visual basic. So I want to make some games that me and my friends will be able to play next school year. So basically something you can play on the web.
What programming languages deploy to the web?If c# is possible, and a mac with safari/firefox would be able to use it (I can't install plugins, and I don't want to get in trouble for making myself admin again)Flash, Java, etc. If java does, I'd like that most since it's most like c#. Then what libraries/engines would I use? I want to do 2d. And then what IDE would I use?
is there any decent tutorial for flash programming on iphone?
View 2 Replieswhat i mean is, is there a way in AS3, or in programming in general(php, js etc) to make an event fire/activate "WHEN" something does something, as oppose to an if/else if / else statements ? for example, say i want to make an event fire /activate ONLY when a frame label is hit, and thereafter , do something else etc, essentially making it do things one by one down the line according to WHEN certain objectives are met.is there a "when" type of statement etc that will do this as oppose to if/else if etc???
for example, using the above example, instead of me doing something like this:
[Code]...
I don't seem to find any decent AS3 book for learning Object Oriented Design.
I checked several ones but most assume that you are an intermediate or advanced AS3 developer.One like AS3 Design & Patterns is good but starts simple and get really complicated quickly. Another 2 are Object Oriented AS3 and Advanced AS3 with design patterns is TOO ADVANCED. Now we have OOP books but not for the little guy with limited programming experience like me. What are my alternatives? A friend of mine told me get Head First Java and learn from there it explain Java but especially OOP for beginners. What do you guys think I should do? I feel it is a shame that I need to go to Java to learn OOP because AS3 books are not for beginners.
Can u recommend me a good book/e-book/tutorial to network programming in as 3.0 ? I'd like to create a multiplayer game.
View 0 RepliesHow can you create a car driving game or a man running. I would like some tutorials so I could get use to flash mx.
View 1 RepliesSo I am trying to get better at putting all my code within one action layer and there is a bit of button code that seems to be confusing me.
Whenever I program a button I use the following code:
PHP Code:
on (press){
} on (release, releaseOutside ) {
}
Now I know programming the on(press) command is done like this:
PHP Code:
btnName.onPress = function() {
}
However I am having a hard time with the on (release, releaseOutside ) code. The only way I have been able to do it is like this:
PHP Code:
btnName.onRelease = function() {
} btnName.onReleaseOutside= function() {
}
My question is, is there any way to combine the two onRelease commands?
Let me sum up the game the best I can real quick and then get to the problem. I cannot upload any code because I am under contract. I also know the code is working 100% correct. The game I am working on will have "X" number of large images. The "X" images will then be broken down into smaller images. I have around 3,000 images, all in the Flash Library, classes are named correctly, the files are named and sized correctly, etc. The game works perfectly on images 1-66. When I get to image number 67, the game SWF starts flickering from scene 1 to scene 2 and then back to scene 1 for a non-stop loop. No matter what image I use for #67, the swf flickers. My FLA is around 300MB and my SWF is 102MB.
So, does anyone have any ideas on why adding a 67th image would make the SWF freak out? Could it be some type of file size issue, graphics card issue, virus, etc? I've tried it on multiple computers both PC and MAC.
I'm looking at purchasing a couple of new AS3.0 books, I would say my skill level is basic to intermidiate, and I'd like to push my skills to at least near or at pro levels, what would you recommend?
View 5 Replies