I have a class set up that should just spit back the duration of a loaded video file. It works, but my onMetaData handler seems to get triggered twice, even though I can only see one place that should trigger it:
Code:
public function PENetConnection (obj:Object=null)
{
When I enter incorrect values in the txtother.textbox and focuses out, an alert will be displayed as "Please enter a valid Format Mask." . After pressing the "ok" button in the Alertbox the txtOther.focusout even is triggered again. i.e. immediately after pressing the OK of alert, the same ALERT is displayed again.
I don't want to the alert to come again and again .. I need it in such a way that when the ok button of alert is pressed. The txtother.text should be in focus, and the alert should not come again and again as before.
I've got this for loop, but for some weird reason it malfunctions: - When triggered, it runs infinite times. - It only triggers when segmenten1 or segmenten3 are 0, which is weird, because it should also work when segmenten0 and 2 and 4 are 0...
Here is the for loop: stage.addEventListener(Event.ENTER_FRAME,addmetaal); function addmetaal (evt:Event) { for(var animteller=0;animteller<5;animteller++){ if (this["segmenten"+animteller]==0) { [Code] .....
It seems to me like that when any of the segmented variables hits 0, it should trigger 2nd for loop, and repeat that 4 times. The xco and yco are arrays which store values for the x and y coordinates for spwaning the addchilds, this works fine. the segmented variables are declared as following: var segmenten1:Number=17, segmenten2:Number=17, segmenten3:Number=17, segmenten4:Number=17, segmenten0:Number=17;
What I am wanting to do is move multiple MCs when a MC (acting as a button) is released, the following is the code that i have tried but it doesn't want to work:
How can I get a function triggered by multiple triggers? For example, a function that is normally triggered by a condition but also needs to be executable independently with a mouse click.
I am working on a presentation that has multiple scenes each having say 100 frames. Every 10 frames there is content on the stage, i.e. a 'slide'. There are left and right arrow buttons to take the user of the presentation forward and backward - much like a powerpoint presentation.Many of the 'slides' contain another button (instance name infoBTN) that can be rolled-over, and when this happens an info bubble pops up to display some information in the form of a graphic (instance name infoBubble).This operation works fine for one button, but I don't really want to have to call a new function and variable name and have new instance names on each subsequent frame that features a similar button with an identical operation.
how can I call the function just once and re-use it over and over again? There will only ever be one button of this nature on a given frame,This is the working code I have on the timeline for this particular frame:
Code: // INFO BUTTON MOUSE EVENT var fadeIn:Tween = new Tween(infoBubble, 'alpha', Regular.easeOut, 0, 1, 0.75, true);
I am extremely untrained in CS4 and Actionscript. However I have managed to get along fairly well until I started to dynamically upload images as a gallery. This works great if I have one gallery, but for my site I have 9 galleries!!! I have a back and next button, but I want to be able to use those same buttons for all of the galleries so they look the same. I have split them up and renamed them, but I am clueless on how to script the buttons to work.This is what I have now because I do not know where to put the other button names without getting errors.
stop(); next_btn .addEventListener(MouseEvent.CLICK, nextImage); var imageNumber: Number=1;
I have a image of a person that I would like to load a certain number of times in a row to show a total of how many people took part in this particular event. In total I need 166 replications of this image, is there any actionscript I can use to do this without having to create a key frame for every separate image?
I have this animated block that I want to use multiple times in a scene. Everything looks fine until I move the background(separate layer) with a tween. The second it moves it shows only one animating block instead of 4. Also, if I click on "show this layer only" it only shows the one block.So how can I use this movie clip multiple times?
I have an array of suffixes that I'm using to load images, some of which are used multiple times:
Code: for(i = 0; i < imageSuffixARR.length; i++){ var tempLoader:Loader = new Loader(); var loaderOBJ:Object = new Object();
[Code].....
I'm running into is that whatever loader calls the multiple used SWF last gets it. How do I fix this so that the same loader can be used multiple times?
What I want is to do this [URL] in actionscript rather than with tweens...as u can see, it takes EONS too long to load (on some PCs at least) (and I know, it DOES need a preloader (which I have), but I'm going to add that later. I want to get this going first). Now, I read a decent bit about onEnterFrame, and did some tutes, but I'm not quite sure how to use it to do what I want.
I have a large image that exceeds the bitmapdata limits, so I am trying to break it up into 4 separate images and encode them separately using the PNGEncoder. The first 1 comes out great. The remaining 3 all contain the same bytearray data and result in a blank image.
Code: public function encodeUsersDrawing():void{ pngImageQuadrant1 = new BitmapData(1875, 2400, true); pngImageQuadrant2 = new BitmapData(1875, 2400, true); pngImageQuadrant3 = new BitmapData(1875, 2400, true); pngImageQuadrant4 = new BitmapData(1875, 2400, true); [Code] .....
when I click a button it loads an SWF, then when I click another button it loads another SWF into the same loader. However it appears to be loading multiple SWF's in conjuction with the amount of times I clicked a button. So say if I clicked a button 3 times it would load 4 of the same SWF's on the forth time and load them at the same time.
Im sure there is a simple way to do this, but it's been driving me nuts for days now.I am trying to loop through all the data in my xml file, thats no problem, however I need to read the data three times for the menu I am building. Is there a simple way to do this? Basically I want to take the first set of results, then add on the second then the third. So I will end up with a list of data three times what is actually contained in the xml doc.
I'm creating a movie where I need to have several copies of the same external image.It seems that when viewing the movie in Firefox the external image is downloaded only once regardless of the number of copies I make, which seems correct.In IE the external image is downloaded once each time I copy it within the movie.And that just doesn't seem right.(I've upgraded both IE and FF to Flash Player 10.)For testing purposes I've written the following code
Code: var pages = new Array(); pages[0] = "images/Page_01.jpg";
i want to have multiple blocks moving over my stage, but i want use just the one mc in the libary and my function, what adds a new block with random color, alpha and speed.I think, that i have to use addChild();, but i have no idea how to use it properly.
Is there a way to make an item, which can be draged onto the stage mulitple times? Like in making beats in music apps. You select a sample and drag it into the stage.
I'm having trouble with sound in Flash. I may have went about coding the wrong way, because most of my codes are on frames.
So, I have these two variables
var outsideDay:Sound = new daysong(); var outsideNight:Sound = new nightsong();
And I want to play these songs on a specific frame. However, the sounds play sporadically, like 50 times at once. I think it's because I have other codes that link to the frames with a Enter_Frame function. How can I get the sounds to loop and not play multiple times at once?
i want to reuse an image multiple times within an item renderer, is it possible to embed the image and then reuse multiple times without having to go back to the server for the image? Is this the most performant solution?
This code is for my login component. I want to get a special string for encrypting my password. This string is given by my authservice. But when i login i get a multiple times a alert with Done(line 69 in the pastebin code or line 4 in the code on the bottom of this question). But i want that it shows one single time. Does someone know what is wrong with this code?
protected function tryLogin():void { encryptStringResult.addEventListener('result', function(event:ResultEvent):void { var encryptString:String = event.result.toString();
I have 3 movieclips each containing an audio. These will be dragged and dropped on stage.However I need to be able to click a MC and have it "copy", or whatever, it self to be dragged so I can drag n' drop a mc multiple times.So for instance lets say I have 3 movieclips a_mc, b_mc and c_mc, on stage.In the area I want to drop them lets say I want to do thisa_mc, a_mc, c_mc, -or- b_mc,c_mc,c_mc etc... but still leaving a_mc, b_mc and c_mc in there original area.
when I click a button it loads an SWF, then when I click another button it loads another SWF into the same loader. However it appears to be loading multiple SWF's in conjuction with the amount of times I clicked a button. So say if I clicked a button 3 times it would load 4 of the same SWF's on the forth time and load them at the same time.
My problem is that it only adds one instance of flag_mc to the movieclip. When I press the mouse down again, it removes my old instance and puts a new one. Is it possible to make it leave the old one and add another?
This works only the first time each button is pressed.What command do I have to use to change displayed language to that one that is allready loaded? Or how to unload existing xml from memory to force the autoReplace work again?
I used code to get alot of the same Movieclip to the stage every 3 seconds:[code]Then i wanna remove all those Moviclips (so that i can restart the game) but everything i've tried has yet to be a success.[code]
I have the same swf multiple times on one html page. And I have a movieclip follow the mouse's X position around. And when I mouse over each individual embedded instance they work as described, BUT on click all the movieclips follow my mouse's X whether I'm moused over their embedded window or not.
this is my enter_frame function
function arrowMouseFollow(e:Event) : void{ TweenLite.to(this.divide_bar.arrows, .25, {x: Math.round(swfStage.mouseX), ease:Expo.easeOut}) }
here's what I have - a custom video player that pulls everything from an XML doc. In that XML doc, I have three sections that contain start, middle, and end times (in seconds) for the video. The goal is to track how many times the start, mid point, and end of the video are reached.
This all works, however I'm encountering a strange action. When I play the movie, I get output that the start point has been hit, then I get three (3) duplicate outputs of the mid point getting triggered, and finally six (6) reports of the end point hit.Strange. The numbers change slightly, (1,3,6 and 2,4,10, and 1,4,8) times for each of the start/mid/end triggers.
Here's the code that I'm using:
("prefs.prefOmnitureStart", "prefs.prefOmnitureMiddle", and "prefs.prefOmnitureEnd" are the numbers in seconds that are pulled from the xml. In my example, they're 2.0, 6.0, and 10.0)
Code:
myVideo.addEventListener(MetadataEvent.CUE_POINT, cp_listener); function cp_listener(eventObject:MetadataEvent):void { myVideo.addASCuePoint(prefs.prefOmnitureStart, "sendOmnitureStart");