ActionScript 3.0 :: Communication With Loaded SWFs, Application Development?
Apr 7, 2009
I am currently in the process of developing an application with Flash/AS3. I have worked a lot with AS3 (FlashDevelop) before so I am rather familiar with it, however, since I won't be the one designing (nor the only one for that matter), and because it isn't a one day job, it is important to be able to get some structure in the project. So that we can have a "core" of AS3 that loads SWF-files and then does the interaction with the loaded SWFs, like providing information for fields and submitting the data, etc.
However, I've searched and I can't find any good up-to-date information on how to actually take care of the communication with the loaded SWFs. I found a lot of tutorials on it, but every single one ended up simply not working or being "depreciated" by the compiler because they were built for earlier versions of AS2/AS3 or Flash. (I found this promishing guide: [URL].. but that too ended up being depreciated) The only working piece of information I've found is LocalConnection, but it is really not well-suited for this, and from what I can tell a very complicated way to go about things.
So my question is how does one go about implementing the communication between AS3 and the loaded SWFs?
Being able to dispatch events or call functions both ways is basically what I think is necessary.Or perhaps there are better ways to go about application development with Flash?
View 3 Replies
Similar Posts:
Dec 14, 2009
I am creating a Flex application with a component that displays various dynamically loaded SWFs, one at a time (kind of like a kiosk). These loaded SWFs are created in Flash IDE, not Flex. They will not be created by us (we will provide a .fla template but that's it), so I am loading them into a separate SecurityDomain.
My Questions:
I want the application to be able to call methods inside the loaded SWF. To do this, would I just call Security.allowDomain("domain original app was loaded from") in the startup process for the loaded SWF? I want the loaded SWF to be able to throw events that are caught by the application. Can I accomplish this through the SWFLoader.swfBridge property? I am defining an interface for the methods inside the loaded SWF. But, I don't want to leave the implementation up to the customer. Instead, I want to provide another SWF that contains the interface implementation and have it be a constraint that the customer includes it in their SWF. I am not very familiar with the Flash authoring environment, how would it work so that the interface implementation SWF exposes its methods in such a way to be accessible to Flex? Is there a way to sign the SWF so that the Flex application knows that it is dealing with the original, not a spoof? How would the Flex code pass in arguments, since it is across SecurityDomain boundary -- is there marshalling involved (say if I want to pass in a Dictionary or some kind of object graph)? The Flex application may load hundreds of these smaller other SWFs during its lifetime. How do I make sure it doesn't keep using up more memory? I plan on using SWFLoader.unloadAndStop() and clearing all references in the Flex object that refers to it. Is this enough? Will the AppDomain for the loaded SWF be torn down automatically so that the class definitions are no longer in memory?
View 2 Replies
Dec 11, 2007
I have the following scenario: one swf has a series of buttons that send play commands to 10 other swfs in the same html page (no frames). After some googling I found out swf to swf communication is done via LocalConnection. ( [URL]
a) every example I found is passing text strings from one swf to the other (what is written in the form field in transmitter swf 1 is echoed at receiver swf 2. I don't want to pass text, just want transmitter swf 1 send a play action to receiver swf2 that is waiting stuck at a stop action. What is the syntax for this?
b) all examples also have one swf sending to only one other. how do I differentiate which one of my 10 receiving swfs actually performs the above play action?
View 3 Replies
Jan 26, 2010
I have a main swf that embeds another swf. I want to be able to tell the embed swf to do something.
Main.swf
[AS]
//Creates new image loader
var imageLoader:Loader;
//Holder variable for the image to load
[code].....
View 1 Replies
Jul 12, 2005
I basically need to set up an interface in an html page with 3 different swfs in different spots of a table that need to communicate with eachother (basic stuff like going to certain frames within the targeted swf when a button is pressed, etc).
I'm pretty sure i've seen it done, but i can't seem to figure out what kind of approach i need to take. I'm guessing its going to take some javascript, but i'm not sure.
View 14 Replies
Mar 18, 2009
I want to ' import ' or ' download ' some SWF file into my main-swf file. I then want them to do a lot of communication back and forth. The best would be if I could just call functions from the new SWF file from my main-swf file, or the other way around. Do I use the loader class? And do I use the .parent.parent thing? Or is there a better solution?
View 3 Replies
Mar 6, 2012
I have some software developed where I have setup good communcation between some VB software and flash software. Communication is done locally via socket connection. I was hoping I could do the same except with two swfs. Who acts as the host? do I need a host?
[Code]....
View 1 Replies
Aug 20, 2009
So I saw the tutorial on Augmented Reality and it's really awesome, but where do I get the Flex Development application like at 0:06:30? and is it free?
View 2 Replies
Jul 21, 2011
Ok, modules in Flex are popular but I have no idea why documentation and examples on the different uses of Flex modules can be so scarce.Anyway, for this question, I will take the classic Employee/Department example. I have a main.mxml that contains an mx:TabNavigator. Each tab is loaded by an s:ModuleLoader.Tables: Employees {empID,empName,deptID}, Deparments {deptID,deptName}The Tab Navigator contains only one tab (for our example) called Employee. I have an Employee.mxml module. In that module, I have a datagrid that is populated with Employee details. I use the getEmployees($deptID) function. This function, as you may guess, returns me an array of Employees who work in a particular department.
Outside the TabNavigator, I have a departmentDropDownList that is populated with departments.deptName.My objective is to load the Employee module when I select a particular department from the DropDownList. I have a changeHandler for the DropDownList that can give me the deptID.
protected function departmentDropDownList_changeHandler(event:IndexChangeEvent):void
{
MyDeptID=departmentDropDownList.selectedItem.deptID;
[code].....
View 3 Replies
Aug 28, 2011
I am developing an application which is similar to[URL].. I need your advice on how to achive the ping and download and upload speeds. I have experience in as3, but very new to this kind of applications. can you please give your thoughts on how this application is developed.
I assume the application needs to download a file, based on the data loaded in that specific time we calculate the download speed. i am not sure about the upload and the ping.
View 1 Replies
Sep 11, 2009
I have a main fla file which loads an external swf into an empty movieclip on the main timeline which works fine but I want a button in the external swf to load another external swf into another empty movie clip on the main timeline.eg. start.swf loads UKEIAMap.swf into (empty movie clip within start.swf) MapLoader_mc then a button havant_b within UKEIAMap.swf needs to load HavantProjectSheet.swf into (empty movie clip within start.swf) ProjectSheetLoader_mc without unloading UKEIAMap.swf
View 3 Replies
Nov 19, 2010
I have a Flex/AIR application communicating with a PHP server application. Recently my client requested real-time-like connectivity between the applications to replace what we currently have; refresh buttons which have to be clicked to refresh data.So effectively the server needs to push data to the client when something changes. I can write the code that detects when something changes, but I'm not sure about the push side of things.
View 4 Replies
Oct 27, 2010
I want to develop a white board application using flex.. Can anyone tell what are the requirements and how to develop it. My plan is to develop online class room. There should be text chat, video chat, voice chat, save current class and so on.
View 1 Replies
Sep 27, 2011
I have an application I built in Flash that runs with no problems on Windows and OSX. I'd like to extend it to mobile platforms and I want to be able to call programs written in the native language of each platform.
I understand that Flex can be used on mobile platforms and that it can call native code, but I'm a little confused by what I've read about Flex. Can I use the Adobe Flash development environment to build Flex applications? Will our users need the Adobe Air runtime to run the programs? And what the heck does Air add to the capabilities? We need strong audio and video capabilities, a built-in database is not a requirement.
View 1 Replies
Dec 31, 2011
I am starting a project in which I hope to create a web application with similar elements to Google Maps, such as zooming, panning, displaying tiles, etc. The idea would be for it to have a very fluid and dynamic feel.Some possibilities that I have encountered are:
-Flash
-Silverlight
-HTML5
-Google Web Toolkit
-Javascript/jQuery
Being proficient in C# and .net, I feel that Silverlight may be the easiest for me to work with. I am worried however with regards to the penetration of Silverlight (this is a consumer-facing application). I am not asking to implement Google Maps into my web application. Rather I am attempting to create a new similar website (not mapping, but similar concepts).
View 3 Replies
Feb 10, 2012
I am beginner in flex as3 applications. I need to develop a 3d game using flex will you the some 3d engines used for flex applications.
View 2 Replies
Jun 29, 2009
I have a web application that functions as a dashboard, allowing a user to see summaries of historical data to view trends, etc. As an extension to this, I want to allow the user to drill-down into the historical data if they so wish.What this will amount to is a table of time-value pairs, showing the time a particular data point was recorded as well as its associated value. The issue is that there could be a very large amount of data on record (millions of points is entirely possible), which means it wouldn't work to load all the data up front and display it to the user.
So far, my best idea is to implement the table of time-value pairs with "infinite scrolling" - i.e. the first x points are loaded and then as the user scrolls down the next x points are fetched and so on until the user reaches the end of the data (with a fixed-size cache of points, so that I don't run out of memory). The issue with this approach, though, is that there's no way to get to the end of the data without first fetching every point in between.
Another option would be to have a navigation interface with forward and back buttons, as well as some sort of date chooser so the user can quickly navigate to any data point they wish. This solves the problem of the first idea, but this navigation interface is far more clunky and less intuitive.My question is: is there some happy medium? A UI where it's clean and easy to navigate through the data but at the same time provide some method of jumping to a specific point in time?
Edits based on comments below:The development environment is flex and the database is SQL Anywhere, though the back-end logistics are less important to me than a clean, functional UI.
View 1 Replies
Aug 2, 2006
Flash - 8 : Above is an example of what I would like to do/have done. I've gotten as far as loading the "loaded.swf" into the "start.swf" but my problem is I'd love to use that little loading action I made earlier without copying and pasting into the new movie the same actions for a different link. So, how do I load "loaded2.swf" into "loaded.swf" via the link in "loaded.swf"?
View 1 Replies
Dec 9, 2010
My main File loads an external swf in a movieClip.Once loaded, it needs to know what language is set by the main movie (a variable on the root of the main movie)What is the location of the main movie, seen from the movie clip I just loaded?[code]
View 5 Replies
Sep 6, 2011
wf which loads an swf into a movieclip called content_mc here is the code located in the blank swf
startLoad ("startPage")
var loadedSWF:Loader
var content_mc:MovieClip=new MovieClip();
function startLoad (SWFname:String){
loadedSWF = new Loader ();
[Code]...
View 12 Replies
Jul 18, 2011
I need to communicate from loaded swf to the container swf in AS 3.0. This is the code for document class of loaded swf followed by code for source swf document class. How I can call the method xyz() from the external swf?
ActionScript Code:
package com.scottgmorgan {
import flash.display.Sprite;
public class ExternalMovie extends Sprite {
public function ExternalMovie():void {
Code] .....
View 1 Replies
Aug 30, 2010
I basically need to communicate to an externally loaded swf and send info back to main swf. Below is some sample code of what I am trying to achieve:
In the main swf:
var imgLoader:Loader = new Loader();
imgLoader.load(new URLRequest("external.swf"));
addChild(imgLoader);
var MC:MovieClip = imgLoader.content as MovieClip;
//var MC = MovieClip(imgLoader.content);
trace(MC)
MC.btn1.visible=false;
In the external swf:
btn1.addEventListener(MouseEvent.CLICK,externalCli ck1);
btn2.addEventListener(MouseEvent.CLICK,externalCli ck2);
function externalClick1(e:MouseEvent):void {
trace("external Click 1");
//main swf goto nextFrame;
} function externalClick2(e:MouseEvent):void {
trace("external Click 2");
// main swf goto PrevFrame;
}
The trace I have setup in the main swf, trace(MC) returns a null value.
View 2 Replies
Mar 19, 2009
In short, this is what im trying to do: Communicate from externally loaded swf to main/parent .swf. On my main .swf I have this code on my main timeline to import and center an external .swf:
Code:
import flash.display.*;
import flash.net.URLRequest;
//turn off stage auto resizing
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align=StageAlign.TOP_LEFT;
[Code] .....
View 1 Replies
Aug 12, 2011
I'm upgrading some elearning code to AS3 and having trouble with a "Jump Menu" that loads at 3 in the main swf. The idea is that users can jump to any frame in the module randomly.Here is the main swf code:
//Main swf shell
var menuLoader:Loader = new Loader();
menuLoader.contentLoaderInfo.addEventListener(Even t.INIT, doneLoading3);
[code].....
View 4 Replies
Feb 4, 2010
I'm having issues with an animation and need to get it functioning properly. I've posted two example/demo files to illustrate desired functionality.The main timeline (testMain.swf) consists of a loader, section/slide one content, and a button (bttnClick) set to load an external swf (external.swf).
external.swf contains two additional sections/slides and two 'next' buttons (bttnEnter with 'bNextOne' & 'bNextTwo' instance names) to navigate. When the second 'next' button (bNextTwo) is clicked I need the loaded external swf to fade out revealing the original main timeline (testMain.swf) and returning/stopping playhead at the 'slideOne' frame label. Does the external swf need to be unloaded even though users will most likely go back to it? What�s the best way to handle this?
If you could assist with the external swf fadeout to main timeline, the return to 'slideOne' frame label, and insight as far as the best way to return to the external swf.
View 2 Replies
Nov 11, 2010
I build a project with Flash Builder. I copied everything from the "bin-debug" directory to a server (including all images we use which are under /assets).
After I have updated the project, and a few images, i recopy the primary .SWF file (Main.swf) and everything under assets up to the server again. Unfortunately, when I run the application, I am clearly running all of the updated code but the images have no updated.
The new SWF was definitely copied up as well as the new images (I can say that with 100% certainty), and additionally, I cleared my Flash Cache, so that's most likely not the problem either.
[Code]...
View 1 Replies
Nov 3, 2011
I'm using the the Adobe ActionScript 3 SDK for Facebook Platform to get all the tagged photos of the current user. Is this possible?
I've tried this:
FacebookDesktop.api("/"+uid+"/photos",getTagedPhotosHandler);
But that only gets me the photos belonging to that user.
View 1 Replies
Jun 10, 2010
I have a "photo" gallery that loads numerous SWFs through xml, one by one on click. All works fine. All my SWF work fine stand alone. But when I load them into the player, many swf dont work properly.in example, I have textinput textfields in many of the swfs, which work fine on their own but not when loaded into the player. Then I have a word search game that works fine when alone, not when in player. I can see there is something as my mouse cursor changes into the "button finger", but nothing visual.
All drag and drop assigments work fine etc. I have no idea whats up. I have receantly switched to as3 and in as2 there was _lockroot declaration that solved similar problems, but now in as3 (where it supposedly should be automatic) it doesnt work. As it seems that it cannot recognise it own stage value, or selection_focus when loadedinside another swf through xml.Using cs4, as3.
View 4 Replies
Aug 31, 2009
Does anybody use bare .SWF files as webpages? I know it's possible; it seems to work fine for me. Why would I embed a SWF inside an HTML page if it's just going to be full screen (I mean the size of the browser's normal viewable page area, not COMPLETELY fullscreen)?
Is there a lack of browser support? Or is this functionality determined by the browser's Flash plugin?
View 2 Replies
May 10, 2010
I want to have a web site which switches the web camera of users, makes a video recording and send results to my web server.Is it possible to do that? I think it should be. For example such sites as chatroulette.com starts web camera. Should it be done with the Adobe Flash technologies? Is it hard to do that?
View 1 Replies