ActionScript 3 :: How To Handle Resources For Web Game (Embed / Loader)
Apr 17, 2011
Ask a question .. images resources of the flash game , How should I load? I use the Loader class, but some people use the embedded resources. In which case use "Loader" class and in which case use "[Embed]"?
View 3 Replies
Similar Posts:
Dec 20, 2009
I am making a game, then I learned to load the resources (images,etc) just when I need them, using the Loader class.I would like to know if I embed them they would be loaded with the game swf file (I am thinking as if my game is on a website) or when I instantiate them.If I load it one time and not use it anymore (loose its reference) and after some time load it again, will it be downloaded from server again? Or it will load from my pc? If I put the resources on a folder in the server (now I am using a folder on my pc) anyone would go there and get all the resources! What should I do? how my game would work on a website, not on my PC only I got the idea to create a loader to load my game, but I cant think about the resources loading,
View 1 Replies
Mar 20, 2011
I want to embed all my resources in the SWF but I want to maintain the fexibilty of the xml.So, I want to embed my XML and then embed images bringing them from the embedded xml.
For example, this is my test.xml[code]...
View 2 Replies
Jun 10, 2011
We are developing an epic game using flash cs5 and actionscript 3 (no flex at all). There are lots of images and other media stuff in library that we need to use. Early i just kept them in my main .fla, but then compiling swf became very slow (more images - more time to compile). So i put all my images to filesystem outside flash, and it helps. But then some lags and bugs appeared, especially when we were testing the game on remote server. Seems like files just don't have time to load (or they loaded uncompletely) - though i did it pretty correct, sequentially, with events like onload and so on.
Finally i've created another swf with all the images and resources. I'm loading it once in my main swf and i compile it only when i need to add a new image. It works rather well, but i have feeling that i'm doing it wrong or there is another right way to organize resources more easy. Also there are some minor troubles with second swf; for example, i have to make user wait until it loads inside my first file, and if i want to run from my desktop, i always must keep these two files near in one place. And, as amount of images growth and growth, it becomes annoying to compile my 2nd swf again, even if i need to do it not so often.
View 2 Replies
Mar 10, 2010
I am running an online flash multiplayer game. However, I have been facing a problem lately where some users cannot actually completely load all the resources required to run the game. The percentage that users get stuck at is different for different users (for instance, one could get stuck at 43% and some other at 91%). I don't think there is any problem with the files as such because the resources are completely loaded for the majority of the users and the game works just fine for them. Has anyone faced such a problem before?
View 1 Replies
Apr 28, 2010
I'm feeling a bit low now as I have been suffering this for months. A simple loader loads my simple game and runs VERY FAST on even slow pcs BUT when I build this other loader, it goes quite slowly and I don't know where the app is going wrong. WHERE is the processing consumptoin coming from out of my app.
[Code]...
View 1 Replies
Apr 6, 2011
I'm new to actionscript flash 3.0. Anyways, i have written code for one whole game level including the character. Is it now possible to create a class, and when i press for e.g. 'Level 1' the first level starts?(create an object of the class) When i press quit, to unload the whole level.
View 2 Replies
May 14, 2009
am creating a simple flash game where you rotate a planet to make the buildings on the planet avoid incoming meteors.I was told that there is another just like it already, but I don't want to see it because it may restrict my imagination.
I have everything pretty much planned out now in a "game script" of everything that i want to happen. only thing is, i'm not sure where to start.Actually,i implemented rotating the planet and the timer so far, but that is all.I was wondering if anyone wouldn't mind reading through my game script and pointing me in the right direction.I am trying to wrap my head around creating classes to handle different aspects of the game, but not sure what to put in a class and what not to.I attached the game so far and the word file
View 13 Replies
Feb 6, 2010
I'm creating a scrollbar gallery from a tutorial on this site. Though I've completed the tutorial, and customised the gallery to my own needs, however I'm trying to make a very small change to it - and no matter what I do, keep running into problems. I'm trying to replace the rectangular handle with my own customised handle - a (20 x 20) 'circular' png image that I've imported into Flash, made a graphic and stored in the library (though I understand it can be imported using actionscript, like the other images in the gallery).
[Code]....
View 7 Replies
Aug 11, 2011
I'm developing a flash game in cs5 and it works fine on the offline player. When running in browsers, they crash. The game is has a multifile loader and basically when all the files are almost loaded, the browser crashes. At first, it was only working on IE. Then i made some modifications and it was only working on FF 5.0.1. It never run on chrome or safari. On another computer with IE8, and finally, the flash gave me a stack trace:
Stack trace from IE
Then I got some stack traces on FF and I managed to change some class names and another minor stuff and it worked on FF perfectly. But not on IE or chrome. So I downloaded and installed the debugger version of flash player 10.3, but now on FF it finishes loading and then I get a crash message ( :( )from ff.
View 1 Replies
Dec 24, 2009
I have my game swf called inside a fla with loader method. The swf loaded completely, played well.Strange,when my player lost game, I mean for GameOver dialog box. It was playing well without any fault when i played my game swf individually, but when I called it inside a fla, its dialog box button is not working as usual.
View 2 Replies
Sep 8, 2011
I am really pulling my hair out with this one. Flash game, container swf loads a img using the loader class. The image is the map which will be used on the levels. The problem im having is that I originaly had each level load the map image, convert to a bitmap, and us it to create x and y's for colision detection.
the problem was that the game was loading and sometimes the map image hadent loaded. It also ment that each level was loading the same image and if the above happened on the 3rd, 4th level it was very annoying. So I need a way to load the image in the parent, but have it available to the child, however it must be available as at bitmap to work.
[Code]...
View 1 Replies
Jul 30, 2011
I'm writing a Flash game where the game levels are saved in small plain-text files, which I want to embed in the swf file. My current solution has a distinct code smell in its repetition, and I'm certain that there is a better way. My code is basically: In a LevelLoader class, embed all the levels
[Embed( source="levels/1.dat", mimeType="application/octet-stream" )]
protected var level1:Class;
[Embed( source="levels/2.dat", mimeType="application/octet-stream" )][code].......
There are a couple of problems with this approach: I have to add a line for embedding each level. Optimally, all files in a folder would be automatically embedded.A level can't be "prepared" from a string. I'd like to be able to pass LevelLoader a level number or level name as a string.I think that all strings are stored in memory rather than on disk.How could I program this "correctly"?
View 1 Replies
Dec 29, 2009
Can anyone tell me if there are any FREE resources for additional Text Effects for Flash 8 Pro?I've dabbled with the conventional glow, stretch, spin, rotate, blur type of transitions over the last couple of weeks, so now have an appetite to try something new.I've found some tutorials around the net on specific single effects, but would relish finding a small group of add-on effects somewhere!
View 7 Replies
Jan 12, 2009
I tried to do[code]...
I try to do the above in a function which is an error handler, I want to remove the sock (socket resource) EI (a reference to ExternalInterface) currentIP (which is just a string) lines (array) commands (array) recieved (string)[code]...
View 2 Replies
May 28, 2008
The new Flash 10 player was released. [URL] To get things running you currently need to use the Flex3 sdk. More details are described here: [URL] Click the link on my footer.
View 16 Replies
Feb 26, 2009
I am a web developer (CF and ASP.net) working on a new project. I toyed with flash back around the beginning of Flash MX around the early 2000's. Basically I am looking for direction on this -- I would like to have a small flash movie that displays a collection of pictures with some sort of transition. Ideally, I would like to pull the image paths from a database and rotate through them at some time interval. This seems like something that shouldn't be too difficult - and I am sure it has been done thousands of times - I am surprised I cannot find more information through google searches. Maybe I am not keying on the correct terms!??!? Anyways, If anyone could provide some direction - I am hoping that I can pick it up with a little push. Having not touched flash in 7 or 8 years, I am kind of stuck getting started.
View 2 Replies
Jul 8, 2009
I'm working though the Adobe "Flex in a Week" video training series, and I've reached Exercise 9, which deals with creating a remote service call. Up til this point, the data source and images have been local assets (located in src/assets in my Flash Builder project).
I access the room list by this:
<mx:HTTPService id="rooms" url="assets/roomList.xml"
fault="httpFaultHandler(event)"
result="httpResultHandler(event)"/>
Here are the two result handlers:
private function httpFaultHandler(event:FaultEvent):void{
Alert.show("There was a problem","Error");
}[code]...........
However, when I run the application in the blazeDS container, I get no rooms despite the fact that the room list clearly exists in the deployment directory after running the application:
$ find . -name roomList.xml
./tomcat/webapps/odt/adobeODT-debug/assets/roomList.xml
How can I debug the reason for this failure? The deployment process used by the Flash Builder tool is fairly opaque, and the tomcat instance isn't advertising 404s from Flex apps. Is there logging somewhere, or something, that needs to be turned on?
View 1 Replies
Oct 14, 2009
What resources (books or website/tutorials) are available, that cover game development using pure Actionscript 3 code? By pure, I mean not using Flash CS4 and its timeline, and not using Flex MXML components. Everything done using only Actionscript code.
In another question, I asked about using certain objects of the Flex SDK for simple games, and the consensus was that I shouldn't use it at all, but only Actionscript for a game. Sounds reasonable, but the books/website tutorials that I have found on the subject of games, all use AS3 in the context of Flash CS4. They assume your objects will be movieclips, with timelines, etc.
I realize that you can learn game programming from books in other languages, and/or ignore the Flash aspect of AS3 books. I guess what I'm looking for, is whatever information is specific to AS3, such as best practices for AS3-only games, how to make architectural/design decisions, etc. If it exists, anyway :)
View 3 Replies
Aug 27, 2010
I have the following javascript to embed a flash in my page.tpl.php
<script type="text/javascript">
<!--
var flashvars = {
xmlUrl: "xml/banner.xml" //Use to change XML filename or location
};
[Code]...
View 2 Replies
Sep 11, 2010
This is sort of a two part question. I'm building a flash image viewer to be a portable age-restricted module (violent video games). Basically, it will load any number of images from a CDN and require the user to enter their birthday before viewing it. Simple stuff. The problem is that, per company policy, we can't allow those images to be directly accessible by any means of sniffing (eg, watching your Resources/Net tab in Webkit/Firebug, or watching XHR if we loaded them that way). So, I'd like to get your opinions about the best way to approach this.
At first I thought to have a server-side script that loads the image (eg via PHP) by passing a var that can be decrypted but with a dynamic salt, eg, using a method that is very unlikely to be discovered (for example, having the salt be embedded throughout the string), but that defeats the purpose of the CDN as all requests would be geolocated to the server.
Then I thought that loading the images via sockets would be a good solution, however, I'm having trouble converting the binary image (after removing the response headers) to a Bitmap.Is there a better way to go about this? I know that realistically it's impossible to completely prevent the content from being linked to (eg someone could screenshot the flash) but my goal is just to take steps on our side to prevent that from happening by native means. Below is the socket code (irrelevant parts removed), if that helps any.
package com.std.socket {
import flash.system.Security;
import flash.net.Socket;
import flash.events.*;
[code]....
As I'm writing I'm thinking that in SocketRequest::evt_socketResponse(), the this.sock.readUTFBytes() bit should really be:
this.request.response_parts.push(this.sock.readBytes(this.data, this.data.length, evt.bytesLoaded));
and then remove the headers from this.data, but TBH I'm not super ByteArray-savvy.
View 1 Replies
Jan 16, 2011
Is there a way to load graphics externally when in development but package the graphics into the project's swf when it is published?
View 1 Replies
Aug 1, 2011
I need to make a Windows application in which, at loading time, I need to play a Flash (.swf) file in WebBrowser. But I can play the Flash file directly from hard disk to WebBrowser control. Here I need to play the .swf file in the Resources folder and load it in WebBrowser control.
View 2 Replies
Sep 23, 2011
I want to replace an image inside of a SWF File without the need to decompile it.
View 1 Replies
Jan 3, 2012
I would like to have just a single preloader in the beginning of a SWF movie and I want it to show the total download progress of multiple external resources (pictures, sounds, other SWF files, etc.)Is it possible to preload multiple resources in one go and display their total progress with a single preloader?
To be more specific: the movie starts, the preloader loads and gets displayed, then the preloader is displaying 0% progress and builds up to 100% while it loads sounds, images and other SWF files in the background, then when all resources are loaded, preloader goes away and movie continues with the available resources ready to be attached.
View 1 Replies
Feb 28, 2009
I have a font in my library and I want to access it from a class.
myFont:Font = new FontName(); doesn't seem to be working.The linkage is setup. How can I get this to work?
View 2 Replies
Jan 8, 2010
Using Flash CS3 and AS3:
Where are the resources located? For instance I have checked out a few samples online and the Main.FLA is empty (with maybe a few movie clips).
There are a few .AS files along with the Main.FLA. Where are these .AS files referenced? There is no ActionScript in Main.FLA according to the Movie Explorer.
If I rename the .AS files, the Main.FLA no longer works, so obviously the names are referenced elsewhere.
Can't find the .AS files referenced in the Movie Explorer, and of the Movie Clips, the Library... where am I missing the references to the included .AS class files?
View 6 Replies
Apr 27, 2010
I'm a relative noob looking to develop a simple app for the Android platform, I've got the thing working in Air on my machine and am wondering how easy it will be to get it to run on Android OS devices. I've been looking around for how-to type resources but the stuff I've found has either been too vague or too advanced.
View 8 Replies
Mar 11, 2009
Some time ago I had to protect an swf but, since I never did it before, I had no fancy obfuscation tools and stuff like that. So what I did was this:
Code:
package
{
[code].....
View 1 Replies
Dec 17, 2009
I am somewhat new to OOP and am attempting to learn how to design and execute custom classes. My goal is to create a package that extracts data from an XML document. Do any of you have links, books or other resources you would recommend? So far, I've got the following:
[Code]...
View 8 Replies