ActionScript 3.0 :: Communicate A Variable From A Main Swf To An Loaded Swf?
Jun 25, 2010
I am comming from AS2, obviously. I have looked at many of the post people have to get "something" to be avaialble on a root type method, but I haven't found anything that has worked for this yetFor those who are saying "you're missing the point", and the rest of the "this is a bad idea" or "not needed" comments would you mind detailing the process of making a variable avaiable from a subMovie to a mainMovie and from mainMovie back to subMovie; or changing the property to an object inside of a SWF that has been added to a movie using addChild()?These are the constraints I have to work within. I can't restructure the 100-150 some odd pieces that are already in existance using AS3. New funtionality is needed that requires communication between the two movies.
View 6 Replies
Similar Posts:
Sep 4, 2008
i am using flash cs3,i have a main movie that load many swf using a document class..i need to pass "userid" variable from the main movie to loaded swf so they can change their content dynamically.
View 7 Replies
Oct 9, 2008
How to read a variable from main.swf (that load content.swf) and use it inside content.swf?
I have a variable called TextColor = "Green" in the main movie and I want to read this variable from inside the content movie?
View 5 Replies
Feb 2, 2009
how do I get my child swf to communicate with my main swf?
(this is main1.swf)
var homeRequest:URLRequest = new URLRequest("window1.swf");
var homeLoader:Loader = new Loader();
[Code]....
Obviously, MovieClip(root) is not getting to the main.swf's root timeline. What code do I need to do this?
View 1 Replies
Sep 22, 2011
i am using attachmovie to load a movie clip from library into an empty movie clip. Everything works ok but now i have a problem... i am trying to create a button that is inside this movie clip that goes back to the main timeline on a certain frame and also unload that certain movie clip
I tried all sorts of things but none work...is there a solution to this? Cant a clip that is loaded with attachMovie communicate with main timeline?
View 1 Replies
Jan 2, 2010
i am creating a survey with say 7 questions. each question has the same MovieClip symbol each with a different instance name, like q1, q2, ... q7.
the MovieClip symbol has 5 static texts and 5 SimpleButtons. i have some code in that symbol to make sure that only a single button has the "on" or "checked" state to show that that one is chosen. this works great.
my question is, how do i communicate each user choice with the main timeline after the user hits the "submit" button? or, how do i have code under the "submit" mousedown event that can iterate through the 7 symbols to query each one and see which of the 5 SimpleButtons is "checked" or "on". this iteration will then create a list of responses for all 7 questions.
ultimately, i will have flash concatenate a GET POST string that will send the survey results to a web server.
View 4 Replies
Jan 3, 2011
i have a mp3 playlist which loads externally into my main timeline into an empty container movie clip...When user clicks play button on playlist i want some animation to happen in my main swf... So if i add an Eventlistener on my play_btn... how will Flash understand that button was clicked?
View 1 Replies
Mar 8, 2009
I started learning the basics of as3.0 a year ago by doing a lot of experiments.. I never read a book or took lessons or something.. I guess i'm still missing important logics when i'm programming. I'm creating my personal flash imagegallery but I can't figure out how to communicate between a loaded swf and its parent swf.
I have a main.swf file with document class main.as which loads external swf files into a movie container. I am also loading a background sound like[code]...
The only work around I was thinking about would be to keep showing the stop/start sound button from the main.swf when a slideshow instance is called.. but then I'll screw up my design I want a second button inside the slideshow that can also stop the main bg sound.
View 1 Replies
Dec 23, 2010
I have a external swfs that I am using as skins for a app launcher. They are loaded in to the main movie via xml and loadMovie.How can I pass intervals and as commands to my skins. I need to send things like:button command for closing projectorvar clockValue for clock text fields in the skinxml menu info to nested movieclip in skin.swfI was thinking shared libraries, but I want to load the skin.swf dynamically with my xml, and I want the skin to maintain its structure so the ui style can be completely changed, instead of just placing mc's in the same place each time with only a slightly different theme
View 8 Replies
Aug 3, 2006
I have a site I am building in AS3. I have a main SWF, site.swf, that loads the subsections as seperate SWF's only when a user clicks on them (to save on initial load time).or my subsections, I need to be able to communicate with the SWF that loaded it. In AS2, this was simple enough - just say something like_parent._parent.gotoAndPlay("something"), and step up enough levels to speak to movie clips in the main SWF.Trying to do this in AS3, however, results in errors such as this when trying to compile my subsection SWF:Code:TypeError: Error #1009: Cannot access a property or method of a null object reference.... because it thinks I am trying to communicate with something that doesn't exist. The result is that I can't compile my subsection SWF's.For example, I am unable to reference a variable in the main SWF using this code in my subsection SWF:
View 8 Replies
Mar 5, 2010
I am building a highscore system for my site, and I was wondering how to communicate with classes that are included in an external swf that i've loaded in.
Basically, how does mindjolt do this:
[Code]....
View 1 Replies
Jan 14, 2009
This has quite a long background history, so I`ll first ask the question: how can I make a loaded SWF file activate a function inside another loaded SWF file - both in the same 'parent' movie, domain and directory - when the user clicks a 'link' on the first swf?I'm new to actionscript, been only working with it for 2 months and I've been learning on the go. So far, so good, flash cs3 help has been useful, as well as this forum and other sites. My project is a website, no innovations, just simple info and light animations.The site should have an intro page (I called it index), a preloader, then the actual site (home), with links to each specific area (pages). In home, a small slideshow movie clip should always be on the upper left corner looping images until the user clicks a link to a page, when the slideshow fades away. With this briefing, I made a file for the index, and a uiloader in it would get the home file and that 'should' be it.My stage resizing event listener was working perfectly on home - standing alone - moving the slideshow exactly as it should. But when home was loaded inside index, the slideshow moved way more than it should never getting in the right place. After various unsuccessful attempts, I decided to move the slideshow into its own swf and load it directly in the index, together with the home file. This way, I managed to make it relocate precisely, but got myself the problem I'm asking here. I need to get the slideshow to fade away when the user clicks a page link, but they are separate files.
I tried to use a Loader.content based function, located at the index, but figures Flash help was not exactly clear on how I had to use it properly, so I did not manage to get it to work. It always reported an unspecified property. I searched around here and over the net, found similar problems and their solutions but could not resolve my problem. I think this is a little too specific..
View 1 Replies
Mar 6, 2011
I have an app with a setup page that requires the user to select a scenario for a quiz. Their choice determines the content that's loaded next.
With as2 I would have used a global variable to indicate the users choice but of course that's not longer an option, and I don't think I can send an event because the next page isn't loaded yet.
So how do I communicate with a class belonging to a dynamically loaded swf that isn't loaded yet?
View 1 Replies
Apr 6, 2011
I have a heck of time here with an issue. I have an xml document that when a certain button on the stage is clicked it loads it's corresponding external swf into an empty movieclip on the stage. This empty movie clip is a holder for all external swfs.So what I'm trying to do is when an external swf is loaded that has buttons on it, I need those buttons to communicate with the main timeline and remove a mc that is on the Stage. I need the currently loaded swf(s) to be able to do this.So whatever the currently loaded external swf is that's loaded, I need it to talk to the main timeline. (I have quite a few external swfs that need to do this) So I imagine I need to somehow target the currently loaded external swf to get it to talk to the main timeline.The code below in summary doesn't work but it doesn't give errors either. I don't pretend to know what I'm doing and I haven't been successful in searching for a solution to this particular issue.
// main timeline object
var index:Object=this;
function loadComplete (e:Event) {
[code].....
View 3 Replies
Feb 8, 2010
I have 2 movie clips, one being loaded into a container MC via "loadMovie();"In the main movie there is a variable with no value, in the external movie there are 5 frames, each with a value to update the variable in the main movie.
IE: if on frame 1, global value = 1 / if on frame 2, global value = 2 / etc etc I'm familiar with passing variables INTO an external swf, but am stumped on how to do it the reverse way.
View 1 Replies
Oct 14, 2011
I have a parent swf with three buttons: next button, back button, ticker on/off button.I have three child swfs, each with a ticker mc. When I click on ticker button on parent swfit dispatches a custom event which brings ticker MC on stage and thus ticker becomes visible (ticker off button displaces it out of stage by changing the value of ticker_mc.y).
the problem I am facing is when ticker is on and I click next or back button to load next or previous child swf, the ticker goes off. How can I make sure that ticker is on all the time and closes only when I close it. How can a loaded child swf 1 communicate to next child swf, child swf 2, which is currently not loaded, that since the ticker is on on swf 1 so you please keep the ticker on on swf 2 as well?!
I think I know the problem. I have put a default value of ticker_mc = 160 (makes ticker inactive) on every child swf. So, the ticker becomes inactive everytime I load a new child swf. If someone could guide how can I do this, my problem will be solved: When first child swf is loaded, the default value of ticker_mc.y should be 160. I want to hold this value in a variable. When I click ticker active btn, position of ticker_mc changes to 194 so the value of variable should change to 194. When I click next btn, the variable value (160 or 194) should be sent to next child swf and ticker_mc.y should be equal to variable value.
This is the code so far
"Next button"
go_mc.next_btn.addEventListener(MouseEvent.CLICK, playNext);
function playNext(e:MouseEvent):void {
if (swf_no < (clips.length-1)) {
[code]....
View 1 Replies
Dec 21, 2009
Working in AS2, using CS3 Flash Pro I've simplified this to just the one little thing I'm trying to do.
countervariables.txt has this text in it:
[Code]...
The trace shows itemsPerMili as 'NAN' and totalForYear as 'undefined'. I know itemsPerMili yields 'Not A Number' because totalForYear comes up undefined, but oddly, the loaded variable does show up correctly in a dynamic text field assigned to the variable. I don't understand why it should show up in the dynamic text field correctly when it won't trace.
I want to see the number "3.80517503" in my trace for itemsPerMili.
View 3 Replies
Jun 11, 2009
I am using loadmovie to load in swf in my main swf.
The FPS of my main timeline is : 20FPS
The SWF I am loading is : 8 FPS
When i load it in it is automatically changed to 20 FPS.
Is there anyway to lock FPS?
View 2 Replies
Nov 17, 2009
i want to loaded a swf into my main swf file. How do I place it on the main timeline in the main swf. To be exact I have a frame label called about. Where i want the swf to be.[code]
View 7 Replies
Mar 13, 2012
I have some swfs that i want to combine: I have the main.swf that containes buttons, and i want each button to lead to an external swf. I have already done that.What i dont know is how to return to main.swf. I want all external swfs to have a button called "Back to menu" and go back to main.swf
View 3 Replies
Jan 7, 2010
I have a site that I'm working on that I am loading an external swf page into a main one. The main one is based on a totally liquid state and stretches the background to fill the browser and the components are relatively position based on browser window dimensions.
Now inside of the main swf I load an external swf through the loader command. This swf has a set dimension and stays centered in the stage.
I am trying to make a button in this swf that loads yet another swf that is stretches the full browser. However I do not know how to access the properties of a main swf from this external one, or if this is even possible.
View 3 Replies
Jan 4, 2011
I am loading an external swf and I want it to overlap my main swf. I have been trying to figure this out for days. Check my link to see what I am talking about
[URL]
when you click on about the swf loads, but it leaves a little space on the right where you can still see the main swf underneath... you can also check my FLAs if you want...download here
[URL]
View 1 Replies
Mar 18, 2003
i have a movie that loads a 2nd movie on a button action. The second movie has some other buttons ("co" & "me") that makes some text pop up with easing. This is the code below. The problem is, the second swf works by itself, but not when loaded into the main swf. I've tried changing _root to _parent as well as various others, but to no avail? Is _root my problem??
[Code]...
View 1 Replies
Oct 25, 2005
is it possible for a loaded swf to control the timeline of the main swf or even to tell the main swf to unload the loaded swf just by pressing a button in the loaded swf.
View 2 Replies
Sep 26, 2006
I have a website up at [URL]. The thing is that I have flv files being loaded by swfs that are loaded on a movieclip of a main swf. Locally everything works fine but as soon as I move it up the web or even try to run in over my home network, the flv files won't run. Can the flv run inside a swf that is loaded into another swf? I have set the paths to relative already, this taking into account the main swf!
Something like this:
loaded_swf_folder/flv_folder/flv_file.flv
If I didn't take the main swf into account it would look like this:
flv_folder/flv_file.flv
But I tried this already and it didn't work at all. Except if you run one of the loaded swf directly instead of through the main swf.
View 2 Replies
Jun 7, 2009
I'm trying to control my main.swf through a loaded .swf.
My goals are. 1. load the external swf into main.swf and have a movieclip in the external swf play. (the movie clip in the external swf should play without any code, however, when the external swf loads, the movie clip goes to the last frame of itself for some reason)
2. I have an "X" button on the loaded.swf itself that should dismiss the loaded swf and cause my navigation on my main.swf to reappear.
Here is my loader code in main.swf:
Code:
var _urlx:Loader = new Loader();
_urlx.load(new URLRequest("loadBlank.swf"));
var _url1:Loader = new Loader();
[Code]....
As of now, my navigation in main.swf does reappear when the "X" in the loaded.swf is clicked, but I need a way to unload the currently loaded swf when the "X" button is clicked..
I've tried remove child, checking to see if the loaded child is not null, but that didn't work either...
View 3 Replies
Aug 3, 2003
using the command:
loadMovie(_root.section, _root.content);how would i work in a preloader bar?? add one to the file that is loaded into the main movie or on my main movie that is loading the file?
View 1 Replies
Feb 21, 2007
Can you change a variable of the main Fla with code that is is an externaly loaded swf?
Is this what a _global variable does?
View 2 Replies
Aug 23, 2007
Does anyone know how to pass a "page" variable thorugh link to a main .swf file (index.swf)?
The file would normally load "home.swf" into it if accessed by But I would like to able link to a different .swf determind by a varible like "page = contact.swf"
View 3 Replies
Apr 17, 2009
I'm trying to add a value to a variable inside the Main .SWF from a loaded movie. More clearly,My main movie name is Main.swf. On the main timeline of Main.Swf, I have a variable named currentMovie.Now, I have other movies that are loaded into Main.swf. For example, cars.swf is loaded into Main.swf.What I want to do is have code in cars.swf to add a value to the currentMovie variable in the Main.swf. I just need the correct syntax.
for example,:
MovieClip(parent.parent).currentMovie="some_value" ; is not working for me...
View 3 Replies