I have a question about assigning instance names. How do I set a Loader's instance name so I can refer to it outside of the function (without using event.target or event.currentTarget or event.target.name)? Here's an example...I'm writing this on the fly...
Through searching the various forums I have found that Loaders are not dynamic and hence you can not apply custom properties to each instance of them. I miss the old way (as2 way of attachingMovieClip) that you load dynamic content, at least you can apply custom properties, and you can always reference them for each object.What I'm trying to do is load a group of Images via XML. Each one of those images have a set of information that is associated with them (name, description, etc). I have the images loading in and positioning just fine, however when trying to have a tooltip show the name on Mouse Over, I'm not able to achieve this.
In short. I want to be able to store information for each item so that I can access it. Is there a way to do this in AS3 with a Loader or is there another route I can go? If I do this with Arrays, how do I store the Index of the specific item so I can use that in reference to the position in each array?** Should I use getChildIndex() in the function for the Event Listener to reference the data stored in the arrays for each item? If so, how do I do so? ***
PHP Code: num = 0;var titleArray:new Array();function createImage(){ var thumb:Loader = new Loader; thumb.load(new URLRequest(url);
I have a small issue with instantiation of an xml loader class. I'm using a standard way of loading external data and assigning it to "myXML" variable. My class uses event.COMPLETE for loader to make sure that data is fully loaded. Everything works fine until I make an instance of this variable in to my Main() class. The trace of "myXML" gives me null. It's like it didn't assign data on time. Since the onComplete event handler should take care of any delays it is hard for me to figure this out.
I'm loading some external assets with the Loader class. I've done this a lot over the years, but seem to be coming across a problem I haven't had before. I want to display two instances on the stage at the same time of a .png I'm loading externally. If I use the Loader instance's contentLoaderInfo.content object in more than one sprite, the bitmap just "moves" from the first instantiated sprite to the second. I've tried duplicating the sprite with Senocular's duplicateDisplayObject class, but for some reason, it's not working right. But shouldn't I be able to use multiple instances of an imported bitmap like this just as if it were in the library of the .fla? If so, what do I need to do?
I've tried numerous times to get the URLLoader to work properly, but it never does. I don't know if it's a problem with my code or something wrong elsewhere. AS3 Code (pastebin) It's talking to my PHP ...here... which returns valid XML. No matter what I do, I get nothing but: Error #2032: Stream Error. URL:[URL]
I have a main movie (e.g called main.swf) and a couple of other movies which need to be loaded inside my main movie.Some of these should load inside a movieclip, and some should load inside a scrollpane. Now, whatever I do, i just can't make my Preloader show the amount of loaded movies properly.I even used the built in methods of scrollpane but it doesn't work at all.I use AS2, and flash CS3.The loader stops at 0% and after same time it goes to 100%.
Code: var l:Loader = new Loader(); l.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loop); l.contentLoaderInfo.addEventListener(Event.COMPLETE, done);[code]....
what i dont understand is that everytime i click the refresh page the loader shows up again(this time loading the image faster) but if the image is already in cache the loader should not show at all (?),i would like to achieve a loader that loads the image and after dont come up again everytime.
My need is to load 4 images at one time, and I'd like to have the code in a function that could load them one after another. But all I am getting is the last one of the loop iteration - I know it due to needing an onComplete, but I can't figure out how to make it all work passing it back and forth).
Code: function loadThumbnails() { for (var i:int = 1; i < 4; i++) {
On my first frame, I've placed an MC with an instance name of "ball" and entered the following script: ActionScript Code: ball.onEnterFrame = function() { if (Key.isDown(Key.LEFT)) { this._x -= 10; }} How do I create a time delay between the key being pressed and the ball changing position?
I'm with a doubt that is crashing my project over here. Example: I have my class....
Code: package { public class SoundPlayer extends CheckVersion{ public static var saveId:Object = {}; public function SoundPlayer($url, $vars):void{ trace(saveId[$url]) // here the class return to me the first call [Code] .....
If I access SoundPlayer.Init(), I pass my URL and my variables, I got the first access, but for example, when I save this variables on my constructor and want to access again with a different call, the flash output returns like "null", like... SoundPlayer.PlayInit("myId"); take a look bellow
Code: public static function PlayInit($url :String):SoundPlayer { trace(SoundPlayer.saveId[$url] as SoundPlayer); return SoundPlayer.saveId[$url] as SoundPlayer; } How I can access this variables in second time?
I've been playing around with custom classes. My objective was to create a custom class (Testing) that would create a box when an instance of the class is created. I've tried three different approaches, however only (3) seems to be showing up. I'm just curious why (1) or (2) doesn't work?
Also is there a better approach than (3)? Since at the moment it's been created on _root. I hope the box can only be accessible through the instance. Since I'd like to incorporate the whole idea of public, private, encapsulation, etc.
Hello Everyone I am trying to create a pre loader, everything works fine because I have traced everything and all is working but, my progress will not display in the designated bar, your help would be highly valued here is my code that's on the time line
ActionScript Code: var loader_text:Loader_text = new Loader_text(); addChild(loader_text)
is it possible to create a pre-loader using plainly Flex 4? I've seen tutorials on how to make one but each of them requires that I have Flash Professional or Flash Catalyst. I have absolutely no experience when it comes to implementing pre-loaders as well as making one.
I'm developing a gallery and I've just relised I've been creating a new set of thumbnails each time I click on the image category.There are four Categories and everytime I click on a category a new set of thumbnails gets created.How would I go about reusing the loaded thumbnails.I'm assuming I would need to create a separate Array to store the loaded thumbnail from each category. I am able to create the Array but how do I tell flash that the Loaded objects are in the array so don't create a new Loader and a new thumbHolder.[code]
I've been at this for a couple of hours chopping and changing all sorts of things so now im going back to basics and starting from scratch[code]...
all i am planning on doing is having an automated holder looping through 5 images, not even bothered about fading or anything for now, just need a dead simple loader to actually get me going again to give me something to build on
I have an array of external images that I am loading and the number of external images is variable, so I want to be able to create loaders to load them as needed. Is there a way to dynamically create and uniquely name a loader at run time?
Otherwise is there a way to pass the image content off in such a way that it will remain loaded if the loader is used to load other images?
I have been looking over the internet for a while about this, but it doesn't seem like there is any information available specifically related to captcah and flash.
My purpose is to create an image up-loader on flash, and implement "recaptcha" on it, so the upload is controlled.
I know that some people will say, "well you can't automatize flash input so you don't need captcha in this situation" even though this is somewhat true, there is still screen macro programs that could potentially make the computer upload hundreds of pictures if there is not something in place to avoid it.
I thought of implementing my own captcha but that seems to me like i would be reinventing the wheel, can anyone point me on the right track for this? or suggest another approach to avoid abuse on my image up-loader flash?
is it possible to create a loader and add parent to it,outside of a function or is there a function that runs once when the movie is started that i could add things like this into
I'm listening for a Loader to COMPLETE loading, and then I jump to a handler function "thumbLoaded". I would like to create a new Loader obj. each time I enter the "thumbLoaded" function. I would like this new Loader to be equal to the Loader that triggered the COMPLETE event. But I don't know the correct syntax to refer to that Loader. I'm trying to refer to the "parent" of the contentLoaderInfo object (ie, the Loader object itself). I've tried both "target.parent" and "currentTarget.parent". I get an error that says "parent is not a valid property of the loaderInfo object".
ActionScript Code: function loadThumb():void{ if (i < kitchensGallery_xml.kitchen.length()){ var thumbLoader:Loader = new Loader();
how can i create pre-loader for video files, because i tried to apply the pre-loader that i use with images, and it load actual and when it loaded appears in output pane that message "Loaded file is an unknown type" !!, and my video doesn't play...
this is my code
Code: Select allstop(); var video:Video = new Video(320, 240); var nc:NetConnection = new NetConnection(); nc.connect(null);
I am loading a fairly large image file and want to create a bitmap of the loader content. I want to then use this Bitmap and resize it according to the current dimension of the stage. However, I also want to keep the loader content as "originally loaded" as a reference in case the stage is resized and the user wants to view this particular image again. The way my AS is written as of now, I am manipulating the loader content. How do I not do this? How do I "copy" the loader content so I can manipulate the bitmap copy while leaving the loader content unaltered?
<AS> var lightboxImage:Bitmap = new Bitmap(); function resizeLightbox():void{ lightboxImage = myLoader.content; lightboxImage.width = myLoader.content.width; lightboxImage.height = myLoader.content.height; [Code] .....
I am working on Flash,Php site.Currently the Flash Developer calles my page called createJPG.php and sends me an image data.I recieve this data and create JPG from the Data.
What i want is, when the Flash developer send me data he can show a loader and when create JPG process is complete he can hide the loader.For this i want to pass him variable with value 1 as soon as the CreateJPG process is complete...
I'm loading an SWF animation and want to display it in multiple places concurrently, but the only way I could figure out how to do that is to load it every time I display it, as seen here:
private function playSounds():void { for (var i:Number = 0; i < 14; i++) {