ActionScript 3.0 :: Click Outside Of Flash And Return To Beginning?
Sep 21, 2009Is there any as3 code that says if a user clicks outside of the flash movie, the movie will return to the beginning/frame 1?
View 2 RepliesIs there any as3 code that says if a user clicks outside of the flash movie, the movie will return to the beginning/frame 1?
View 2 RepliesI have just a play and pause button on a website I'm creating for a client that streams one mp3 song. It works great with the code below, but the problem is that when it reaches the end, it doesn't loop back to the beginning. I would like for the user to be able to press the play button at the end to hear the song again, or include another button that rewinds back to the beginning.
Code:
this.createEmptyMovieClip("sound_mc", 10);
music = new Sound(sound_mc);
music.loadSound("[URL]", true);
music.start();
active_button = "play";
[Code] .....
What code would I need so that once I get to the end of an application, you can click a button so it restarts going back to the beginning?
The button in question is called retryButton
I have a movie clip(a large image that has the same size as the stage) and a button in a square that is small (150x150) . The zoom has to be like this: I click on the button once and I have to zoom in (only once) exactly where the square is (in the center of it). When I click the zoom button again I have to zoom out and every thing has to be like like the beginning. This is the code I have:
[Code]...
I have three buttons, which starts three separate videos...click on button starts video, that's ok, but then video is not over, if to click again,it's not starts video from beginning. I'm talking about one video. I must push on other button and then on that again to start it from beginning.
ActionScript Code:
import flash.events.MouseEvent;
import fl.video.FLVPlayback;
vidPlayer.stop();
Object(this).1btn.addEventListener(MouseEvent.CLICK, button1);
function button1 (e:MouseEvent):void{
[Code] .....
Is it possible to do something similar to this pseudo code?
var oMouseListener:Object = new Object();
oMouseListener.onMouseUp = function() {
if (Mouse.clickTarget is a MovieClip) {
[code]....
Is it possible to do something similar to this pseudo code?
var oMouseListener:Object = new Object();
oMouseListener.onMouseUp = function() {
if (Mouse.clickTarget is a MovieClip) {
[code].....
I am trying to recreate an effect like the clouds on[url]...I would like to be able to click and drag on an object then once mouse is released the object would dynamically return to start position. I am struggling to get my script (AS3) to dynamically return it to original location.
View 1 RepliesI am trying to recreate an effect like the clouds on [URL] I would like to be able to click and drag on an object then once mouse is released the object would dynamicly return to start position. I am struggling to get my script (AS3) to dynamicly return it to original location.
View 2 RepliesI have a Flash app where I call the first frame over and over. I have a script, that I need to be executed just once at the beginning. Where should i put it? Obvioulsy the first frame isn't a good idea, the script is called to many times. Is there some place for this or some function that would allow me do this?
View 2 Repliesi was making asimple menu .
ActionScript Code:
var currentLink:MovieClip = a_mc;
//buttons mode[code]...........
when i click on the button the alpha of this button will be 0.5 , when i click on another button the alpha of the previous button is still 0.5 , and so if i clicked on all buttons the alpha of all buttons will be 0.5,,,i didn't want that , i want when i click on the button , alpha return to 1 for the previous button .
- i have 3 separate movie clips (a,b,c)
- my main movie is (a) and when i click a button there, it will go to external movie (b)
- under external movie (b) there's a movie clip that includes my animation and content button
- if i click on the content button on movie (b), external movie (c) will pop up [ it will not replace movie (b) but will just overlap it, it's like a small pop up ]
i did the actionscript and when i'm testing external movie (b), it's working... it's showing/popping up movie (c) but when i tried it on the main movie (a), the movie (c) is not popping on the (b) err, sorry if it's a bit confusing / how i explained it. but hopefully somebody will get the idea. and it won't also return on the main movie (a) when i click on a link from the external movie.
I have a flash CS project. I have one stage and some frames. How can I start all project from beginning using AS3? Or start all stage's content from beginning?
View 1 RepliesI was just wondering if anyone knew what software was used to achieve the ribbon effect at the beginning of this flash template: [URL]
View 2 RepliesAt the end of my SWF video (FLV + XML for closed captions), I want to go back to the beginning of the video, but not replay it...so that when users have finished watching it they have the title page to look at instead of a big black box.
View 1 RepliesI need to know if it�s possible to use flash in a game so that the players can chose a button in the beginning and then connect this button to a movieclip which this button should control?
View 1 RepliesI want to build a flash file with a textfield for people the put in there emailadres in. Then a flash movie will play. On the end of the movie i want flash to send a automatic email to the adres that the person filled in at the beginning. It will be a standard email text that everybody will recieve that watch the movie and filled in the emailadres.
View 1 RepliesI just upgraded to flash player 10.1 and there's an issue with a program that I've been working on. I'm copying text from a mysql table that is formatted with spaces and newlines (including spaces and newlines at the beginning of the text) into a textArea in Flex 3.5. Before the update,it worked fine. Now when AS retrieves the text from the table, it does not include the spaces and newlines at the beginning of the text.I'm using xml to retrieve the text.
View 2 Repliescan i define a flash event as double click or single click
View 3 RepliesI got some scrollable text in flash and want the first letter of the paragraph to be a largeer pt.
View 1 RepliesI have an flv file that i am loading externally and want to start the video of with no sound and let the user click the mute_btn to turn the sound on. I am having problems with the code. the video starts with sound on and i want it to start silent. what do i have to add to my code to make this happen?
[Code]...
I have created a X-mas card for my company. When the card opens, the 3 circles are buttons to different scenes within Flash. The text in the bottom left is a button to the final scene.
The card can be viewed here: [URL]
1) When I click on the circle button that has the red garland and tree ornaments in it, if you listen close at the very beginning of the scene, a squeek sound plays. I use this squek sound in the hamster wheel movie symbol used in other scenes, but not in this scene. I don't even have the sound in this scene of the Flash project anywhere. I can not figure out where it is coming from.
2) Does anyone have some optimization tips? My project file is huge and a lot of the people we will be sending this out to probably don't have the most up-to-date processers. Should I split each scene into it's own Flash movie that is only loaded when the button for that scene is selected instead of the whole thing loading?
Here is a link to view the .FLA file: [URL]
I have button1_btn on a frame in the beginning of this animation, and on that frame I script it:
button1_btn.addEventListener(MouseEvent.CLICK, showimage1);
function showimage1(event:MouseEvent):void {
gotoAndPlay("image1");
}
I also have other buttons that eventually take a different frame where that button isn't on.So I add it to the stage in that frame and assume it will gotoAndPlay("image1") again when clicked, but when I test the movie, and click it on the later frame, nothing happens.I tried maybe adding the original script to that frame as well, but then I test and it says I have duplicated script and doesn't work.Why does the original script work for that button, no matter where and when it shows up?It's the same button essentially, no?
I have four photos which dissolve into one another in Flash CS3. I would like this to loop continuously with the last photo dissolving back into the first photo. I have searched extensively for a solution with no results. Does anyone know how to do this? Here's what I've done so far: [URL].
View 10 RepliesI've bought a website template, and im trying to change a few things in the flash. this is the site at the moment:[url]..
i want the menu+header to be played only once a day from the beginning, because its pretty annoying at the moment.
I've got two (possibly three) logic errors going on... Well, I say logic errors as the compiler and output windows are clear from any error reports.Error 1: Dynamic Text Field*~EDIT~* PlayerText is declared at the beginning of the as and if statement now tests its text not the object*~END EDIT~*
Code: Select allif (PlayerText == null && !this.contains(PlayerText)) {
PlayerFormat.font = PlayerFont.fontName;
PlayerFormat.size = 21;
[code].....
I have a box with 5 pieces of paper inside
myArray1 = new Array ("1","2", "3", "4", "5");
I am going to chose a piece at random from the box
$i = random(5);
trace(myArray1[$i]);
That piece has now been removed from the box, therefor it has to be removed from the array, now how to remove from mid-array only beginning and end, so I thought of this:
Code:
for (var $loop = 0; $loop < myArray1.length(); $loop++) {
if ($loop <> $i) {
myArray2 = new Array();
myArray2.push(myArray1[$loop]);
}}
trace(myArray2);
How I have set this up, but I am thinking if the loop index of the random piece is equal to the random number, then skip that, else, put all the other pieces in a new box. But when I trace the 2nd array, it displays the random value. Is there any way to move everything from an array into a new array WITHOUT a certain element? I mean I know you can move a certain element via its array position, any form of array.pushNOT($n, ($n+1))
I'm having some troubles with the use of interface and inheritance in AS3. I've done lots of OOP in the past and what I'm trying to do seems obvious to me, but doesn't work in AS3. The question is : Is it possible to override a function that return an Object of class A, and make it return an Object of Class B which extends A ? It seems not to be possible, since I'm getting a signature error in Flash, when compiling. For example, the following set of class do not compile (the code in function definition doesn't matter):
[Code].....
Lets say i have a button on frame 1. And if you press it normal, you ll get to frame 2. But then if you click it on another way, you ll get to frame 3. How do i do that easy?! With another way i mean like shift click or ctrl click or is it an easier way?
View 3 RepliesBasically, I have an input box on a widget that sends information via PHP.
One of the input boxes is phone number. Everyone inputs number as normal, but without the country code.
Is there a way of me taking their normal number from the input box, removing the '0' and adding the country code before sending it (i.e. within a calculation/function/formula).