ActionScript 2.0 :: Load Two Movies On Same Press Event
Dec 20, 2005
I have a button, that when pressed loads a movie - works fine. What I wish to know is if it's possible (and how) to nest or add a function so that another movie loads at the same time. I'm using MX.
The idea is that when the 'good movie' is loaded, another small movie will load beside the button to indicate the active section.
Sample of what I'm currently using to load the 'good movie" is below.
Code:
blackWhite.onPress = function () {
_global.sectionPath = "Section1/";
_root.createEmptyMovieClip("container", 1);
[Code]....
There are actually seven such buttons in the main movie. So, for each one I want to replicate the adding of my external active.swf file into another empty movie clip.
Now, the above code works and pulls up the animation. When I tried to added another function to the button, only the second function worked (i.e., I got the symbol for indicating active state, but not the image gallery I've made).
View 5 Replies
Similar Posts:
Apr 16, 2010
I am trying to load some of my Flash Movies abit faster. I had read somewhere that i should use certain commands to bring the sounds out of the library after the SWF or page is loaded. I think i am suppsed to use Event listeners or call on the sounds somehow?? Does anyone understand what i am saying OR have any tutorials or links to tutorials that i can look at with regards to calling sounds?
View 1 Replies
Aug 13, 2009
Typically when you set an event handler function for buttons by code, like:
mybutton.onPress = function(){
trace("Hello!");
}
[Code].....
is that event function accessible from code? how? I know there would be a property that you can access it by, maybe we can "decompile" an SWF to check out finally which property it stores the event code
mybutton.onPress(); // This does not work!
View 1 Replies
Aug 13, 2009
Typically when you set an event handler function for buttons by code, like:
Code:
mybutton.onPress = function(){
trace("Hello!");
}
[Code]....
is that event function accessible from code? how? I know there would be a property that you can access it by, maybe we can "decompile" an SWF to check out finally which property it stores the event code in
Code:
mybutton.onPress(); // This does not work!
View 2 Replies
Jun 1, 2011
Within a specific canvas, I would like a user to be able to press a combination of keys which will trigger an event.(a bit like a cheat in an old megadrive game). Not sure where to start though. Anyone know if it is possible and if so could you give me a clue with how to start?
View 2 Replies
Aug 8, 2009
i have a movieclip named "mc" and i want to load many images in it and add on press event to those images.
For that, i have a button which is when click adds images to movieclip "mc".
I created empty movie clip in "mc" and loaded that empty movie clip with images. But i m not able to attach on press event to that empty movie clip.
Here is my code:-
In button :-
on(press)
{
_root.fun();
[Code]....
I even tried to add listener to movie clip (commented portion in above code) but that also didnt work.
View 2 Replies
Jul 6, 2010
I want to know how to automate a key press event in a mobile application (Flash Lite). i.e. the key press event should get emitted automatically without pressing the mobile key manually.
View 0 Replies
Jul 7, 2010
I want to know how to automate a key press event in a mobile application (Flash Lite). i.e. the key press event should get emitted automatically without pressing the mobile key manually.
View 0 Replies
Feb 21, 2011
im new to as3. I'm loading an external compiled swf. is it possible to simulate a keyboard "down arrow" key press event "say" every 10 seconds and send/target the external swf thats been loaded?[code]
View 4 Replies
Jan 30, 2009
I was wondering is there such thing as Listener which listens for maximize button press?
View 2 Replies
Apr 20, 2009
With the KEY_DOWN event handler, if the user holds the key down it fires the event constantly. I want to create a KEY_DOWN event which only fires once on the initial key press, even if the user holds the key down.
View 2 Replies
Sep 6, 2011
i need code for dynamic loading of swf file on button press event .it should load swf frm xml on button press in moveclip
View 1 Replies
Dec 12, 2010
What's wrong with my code?
function moveJoeOne():void
{
stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDown);[code].....
I've got two different instances of two different MovieClips on the stage of the fla. Visually they're identical but one is facing left and one is facing right. When the file runs, the one that's facing left appears on the stage while the one that's facing right is set to be invisible. What I'm trying to do is have the one that's facing left go invisible when the right arrow is pressed and for the one that's facing right to appear in it's place and accept further input from the right arrow key. When I run the file, the one facing left moves just fine. My problem is that when I press right, the one facing left disappears and the one facing right appears in it's place but it just moves once and stops.
View 2 Replies
Apr 11, 2005
I have sounds ( A-Z ) and when i press the A button i want the A sound to play , i have fixed everything . The button is pressed and everything works , except my sound! i tried just to have e sound in the frame and it worked .. How should i do ?
[Code]...
View 5 Replies
Nov 4, 2010
I'm trying to understand how AS3 works compared to AS2 when using navigation buttons to load external .swf files.
In AS2, I would have 5 menu buttons. Each button contained a script to load an external .swf file into layer 2 (on top of my existing movie). It would also contain a line of code to unload any movie that was already in Layer 2. This way new movies came in on top and were easy to identify when it came time for them to be unloaded.
Now in AS3, I can't find a similar way to work with external movies, since there are no longer layers. I create a movieLoader and add a child to it to load my external .swf - that works fine.But how do I tell each button to remove any children that already exist before loading the new child? The way it works now, the movies just keep piling on top of each other whenever I click a button.[code]...
View 4 Replies
Mar 25, 2005
[URL]My goal is to make all animations to load at once, because right now it only loads (loadMovie) on whatever you click, therefore there is a delay between the link you click and what will open.how you could preload all animations before you enter the site, I need your help, your any tip, and your advice on what code should I use.[URL]
View 1 Replies
Mar 18, 2009
I want to load different movies into the same area. Like the pic attached. click on the button and the related flv loads in area.
View 2 Replies
May 6, 2002
I'm trying to load several movies after the other.
with loadMovie:
loadMovie ("test1.swf", 2);
unloadMovieNum (2);
loadMovie ("test2.swf", 3);
unloadMovieNum (3);
As soon as movie 1 is ended I want that movie2 starts.
I want that the loading of movie (test2.swf) starts when test1.swf is ended.
View 4 Replies
Dec 6, 2010
I have a AS file called medaigallery.as which i can load as a Class but i need to load it when a button is pressed, or alternatively load the class from a frame in the timeline.
At the moment the Class is loaded by just linking to it in the Class box in the Properties window, which just loads this AS file at runtime, but is there any way to do either of the above?
View 6 Replies
Oct 8, 2011
I find it hard to think of a way to load a specific part of my XML when I press a specific button. I'll try to explain this as best as I can:
I am working on an App in which you can chose a character from a big list. When you press lets say character A you get a popup with info about character A. There is a button in here that will popup the art related to this specific character and this art will be added in unique movieclips so I can use each movieClip in a for loop to create an infinite scroll. Now the problem is there are 80+ different characters (and increasing every 2 weeks) and each character has an average of 4 arts, so giving them unique classes and solving the infinite scroll this way would generate A LOT of code. So I started thinking lets use XML. how to load just or show just the images related to the character you pressed.
I was thinking dividing the XML up like this:
PHP Code:
//XML
<CHARACTERS>
<CHARACTER A="URL" />
[Code]....
But how can I determine, at the specific press of a button, to load the unique part of this XML?
Wow that was a lot of text I hope I kinda made myself clear, and if I didn't I'll add some drawings to try to be more clear
View 3 Replies
Nov 24, 2004
why this code dosent work at the same time in the timeline, and why only envent put inside the attacHMovies or duplicated Movies work, if i put them in the forr loops they dont work.
[Code]...
View 10 Replies
May 11, 2009
I have a movie called "index.swf" and a class called "index.as" The problem is that loads the movies in the same position.index.as:
package {
import flash.utils.getDefinitionByName; import flash.display.Loader; import flash.display.Sprite; import flash.events.Event import
[code].....
View 7 Replies
Aug 14, 2009
I bought a template from flashmo which comes one main flash file and photoalbum fl. file. The main flash file plays swf. file from photoalbum. I like to create many photoalbums and play them on the main file.I have no idea how to do that. I spend hours and hours searching online but I cannot find information.The actionscript that is related to playing movie is below.
import mx.transitions.*;
import mx.transitions.easing.*;
//
var numMenuX = 605;
[code]....
View 0 Replies
Dec 5, 2011
im trying to do this in AS3? Is there any way to do this in AS3?.
myDate = new Date();
time = myDate.getHours();
if (time < 1) {
loadMovie("night.jpg","contentMC");
[Code].....
View 9 Replies
Mar 4, 2009
[code]...
i have a class name is Resoures above method is in this class
prob 1 : if mymovie1.swf loaded there is a button and if it click the mymovie2.swf should be load in same "container" movie clip
View 2 Replies
Jan 30, 2003
I have a scene with 9 buttons opening each a *.swf movie example: on Home I attach the action:
on (release) {
gotoAndStop (2);
}
// other buttons goto and stop frame 3,4,5,6...
on Frame 2 there is a blank keyframe with the action:
stop ();
loadMovieNum ("home.swf", 2);
unloadMovieNum (1);
unloadMovieNum (3);
unloadMovieNum (4);
[code]....
what about a *swf movie(1.3) loaded into a *swf movie(1.2) witch is loaded into a *swf movie(1.1)?can I unload movie 1.3 separately?
View 2 Replies
May 8, 2003
Ok, I know this is probally has a simple answer. but i cant figure it out. i have 3 buttons each controling a different movie clip. but the effect i want is when you click a button the assigned movie clip loads ontop of the other. basically this is because the movie clips are alpha tweens and i need that transition effect
View 1 Replies
Aug 3, 2010
I am trying to load 9 movies into a flash, I want them to be loaded randomly and to loop, right now I am using this script but it is playing them in a certain order. Is there a way they can be loaded randomly?
var mcl:MovieClipLoader = new MovieClipLoader();
var list:Object = new Object();
mcl.addListener(list);
[code]........
View 3 Replies
May 22, 2011
I have a video, 14 minutes long, at various times, I need to load information for a few seconds, and then unload it.At the moment, I'm doing it all in the timeline which works fine, however I'm limited by 16,000 keyframes which for the last video, was about 7 minutes (full video was 9).Is there a way to load and unload in 1 long action script file at the beginning of the video? eg (not actual code btw)
at 4 seconds, load 1.swf into container1
at 14 seconds, unload 1.swf from container1
at 16 seconds, load 2.swf into container1
View 1 Replies
Nov 6, 2003
I have the following code on a button that i am using to load movies into content_mc:
on (release) {
if (_root.section != "link1") {
_root.content_mc.gotoAndPlay("unload");
[Code]....
View 1 Replies