ActionScript 3.0 :: If Statement For Removing Video Instance?
May 3, 2011
is there a way to remove a video instance from the stage with an 'if statement"?
Kind of like :next1_btn.addEventListener(MouseEvent.CLICK, ongoPage2);
function ongoPage2(Event:MouseEvent):void {
I selected all my stuffs & make them into a symbol and when i break the symbol up all the instance name was removed. Is there a way to break up the symbol without removing the instance name?
I am trying to make the instance 'red' be removed when all 3 objects have hit it here is my code:
var hit = 0; addEventListener(Event.ENTER_FRAME, hittest); function hittest(e:Event){ addChild(blue);addChild(green); addChild(pink); addChild(red); [Code] .....
in my main I have a system that allowed certain classes to be loaded and unloaded. When I load Game.as, it contains a trace statement when you press the left arrow key. When I remove the game instance from the stage, and set it to null, I can still press left arrow key, and the trace will come up. If I then make a new instance of game, it traces twice with only 1 click. When I close/load another time it traces three times.
I very specifically set:
Code: mainContent.removeChild(game); game = null;
Even trace statements confirmed that the game was being nullified, and the trace still continued.
Alright, so really I am having 2 difficulties here.
1) When a bullet hits an enemy, if 2 zombies are beside eachother, the bullet hits them both -- How can I make it so the bullet can only hit one?
2) When an enemy has health of 0, it dies, I am trying to get the enemy to be removed from the array that the bullet searches through so it will no longer be affected by the enemy, but it doesnt seem to work, the bullet still hits where the enemy was, as if the enemy is invisible.
I am working on a video player that will have different Languages. The problem that i am have is that i can get the video to switch but i cant get the video to switch back. I have uploaded the file and here is the code that i have have a problem with.
lang.onRelease = function() { if play = English) {
So I have a 5 page website, on the home page when I opens you see a video and it automatically plays. When you click to a different page though you can still hear the sound in the background. The video has an instance name of video, I tried using video.stop(); in the code for each button and it works but then it doesn't allow me to navigate when it isn't away from the home page.Here is the code I have for one of my buttons (it's the same for the others with different names though):
home_btn.addEventListener(MouseEvent.CLICK, gotoFrame); function gotoFrame(e:MouseEvent):void {
So I have a 5 page website, on the home page when I opens you see a video and it automatically plays. When you click to a different page though you can still hear the sound in the background. The video has an instance name of video, I tried using video.stop(); in the code for each button and it works but then it doesn't allow me to navigate when it isn't away from the home page.Here is the code I have for one of my buttons (it's the same for the others with different names though):
When this video page loads, it displays a white stage background, even though I've tried every method I know to make the bg color black. What am I missing?
I have a an fla made with GoToframe, when a btn is clicked an .swf is loaded on to the stage. there are two buttons that load video galleries, but when any button is clicked after the video gallery the UI loaders work but the video stream remains playing.
I have some code in the first frame of my movie. It loads a streaming video using netstream (fl_NS) and displays it in fl_Vid.I want the user to be able to click a button to make the video fullscreen then press a keyboard key to make the video back to the small view - which almost works. I can make the video fullscreen and make the video shrink back down. Unfortunately, the last frame of the enlarged video is stuck in the background (on top of the HUD).[code]
I use the Youtube API for Actionscript 3 to dynamically load Youtube videos.
[URL]
When I remove the current video using player.destroy(); and stage.removeChild(), the video goes away. But when the newly loaded video beginning, the sound track from the previous video plays in the background.
Having a few problems with what I thought was a simple if statement. Here is the code:
[Code]...
I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.
I need to have scrub thumbs for video player load and unload repeatedly. Something isn't getting cleared. Every time the thumbs are removed, there's a slight increase in the cpu baseline - something is piling up in memory.
The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);
The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.
Does creating a new instance of an Object that uses an identical name to an older instance, delete the previous instance? Or should the original instance be deleted first? The code uses a ridiculous amount of XML vars. Isn't it less memory intensive to parse the XML and save the properties to an Object, and then delete the XML Object, rather than keep the XML Object around and reference it's child nodes directly? Is it better form to break up a huge XML file (>600lines/3200vars) into smaller chunks?
I did a file/import/video and pointed to a video on my server and this is all on the first frame. On my aa layer I have the following[code]...
As you can see, when the video finishes, it hops to frame 2 and continues to the website. What started happening on a few occasions, is the timeline would randomly jump back to frame 2 for no apparent reason. I'm assuming it's because I didn't remove the instance of the video, or something along those lines? This whole issue on;y started when I introduced the video.
I have a movie clip that needs to loop inside a movie clip in Flash. Would someone post the code to paste into the ActionScript window? The .flv has no skin on it. I have done this so that I can put the video file outside of the Flash movie.
I have done work in dreamweaver before but decided to try and move into the flash scene some. Well I'm putting together a multimedia photography site and made a slide show with Flash Slideshow Maker Professional to create a .swf slideshow file. I am using actionscript 2 and have a placeholder with the instance name of empty. So the script I'm using is:
Is it possible to use the FLVPlayback class to play an instance of the Video class? I'm loading the video (which is just an audio track with cue points) in using GreenSocks LoaderMax (along with the rest of my assets) and so have various instances of Video. The FLVPlayback class only accepts a String as its' source. Is there any way to hack it to bypass whatever loading it does and just feed it the video directly?
I need to load a youtube clip into a "embed_video" instance. I have a input text box where i want people to type there youtube url and then press a play button and the video plays in the next frame in different windows which are moving.
I have been looking around but couldn't find a good tutorial or solution to my problem. I have a slideshow type application (for my portfolio website). I have 4 "slides". I wanted to use video, I added it on slide #3, and it plays fine, control buttons seem to be connected, but when I click to go to the next slide, without pausing the video, it still keeps playing..., even though there is no instance of the flv playback on that frame. If I go back to the video slide, a new video starts on the top of the old one.... On exit from the slide I would like the video to stop. And on re-entering the frame the video would just sit there, after clicking play/pause it would resume.
I am using Stage Video and would like to implement video controls to this, like the ones utilised in FLVPlayback component. I am coming to the conclusion I am going to need to create a custom control bar entirely from scratch.
I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.
the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?
I have a script which is giving me a lot of trouble since I have no idea how to write another "if statement" inside another if-else statement. I keep getting errors, I guess I don't know where to put the braces exactly...
example: if(bla == bla) { <------------how would I write another if statement here? }else if (bla == bla){ }
However, either I'm declaring my variables at the wrong bit/way or there is another problem, as I have been able to add the child I want to from the display list (sidepoint: is it right to call the display list everything in the library on stage at runtime plus those things you have exported for actionscript usage??!)...but when I want to remove it at the next cuepoint nothing happens. I feel this is a basic principle that is alluding me here.
Code: vid.addEventListener(MetadataEvent.CUE_POINT, cueText); function cueText(e:MetadataEvent): void{