ActionScript 3.0 :: Replacing An EventListener After It's Been Turned Off. Scope?
Feb 2, 2011
The point of all this code is to meet 508(c) requirements for an online course I'm building. Texas law stipulates that all images be expandable�which is to say that if you click on the image that it will fill the screen�and I am loathe to build timelines for every image to expand them.
Everything works reasonably well until I add the last line within the deflateThis function. With the addition of that last line, the one that turns the eventListener back on, the sprite behaves as if the removeChild commands aren't there, and the damn thing won't work. When I remove the last line the sprite behaves properly, but the eventListener is now turned off.
Here's what's what: -square is a alpha reduced layer at z level 0 to reduce the distraction of the stage. -closeBtn is an AS instantiated btn that closes the sprite when the user is done looking at it.
I have a Debug class I've written, and I'd like to include a static trace() method in there, unfortunately I have no idea how to then access global / top level trace as effectively I've blocked it with the local static scope.[code]
I need to put an image up of a television and have a video of something looping in the center the image of the tv would be just that and a player would really be under the image playing the video.
I'm a blind developer who is considering learning Flex. According to this link when you compile a flex application with the defaults it isn't accessible to screen readers. Why is this, are there performance issues I should be aware of, or was this just an arbitrary choice Adobe made?
I have been working on a script for weeks now and had a problem saving the file so i tried saving it to another location when i re-opened the file my actionscript code which was in english has gone and been replaced by what looks like is Chinese or Korean ?
I have a Flash movie (.swf) file embedded within a webpage.I am looking to have an image display if the user does not have Flash installed or has it turned off.
I'm rather wet to AS3, and have been working on developing a site that can deal with a lot of content sections. Ignoring the fact that I haven't figured out button arrays yet, I was hoping to get some help on an issue I can't get past.
I've got a series of content movieclips which I'm controlling with menu buttons. As you can see below, they turn visible/invisible by clicking the menu buttons.
However, I can't seem to find a solution to reload the movieclips once a different menu button is selected, so each section stays forever in its previously "played" state when the button is clicked again. Is there a way to get the "content_section" movieclips to re-load or re-set once another navigation button is pressed?
I started an animation in flash recently and the autosave feature was turned on. I had a good animation, but decided to play around with it a bit. After a little while, I decided to call it a night and exited the program making sure NOT to save my work. Upon opening that file the next time, I come to find out that Flash has autosaved my file while I was playing around. Now I have a worthless animation, and have to start from scratch. Is there any way to revert to a previous save, or autosave at this point, or am I about to do a lot of work again?
Whats the deal with cs5? it had an inbuilt pre-loader which overrides any as3 pre-loading script - by loading the entire swf before even looking at frame 1. whats the situation here? Can the default pre-loader be customized or turned off?
for some reason my first attempt to post this didn't work so i will try again, and do it better this time... I would like to have a flash intro that then turns into the header/banner (size wise) with my (html) site loading below it. I'm not sure if this is possible or how to go about it, the idea is that it looks very fluid and slick.
How do I create and control a line of text that i turned into a button. I want to have a selected state built into the button. is that possible? Previously I created a light next to the text that changes color or highlights when the button had been selected, but I would like the text to change color when it is selected and have script that I can use to reset the button state when another button is selected.
Current button: Actionscript Code: S1.addEventListener(MouseEvent.MOUSE_DOWN,click_S1); function click_S1(evt:Event):void { Truck.gotoAndStop(16);}
I'm having difficulties with a game that I am making. Essentially it is a drag and drop game where you dress a doll. i have my doll on the stage and I have a pair of pants that I am trying to drag and drop onto her. I have turned these pants into a symbol called pants_mc, I have also gien them an instance name of pants_mc.
It appears that the flash variables are not accessible in Chrome when Javascript is turned off. Having said that, Youtube seem to work fine, when I test other sites like www.nhs.uk it does not seem to work, nor does mine.
I am using the most recent version of Chrome on Windows. Is there anything special that I need to target Chrome, how do I resolve this issue ?
however I restructured my folders and now my .fla is in the /src/ with my MainApp.as ( Document class ) then MainApp creates a new instance of a class that is in /src/blah/blah/deep/When this new as class is created it has a few buttons on it that are declared in the .fla as instance variables.I have turned off automatically declare stage instances.and declare it in my class like so.[code].....
I have a flash file with a background music sound object, and I have a video player at a particular section on the timeline. When the playback head goes to the section with the video player, I would like the background music to fade, but of course, I need the volume to be up for the video. The code I have works find to fade the audio, but the problem is that the video's sound also turns off.
This is the code at the beginning of the timeline: _global.volumeVar = 40; //Stores the current volume. bgSound = new Sound(this); //This block works finebgSound.attachSound("music");bgSound.start(0,99); bgSound.setVolume(0); [Code] .....
Further down the time line, in the video player section, there this code, which works to fade the sound, but seems to turn off the video, too: nInterval = setInterval(fadeOutSound, _global.volumeVar);
I am using an SWC library so that I could use the fl.controls.TextArea in my project in FlashDevelop. While working on an unrelated section of my code I noticed that all my TextArea objects had turned extremely blurry (both the text and the UI elements). I'm not sure when this started, but when I first added and setup the TextArea I spent a lot of time tweaking and configuring it and didn't have any issues with the sharpness of the object.
I just ran into an error I haven't come across yet. The player's seeking bar turned pink and so does the volume control. Don't know what would have caused it. That's what it looks like. And the link is the errors I'm getting when the movies finish playing. I don't know if that as anything to do with it. I tried to narrate what I was doing. [URL].
I'm working on a Flash movie that includes a simple on/off audio player. At the end of the movie it loops back to the beginning and plays again. if the viewer hits the sound off button it will turn the sound off untill the movie loops and then the audio automatically starts again. The viewer would then have to hit play again and then stop to stop it. Is it possible to fix this? I think that I ned to put a piece of code at the beginning of the movie to check if the sound is off or not and then to continue to keep it off if needed?Here is the code for the sound player I am using...
var mySound:Sound = new Sound(); var myChannel:SoundChannel = new SoundChannel(); var lastPosition:Number = 0; mySound.load(new URLRequest("GlidingOnAir.mp3"));
I now have radio dials on my radio which rotate when the user presses the left and right arrow keys. I now am trying to update the numbers in a display window of the radio so that as the user turns the knob the digital numbers in the radio will increase or decrease accordingly.
Here is the current code: var gasAmount:Number=0 stage.addEventListener(KeyboardEvent.KEY_DOWN, spinPointer) function spinPointer(ke:KeyboardEvent):void { trace(ke.keyCode) switch(ke.keyCode){ [Code] .....
i am teaching myself how to use localToGlobal(), and i seem to be running into a scoping snag, at least i THINK it is a scoping snag. So when i use Code:
[Code].....
i get the desired effect, yippee. That is to say, the output says 299, which is what the global coordinate of the movie is. However when i try use the same code in the main time line like this
I seem to be having difficulty in using the contents of a variable whan i receive the data from the database the script places the contents in a variable called myText1This I need to access outside the function.This is part of the script below.
mypath = "http://192.168.0.100/fedpest/pestReports/" mypath1 =mypath + "exterior.php"; var sendData = new LoadVars();
I have a function, and inside of it is a LoadVars object to load a variable. The problem is that I need the outer function to return the results of the LoadVars' return.
I have made a script, and now has come the point when I need to use removechild. Whenever I try this I get an error. After looking at the problem, I think I need to learn more about scope and packages. I think if I put everything in the correct scope, I will be able to use the removechild command. I tried to make all my vars public, so that removechild would work, however I got an error that anything public needs to be in a package. I tried to add the package part to my script, but got the error that packages cant be nested. I tried some other things and still no luck, just more errors.
So, if anyone could point me to a tutorial, or recommend a book or something, that will help teach me about scope and packages, Or if you are feeling patient and generous, and you think you could explain this problem to a 5 year old, please explain it to me the way you would to said 5 year old. If you maybe think you can help me out on the script, it can be found here: [URL]
A question about the variable within the for loop it is always stuck on False -- even if the first condition gets achieved.I read that the for loop variable is treated as if it is completely seperate varibale from the one in the main even if they have the same name
I'v attached a listener to a movieclip on stage but I can access any "global" varaiables which are out side the listeners function.I lose the scope or something what can i do about it? here is some code.
PHP Code player.controlbar.muteButton.addEventListener(MouseEvent.CLICK,mute0,false,0,true); public function mute0(e:MouseEvent):void {