ActionScript 3.0 :: Menu Selections - External SWF And Events
Apr 8, 2009
I have a Main Menu swf with Menu selections. When you click on the Menu1 button it launches a separate swf file that will be doing allot of things. I have buttons, video etc. All with some sort of a addEventListener attached to them. Because the Main Menu is running and you have the option to select another button, which launches another swf, I am unloading the current swf. I can tell the video is still running in the previous swf because you can hear it. I use the SoundMixer.stopAll() and that stops the video. But what about all those addEventListeners?
This is what loads the external swf (Main Menu).
Lesson = external swf
var myLesson:MovieClip = new MovieClip();
addChild(myLesson);
myLesson.x = 205;
myLesson.y = 30;
[Code] .....
This is what unloads the external swf: I call this in a couple of places depending if the selection is in another external swf.
myLoader.unload();
I also have been noticing that the naming of instances is increasing allot in a few of my lessons. Don't know if that has an impact on anything or not. How do you control events running in a separate external swf from a Main swf or stop, remove them.
View 3 Replies
Similar Posts:
May 5, 2009
[Code]...
how to add addevents to the menus in the popupButton.
View 5 Replies
Mar 31, 2010
I'm trying to get an external swf to load when the flv content of another external swf finishes playing.
I've only been using actiosncript 3 for about a week and I've got to this point from tutorials, so my knowledge is limited.
This is what I've got so far:
Code for External swf (with flv content):
import fl.video.FLVPlayback;
import fl.video.VideoEvent;
motionClip.playPauseButton = player;
[Code].....
I'm starting to get an understanding of how all of this works, but it's all to new to me at the moment, so I'm sure I've approached it from the wrong angle.
View 1 Replies
Oct 2, 2010
TextField objects have a built in context menu containing items which target cut, copy, paste, delete and select all events.i would like to map keyboard keys and modifiers to these events to obtain their free functionality.
View 1 Replies
Mar 28, 2011
I'm having a problem with this menu tutorial I followed from ASGamer. I have done and used most, if not all of the tutorials from that site.Anyway my problem is their base menu class;
package com.game.scripts.menu
{
import flash.display.MovieClip;
[code].....
View 2 Replies
Sep 11, 2008
I'm not that knowledgeable with AS, but what I'm trying to do is display my selections from an array. Basically, there are some checkboxes -- from there the user ticks a few boxes, submits their preference and then the system tells them what they have chosen and acts accordingly. In this case, the reason there is an array is because the user is selecting which videos they want to watch, and the videos will then play after each other, once one of the videos has come to an end. At the minute, initially the array is set up, the user ticks the boxes, submits, then their options are added to the array. I'm having difficulty looping through the array to find only the values that have been chosen.
View 1 Replies
Jun 26, 2009
I'm trying to do some slightly more complex and strange things with input boxes say you had some writing in an input box and you wanted to find out what characters were before the flashing cursor thing (looks like "|").
View 1 Replies
Feb 17, 2011
I need to create a Flash quiz which validates combo box selections using a 'check answer' button and 'reset' button.On selecting the 'check answer' button an image of a 'tick' or 'cross' needs to be shown at the end of the combo box.
View 1 Replies
Jan 5, 2010
I am having some problems with a small survey swf i am making in actionscript 3. I have multiple choice questions on different frames using radio buttons and i need the users selections shown in a dynamic text button along each frame and also on the last frame of the survey.
Another problem i am getting is i need the last radio button clicked to be stored, so if the user clicks lets say 'rb_2' on frame 1, clicks next to go to frame 2, then if they were to go back to frame 1 again 'rb_2' is still selected.
Thought it would be easy using the 'Shared Object Class' but from reading tutorials i cannot get it working.
View 9 Replies
Mar 10, 2011
I have a grid made from dynamic boxes and I need to check each box to see if it is selected or not to perform a function..
Problem is I have 60 boxes in the grid - in the code below, there are only the boxes which need to be selected !
I still need to add the other 54 boxes and set them as .chosen = false;
Surely there's a more efficient way of doing it than my code ??
if(event.currentTarget.parent.getChildByName("m1").chosen == true && event.currentTarget.parent.getChildByName("m2").chosen == true && event.currentTarget.parent.getChildByName("m3").chosen == true &&
[Code]....
View 6 Replies
Aug 2, 2007
I have a comboBox that I need to associate different email addresses with the different selections (the "selections" are the labels of the comboBox - not the data... the data fields for the comboBox are blank). right now, as written it returns "email2" no matter which I pick.
Code:
if (comboBoxName.getValue() == (("selection1") || ("selection2") || ("selection3") || ("selection4") || ("selection5") || ("selection6") || ("selection7") || ("selection8"))) {
var comboSelectionEmail = "email1";
} else {
var comboSelectionEmail = "email2";
}
Also, is there an easier way to do this than by using the if statement?
View 14 Replies
Jul 31, 2009
I just got CS4 and was following some tutorials for what I wanted to do. I Created a button and then inside of that button I created a movie clip in the keyframe "Up." In that movieclip I created a keyframe at frame 10 and created motion tween. I went to put a stop action in frame 10 and it says the current selection can not have action applied to it. I cant write any code for the button at this stage and I am not sure why.
View 7 Replies
Nov 18, 2009
using actionscript 2, and perhaps some XML or whatever, is there a simple way to save selections or text entered by a client? I would hate to have to learn 2000 pages of another language or default to a "megaman" encryption technique example: [URL]
View 2 Replies
Jun 12, 2010
Is it possible to test or export only a small selection of a movie?
View 2 Replies
Aug 2, 2009
i have a main.swf and i load menu.swf into main
[Code]...
this works right on its own but when using addchild in main.swf the menu loads the button events work, even click but it will not load the associated file. If i place the menu code in the main.swf it loads all required files. QUESTION How do reference menu.swf when loaded as an external swf?
View 2 Replies
Oct 11, 2010
if there's one thing i miss about native programming for Mac OS X using Objective-C and XCode, it's the ability to set #praga marks (essentially bookmarks) to easily navigate thru long scripts via the pull-down menu.
in Flash Authoring CS5 i can can collapse/expand selections of code, but these are removed when the selection is removed - whenever an edit is made. using collapse/expand selections would be an ideal equivalent to XCode's #pragma marks if it was possible to lock these sections so they don not disappear when the selection disappears, but as far as i know it's not possible?
View 1 Replies
Aug 12, 2010
I finally found a way to exactly position my External SWF on the main stage. Here is the Actionscript I placed on an empty layer:
Code:
this.createEmptyMovieClip("externalSWF",1);
externalSWF._x=550;
[code].....
View 2 Replies
Feb 12, 2011
I have a flex pie chart:
[Code]...
Basically, what annoys me is that when I click a segment to activate the interpolated event, the datatips disappear for it's duration. Whilst this is only half a second, it still detracts from user experience. Is there anything I can do to avoid it??
[Code]....
View 1 Replies
Jan 22, 2009
I have problems dispatching events from an external swf file.
The class that loads the file only receives the original events of actionscript (for example MouseEvent.CLICK, etc) and ignores others that are dispatched with a own event class or dispatched with a direct string in the type parameter. For example:
dispatchEvent(new PLYPubliEvent(PLYPubliEvent._OVERLAY_OPEN))
dispatchEvent(new Event("testtt"))
These events are dispatched from the loaded swf file in the main timeline.
View 3 Replies
Dec 21, 2011
I have a main application Planner.mxml. This view has a couple of custom components, one of which is LoginView.mxml. In LoginView.mxml I do the following:
protected function btnLoginClick(event:MouseEvent):void
{
try
{
[code]....
As you can see, when the user is successfully logged in, I want to dispatch a custom event; if not, I show an alert box. However, this event doesn't dispatch (or at least, I don't know how to listen for it).
I would like to listen for it in my main application where I can then change my viewstate to the logged-in state. However, the event never seems to get there. I listen for it by having loggedIn="loggedInHandler(event)" on my loginComponent.
View 2 Replies
Oct 18, 2010
i have a scripted button named button.swf.
when i load it from another swf an i assigin to it the onPress event, this cause to block avery event in it like onRollOver,onRollOut...
for example
//pseudocode
called.swf
var mc:MovieClip;
mc.onRollOver=somefunc();
[Code]....
View 2 Replies
Jan 6, 2011
I have been trying to pick up more as3 lately, also have been converting some of my sites from as2 to as3. In as2 I could create 3 menu buttons and save them in a mc- lets call it menu_mc. This menu_mc sits on my main stage. I have also placed a mc on stage to hold anything that I load. Lets call it holder_mc. So I figured out how to get my email button to work using this:
email_mc.addEventListener(MouseEvent.CLICK, mailto);
function mailto(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:myemail@mail.com");
navigateToURL(email, "_blank");
}
That's fine. What I can't for the life of me figure out is understanding how to click on one of my menu buttons and load a swf into my holder_mc on stage. In as2 I could use this code on a button :
on (release) {
//load Movie Behavior
if(this.my_holder == Number(this.my_holder)){
[code]....
View 1 Replies
May 15, 2011
I am dispatching two different events showbutton and removebutton from the code inside the LOADED SWF.on main file, (the one that is loading the swf file) i m listening for events and either showing or removing the buttons based on proper scenario. Here is he error i m getting.
ERROR 1180 Call to a possibly undefined Method Event - - - > dispatchEvent(new Event("showbutton"));
[Code]...
View 6 Replies
Apr 6, 2010
I'm new to Flex and am having trouble understanding Events. I think Events are what I want to use for my situation. I have 2 components, addUser.mxml and listUsers.mxml. I access these from a ViewStack in my main application. When I load listUsers.mxml it shows a list of current users in a datagrid via a HTTPService call. When I add a user using the form on addUser.mxml I would like the datagrid in listUsers.mxml to refresh when I return to that view to show the new user. I've tried several different things with addEventListener and dispatchEvent but can't seem to get it working. Can someone help me with this logic?
[Code]...
View 2 Replies
May 17, 2011
I want my flash movie to respond to rollover type events for links on my website. The idea being that the flash movie will provide descriptions of the links when moused over, but if the user doesn't have flash the functionality isn't lost. What's the best way to do this (if it's possible)?
View 1 Replies
Jul 6, 2011
I need to register events in flex and listen to them in java script. Is there any way other than using external interface.
View 1 Replies
Jan 15, 2004
I have an external .swf that I'm loading into a main one. The external one has actionscripting which reacts to the mouse. When exported on it's own, the scripting works fine but when loaded into the main one, nothing works. There are no references to the _root in the external swf either.
View 7 Replies
Mar 9, 2009
I have noticed that when I load an external swf, I lose my stage event listeners while my mouse is inside of the loaded swf. Is there a way to fix this?
Code:
// load the swf
var swfContainer:MovieClip = new MovieClip();
container.addChild(swfContainer);[code]....
View 13 Replies
Feb 4, 2010
I have been trying to pick up more as3 lately, also have been converting some of my sites from as2 to as3.
In as2 I could create 3 menu buttons and save them in a mc- lets call it menu_mc. This menu_mc sits on my main stage. I have also placed a mc on stage to hold anything that I load. Lets call it holder_mc. So I figured out how to get my email button to work using this:
email_mc.addEventListener(MouseEvent.CLICK, mailto);
function mailto(event:MouseEvent):void {
var email:URLRequest = new URLRequest("mailto:myemail@mail.com");
[Code].....
View 2 Replies
Mar 20, 2011
I have a game where sounds are triggered when things happen. These sounds need to be loaded externally so they can be changed. It seems like the sound class is just for loading streaming sound files. Is there a good way to load in these sounds and then have them triggerable and controllable by game events?
View 3 Replies