Accessing A Class From An Externally Loaded Flex SWF?
Apr 23, 2011
Using Flex 4, I have created an SWF that has the following code:
<fx:Script>
<![CDATA[
import mx.events.FlexEvent;
import com.Index ;
protected function start(event:FlexEvent):void
[Code]...
View 1 Replies
Similar Posts:
Aug 5, 2010
I have loaded one swf externally in my main class. and there is one button in loaded swf suppose its name submit_btn. i have to do that when i click on submit_btn, this loaded swf should be removed. what is the code for that
View 1 Replies
Jan 17, 2010
I have a swf file which contains in its library couple pictures. After it is loaded using preloader I would like to be able to create couple instances of them and add them to the stage
If I use swc approach and import it in library path I can not preload it but instancing is very simple i.e
Code:
public var pic:Pic1 = new Pic1();
and that's it, I can add it then to stage then.
How to access them when doing it with swf and loader class?
View 1 Replies
Jan 21, 2011
I am building a touch screen kiosk Air App using Flash CS3 and Air 1.0.
I have my application downloading external SWFs for different advertisements, one of which will need access to the webcam built into the kiosk.
By itself, the advertisement accesses the camera just fine, however Camera.getCamera() returns null when it the SWF loaded into the kiosk app. Both the main kiosk app and the advertisement app are compiled using Air 1.0.
It appears that I'm getting a security sandbox violation, however I'd like to avoid completely rewriting my app using the sandbox bridge architecture just so one of my ad pieces can access a webcam.
Does anyone have any suggestions or know of any work-arounds for allowing webcam accesss from within an embedded SWF in Air?
View 1 Replies
Aug 10, 2009
I am a newbie to AS 2.0..I only have basic actionscript 2.0 knowledge."I have one main .swf file and several external .swfs which I am loading through this code.[code]Now my problem is that I would like to access one "close_mc movieclip" in ourGroup.swf ...so that clicking that clip, I can exit the externally loaded .swf from the main .swf file."
View 3 Replies
Feb 22, 2012
I have loaded an external swf into loaderTopBanner. It works to manipulate that, but not the individual buttons within it. (e.g. btn_Home, btn_Info)
loaderTopBanner.btn_Home.alpha = 0;
View 2 Replies
Jul 22, 2009
I am loading an SWF created in Flash CS4, using the 3d translation tool.The SWF is being loaded into an application being build in as3 in flex builder 3.I can manage to load the movie however the stage has disappeared. All of the objects that exceed the boundaries of the (banner) remain visible instead of being cropped by the stageI attempted to mask the swf before publishing which did not work, and I attempted to programmatically assign a mask once it was imported which also did not work.None of these options threw errors, in most cases they either had no effect whatsoever or the movie simply disappeareI've read numerous posts on this and the answers always seem to be vague.Based on my research I need to access the stage properties of the SWF being loaded, but am unsure how to go about it.Do I need to compile the movie, export a swc and add it to the build path for the project?Do I HAVE to use a document class for the SWF I want to load in order to access it?Do I need to add anything else to the source or build path for the project in Flex Builder?
View 5 Replies
May 24, 2010
I am trying to set a couple of properties (specifically width and height) for an mc within an externally loaded swf but am having bigtime troubles. Keep getting the 'Error #1010: A term is undefined and has no properties'. The code is attached below. I have tried to figure this out and searched for solutions but could not resolve this myself.
import flash.display.MovieClip;
import flash.display.StageAlign;
import flash.display.StageScaleMode;
[code]......
View 1 Replies
Jun 24, 2009
here's what I have (simplified to only show necessary code):
Main Timeline:
var currentItem:String = 'applesauce';
(then some code to load an external swf)
[Code].....
View 1 Replies
Aug 11, 2009
I'm slowly working my way through AS3, and have a question about how to do this. In as2, you could just load a swf file, then use attachMovie("itemLibraryLinkageName");. I know in AS3 you have to use addChild() to add items to the display list, but how would you go about adding the library items to the stage from an externally loaded swf in AS3? I've tried:
Code: Select allvar library:MovieClip;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);[code].......
View 2 Replies
Jul 27, 2009
I'm trying to set up a large project that has a "shell" application that preloads and eventually displays a bunch of SWFs as a "slideshow". Each SWF could be authored by different people but will reference a base document class so they exhibit consistent behaviour. One of these behaviours is to be able to localise the slideshow into different languages. Since each SWF could have a different number of textfields that need to be localised embedded into their main timeline, the SWFs each must declare their stage instances in their document class. In order to implement the common functionality (such as a "localiseText()" method), I have decided to package all common functionality into a superclass (what I'm calling "Base Class" in this example) and using a subclass as each slide's document class.
This Example:This is a simple example I set up because in my actual project my compiler was throwing a coercion error when I tried to cast the Loader.content as my external class. The structure of this example is the following:
+ loader.fla : this is the main "shell" application.
+ SWFLoader.as : the Document Class for loader.fla
+ external_1.fla : this is the external SWF file that will get loaded and displayed
[code]....
I've set it up this way because a hypothetical external_2.fla might have different public variables to declare its stage instances so would need a separate implementation of ExternalBase (presumably External2.as).
The code (in reverse):
base/ExternalBase
[code]....
This just sets up the localiseText() method which is used in this example to change the contents of the text field. Since we don't know the name of the text field in the particular slide's timeline, we have to ask for it from the subclass' implementation of getLocalisableTextField(). We declare an abstract function here that needs to be overridden in the implementation.
[code]....
View 11 Replies
Apr 30, 2011
I have a document class which links to several classes, one of which adds a container onto the stage and loads external .swf's into it.Q: How do I access the various classes loaded in the document class from the external swf timeline?For instance, when you click a button in the loaded swf it changes the soundtrack from the soundtrack class. I have tried dispatchevent from the external swf timeline, but I still can't seem to get it to work. Is this supposed to work, or should I be doing something different?
View 1 Replies
May 23, 2009
How would you go about accessing a function or variable from a parent clip if the clip accessing has been loaded using the Loader() constructor in AS3?
View 1 Replies
Jan 21, 2009
I have a problem - when I load a swf and I want to be able to add event listeners to propertys on it I use the code
ActionScript Code:
var headerMovie = MovieClip(loader.content);
Which works fine but what I've have created now is a class to load external SWF's and add them saving me to repeat that code, which works fine for loading the swf but as for the part where I get it to convert to MovieClip (which is what I assume that bit of code does) I'm out of Idea's.here is the class so far - the error it gives is that it cannot acces the property mloader, I've even declared it outside of the function but to no avail.
ActionScript Code:
package {
public class PreLoaderSwf3 extends MovieClip {
var myTween:Tween;
[code]...
View 5 Replies
Jul 9, 2009
I am running into a curious problem with Flash CS4 Professional.I am running Windows XP Professional SP3, and working locally off my hard drive using SVN for version control.The problem I am having is with loading an external SWF into my "master" SWF.I am using ActionScript 2 exporting to Flash 8 (due to project requirements). When I run the SWF that is being loaded externally (standalone), it shows my changes from when I modify my class files. However, once I load it into the master SWF, the changes are not visible. If I modify the FLA itself, the changes are shown, its just when I modify any class files, the changes do not show.This is very strange and I have no idea why I am having this issue.I have outputted the _url of the SWF and it is loading the correct file.I tested it on another machine, and I did not run into the same problem.I deleted everything out of the ASO folder and that did not fix anything. Since I am not the administrator on my machine, I have tried everything other than reinstalling Flash.
View 9 Replies
Jan 20, 2009
basically i want to be able to load different button.swf files, like button1.swf button2.swf etc and assign them a class so the class handles all the default behaviour of the button. This is for skinning purposes. I want to be able to load a button.swf file into my main movie ( the button.swf has no actionscript in it at all, just the graphics ) and then make it an instance of a existing class like for example button.as . the clips are not in the library so i can not specify the class in the linkage properties. It has to be loaded externally.
View 4 Replies
Jun 12, 2011
I can't find a way to directly access a MC (or textfield, etc) on the timeline from a Class loaded into my Document Class. No problem from the Doc Class, but can't do it directly from the loaded Class. Is there a trick to essentiall extend the Doc Class AS from another external class?
View 7 Replies
Nov 23, 2011
In Flash Professional, I drew a shape, converted it to symbol, linked it to class Symbol1 (extends MovieClip) which is generated at run-time, and saved the SWF file as shape.swf.
Now my main application wants to load shape.swf and create multiple instances of Symbol1 but I get ReferenceError when trying to access the class Symbol1.
Below is my main application's code. Errors thrown are mentioned in comments.
public class MovieClipTest extends Sprite
{
public function MovieClipTest()
{
[Code]...
View 11 Replies
Nov 23, 2011
In Flash Professional,I drew a shape, converted it to symbol, linked it to class Symbol1 (extends MovieClip) which is generated at run-time, and saved the SWF file as shape.swf.Now my main application wants to load shape.swf and create multiple instances of Symbol1 but I get ReferenceError when trying to access the class Symbol1.Below is my main application's code. Errors thrown are mentioned in comments.
ActionScript Code:
public class MovieClipTest extends Sprite[code].............
View 3 Replies
Feb 2, 2010
I have a Main.fla (with Main.as as document class) that calls the external SWF (which has its own document class too)
ActionScript Code:
function startLoad() {
mLoader = new Loader();
[Code]....
Another question. Is it possible to do some kind of listener? Example, I call this external swf, and if the user press a button inside this external swf, this button triggers the listener on the Main.as? Something like running an external mini game, and wait for the results/hiscore.
View 0 Replies
Feb 9, 2009
I'm trying to access an init method I've set in one of my document level classes.
Container Movie loads Main Movie, which has Main.as as its document class, but I want to do a few things before I show the actual content. Here are some functions in Container.as:
Code:
public function moveLogo(e:TimerEvent):void{
loadTxt.visible = false;
var logoMoveUp:Tween = new Tween(logoCont, "y", Back.easeIn, 221, -250, 1, true);
[Code].....
If I trace e.currentTarget.content.init on my EVENT.COMPLETE callback function, I get "function Function()" like I should.
View 2 Replies
Mar 4, 2012
I have a SWf application built in flex 4. One part of the application relies on accessing a public variable ("step1") set at the application root, and is accessed with
var app:Object = FlexGlobals.topLevelApplication;
trace("step one is "+app.step1);
This, while not optimal, has worked fine. Now, hoever, I need to load this entire application into another application, and I can't figure out how to access my step1 variable any longer.I have been loading the swf into the new parent application like so:
public var myLoader:Loader = new Loader();
public var pizzaContainer:UIComponent = new UIComponent();
private var myUrl:URLRequest = new URLRequest("chickensoup.swf");
[code]......
View 1 Replies
Aug 30, 2005
I am in the process of building a site for an Architect... Jamie Fobert Architects (projects) I am useing transitions between the projects and am loading details/text and images externally through flashvars, php and a mySQL database. Within my transitions I have a a preloader on the forst 2 frames the code is as follows (taken from a Voetsjoeba tutorial):
[Code]....
This works pretty well if the content is within the .swf, but when it is loaded externally it doesnt preload it at all. Does anyone know how I can adapt/improve this preloader? or somehow ensure that all the content being loaded externally is loaded before the transition plays?
View 2 Replies
Jul 24, 2010
I would like to provide my own sortItemRenderer within an AdvancedDataGrid like so:
<mx:AdvancedDataGrid sortItemRenderer="MyRenderer"></mx:AdvancedDataGrid>
MyRenderer is a class that I wrote, but Flex doesn't see it and gives "defintion not found" error, because it is not within the mx namespace. What is a clean way to make this to work?
View 1 Replies
Mar 15, 2010
enter code hereI am loading an external swf into an component. It loads everything fine and I can see buttons working in the swf, I can add a movieclip to the but I can't then access that movieclip (or don't know how), and it keeps telling me numChildren = null when I try to trace it out. This is set up as a custom component like this:
<cynergy:imageZoom
id="zoomComponent"
borderStyle="solid"
source="{_data.map.@url}"
[code]....
how I would access the children in the loaded movieclip?I have tried
mycomponent.image.getChildAt(2) and it returns and error that the index is out of bounds.
View 1 Replies
Aug 2, 2011
I am developing a flex application with flex 4.1 sdk and java backend (runs on Glassfish 3.1 via http). For security reasons I decided to move my authentication process to https until a session id is obtained. Therefore I changed the filter settings to use ssl for login and logout pages(just two pages due to performance reasons. The data-size sent to client is large and I do not want to slow down the system). Glassfish forwarded these pages to 8181 port (which is HTTPS port). Everything is ok for the java part. However flex defines the 8181 port as a different domain and then problems arise. Due to flash's same-origin policy it cannot load the secured content. Normally a crossdomain.xml is the solution but I am accessing content of the same domain through a different port. What will be the solution ?
View 1 Replies
Oct 18, 2011
I have a flex application that dynamically loads swfs and I want to to use a set of color pickers in an external component within the application to determine a color array in the loaded swf.
I figured that I can use a new array of the colorPickers, i.e.
public var colors:Array = new Array [ cp01.selectedColor, cp02.selectedColor, cp03.selectedColor, cp04.selectedColor, cp05.selectedColor]
Is it possible for the swf to read the Array if it's set up like that? If so what would I put into the swf to get it? If not what do I need to do?
View 1 Replies
Aug 22, 2009
Here is the problem:I have 2 external as3 files in a "com" folder next to the FLA within which i am working. The first of these ( "Main.as") is the document class. The second ("events.as") contains variable definition "myVar:Number = 0" which i want to be able to access and change inside Main.as. I am sure that this is possible, but i can't get it working (flash very keeps pointing out that I have made an error. Specifically that old classic: "1046: Type was not found or was not a compile-time constant: myVar." which has puzzled me since the dawn of time.
View 3 Replies
Apr 14, 2011
I want to draw something on an <mx:Image> I have in my .mxml file, but I want to keep my drawing implementation in a separate AS class.
View 4 Replies
Jan 25, 2010
I have downloaded an AS 3 class file, designed to create an MD5 hash from a string. I have put the class file in my /components directory (with / being the root of my Flex project source).[code]...
View 2 Replies