Actionscript 3 :: Access Function In External Class Located In External Swf
Oct 22, 2011
I am trying to access a function in a loaded swf that has external class.. I would like to avoid having to put the function on my "Main" Doc class in the external swf and instead access the function directly from the class
This is what ive tried so far and it's a no dice:
private function startLoad(){
var loader:Loader = new Loader();
var req:URLRequest = new URLRequest("one.swf");
[Code]....
View 1 Replies
Similar Posts:
Feb 9, 2009
I'm quite confused about how to do it, look at this [code]...
View 2 Replies
Nov 21, 2009
I'm not sure that I'm on the right track here. I've got what is essentially a 'gateway' movieclip and depending on the CLICK a corresponding movieclip (form) is loaded -- these all being in their own AS file. There are multiple corresponding pages that will all load/close in their own fashion but the 'gateway' will reload in it's own function-- consequently, I have this function on the main_AS. Can I trigger this function from the sub class or do I need to move the 'reload' function to a 'reload' class.
View 2 Replies
Jul 31, 2009
So I have a class that reads from an external XML file, and it works great. (uses RLRequest and complete event listener)I have functions in it to read certain parts of the file.Im trying to create a new instance of that class in my document class. I am able to do this, BUT because the XML class loads the file, and uses a complete event listener to load it, anything I try to access (var or function) come up blank because it fires before the file is done being loaded.Id like to be able to do something like this.
Code:
var prefs:XMLClass = new XMLClass();
var localcolor:uint = prefs.color; (access the public variable color)
[code]....
View 2 Replies
May 24, 2010
I've a website in which i have a menu that handle some external swf.My Problem is that when i've clicked on one section of the website and then i click on another menu button to gain access on another section i wanna to make an "go out transition" for the current loaded section. This transtion must be different for every website section, so for this i'm going to create a "go out transition" in every external swf class that i have for every section.Now my question is: How can i access from the main class to every single classes of the section to obtain the properly "go out transition" ?
View 9 Replies
Jan 18, 2010
I have a site that loads an external mp3 player. Now I want to pause the sound when the "video" button is pressed. In the mqin swf file, there is a movie clip called "MP3_Player", in that clip is the loaded mp3 player. I used this method to call the mp3 swf file.[code]Now what path/s do apply to the button in the main swf file to get the music to pause.
View 2 Replies
May 3, 2010
This situation is rather tricky because I'm having to control movieclips/properties in both the Parent and Child SWFs.
The path I took was not to have a slave document in the loaded SWF as it was looking for all the library movieclips I was referencing in the Parent. I didn't know how to resolve that easily, so I decided to to refer to the Loaded SWF movieclips using an instance of the class onComplete[code]...
View 2 Replies
Jun 3, 2010
I have a folder with my .fla, and a folder called "classes" where I stored all my classes. I'm trying to access a MC in the .fla file so that I reference it from one of those classes in the "classes" folder. for you visual learners...
Code:
<project>
project1.fla <- library here
[code].....
View 3 Replies
Oct 23, 2011
have an external class which controls about 400 buttons. But I want this class to also be able to show a Popup window. But this would mean I would need to access the Library.Within this library would be a MovieClip exported for Actionscript with the name PopUP.WITHIN the fla it's easy:PHP Code:va popUpWindow:PopUP = new PopUP();addChild(popUpWindow);
View 4 Replies
Feb 25, 2011
I was trying to upload an external .txt file which is located up one level from my .fla file but I couldn't make it work, this is what I have...
This code works just fine if I put my external .txt file in the same folder as my
.fla
var myRequest:URLRequest = new URLRequest("MaterialRef.txt");
but when I try something like... where the .txt file now is in a folder called "Materials" which is located up one level, it just doesn't work.
var myRequest:URLRequest = new URLRequest("../Materials/MaterialRef.txt");
View 6 Replies
Jul 1, 2010
I have followed the tutorial on gotoandlearn that builds a preloader swf to load an external swf. The problem I am having on the main timeline is that I now cannot access a function in the final external loaded swf. This worked fine when I just loaded the external swf into the main timeline but with the preloader I think I have my loader instances confused and I don't know how to fix it.
[Code]...
Like I said this worked perfectly before I tried cleaning things up with intermediate preloader swf and now its all gone pete tong (again!!) When testing this by reviewing the main timeline it cannot recognise the function killStream
View 0 Replies
Feb 13, 2009
I've got a textfield on the main Fla called 'debug'i've created a Class which refers to the textfield, but when i launch my fla, it says:1120: Access of undefined property debug.
ActionScript Code:
package {
.....
[code]....
View 9 Replies
Jan 19, 2009
I am currently using an external Class file for an instance in my .fla project. It creates an instance of that specific class and has it carry out some functions.I want to access a MovieClip on the stage in the .fla file in the external Class file. How can I do this?For example, the Class file creates an instance of that class, and I want the x and y coordinates of that instance to be equal to that of let's say circle_mc. Now circle_mc is on the stage of the .fla file, and therefore cannot be accessed. How can I get around this?
View 5 Replies
Dec 20, 2010
I have an Existing FLA file (It is my Project file) and I have downloaded one good example Class file with Fla. But there is no code at all on the stage just it is retrieving instructions from the Class. How can I use this class file in my existing fla file.
View 3 Replies
Aug 7, 2009
i know that:
sample_mc1.loadMovie("example.swf",1)
//will load "example.swf" into the current "sample_mc1" of the same swf file
however how can I load 'sample_mc1' to a movieclip located in a external swf file?
View 4 Replies
Sep 12, 2009
I'm using the following code to arrange indexes of objects on the stage the only problem is I can't access an Object that has been made in a class in an external AS document. if i go into the document and trace I can see it but i can't access it from the document class and arrange its index anybody have any ideas?
[Code]...
View 1 Replies
Jul 9, 2009
I have a main.swf that loads in an external swf called home.swf. I want to be able to call a function in main.swf's doc class from the loaded swf:
Code:
function loadArtist():void { // my function }
in the main timeline of home.swf I'm calling it this way:
Code:
function timeToGo(m:MouseEvent):void {
trace("button pressed");
MovieClip(this.parent.parent).loadArtist(); }
the home.swf compiles fine but when loaded in the main.swf & the button is pressed i get this error:
TypeError: Error #1006: loadArtist is not a function.
at home_fla::MainTimeline/timeToGo()
It seems that it thinks loadArtist is a property. Ack. I've got 3 objects loaded dynamically using addChildAt(mc, 0) ...
View 2 Replies
Mar 24, 2010
I'm trying to load an external swf into another swf and acces some variables and functions. This actually works quite well, however I'm dealing with some variables from the external loaded swf that are read-only.I'm wondering if I could somehow change the variable to be writeable as well by extending a function from the loaded swf.Maybe there's also another way to change the read-only variable, but I have no clue.I know all the variables, functions and class names from the loaded swf, I just can't change them myself, I have to do it by loading the swf externally.The class from the external swf is called "Application" where I want to change the "public const DEV_SERVER_URL:String" to another string, or extend the function: "private function get serverUrl()" returning a string.[code]
View 1 Replies
Nov 11, 2010
I've got a confusing situation which wont seem to fix itself basically I have my main class, my iContent class (which will hold each page and have functions for all pages), and my individual pages.
The homepage is instantiated by calling the iContentClass.goHome method in the main document class. The home page contains a button to go on to the next page. This button references the goColourBrowserPage function within the iContentClass, which removes the child (being the home page) and attempts to add a child (colourBrowserPage).
For some reason this doesnt work! It doesnt seem to add the child and wont let me remove the child of the home page! I've been sitting here for 3 hours trying to work it but to no avail!
[Code]...
View 1 Replies
Mar 25, 2010
I have a Main.fla which loads Main.as as its document class. In Main.as I have a public function named "Main" which runs a trace. I also have another .as file called Preloader.as, which also has a public function in it, this one named "Preloader" with simple trace in it. I just cannot figure out how to use Preloader() from the Preloader class in Main() from the Main class. Main.as loads up fine when the SWF loads and traces.
View 10 Replies
Jul 15, 2011
I am creating a side scrolling game in Flash (as3) and trying to keep things organized and clean.Ive created a "Level" class that gets all the level data, player data, and creates all the terrain objects and the player object. Its starting to get messy because im handlng all of the functions for player collision checks and player movement, terrain movement, sound starting and stopping, enemies, and more, all in this class. Is this normal? Or is there a better way to organize things to keep them separate, but still allow them to interact with each other.
View 2 Replies
Aug 1, 2011
i want to call an external function inside a class. thats the code;
in checkConnectionStatus function,
this[_funcNameForSucceededCon].apply(); doesnt work because "this" is the class, not the Application. How can i reach Application at this time or what can i do?
package myLibrary
{
import air.net.URLMonitor;
import flash.events.Event;
[Code]....
View 1 Replies
Jul 29, 2008
I'm using a class that I converted from AS2 to AS3 using Patrick Mineault's converter: [URL]
The original AS2 class:
Code:
/**
* Colour handling routines
* Culled from many places:
* - http://www.actionscript.org/forums/s...d.php3?t=15155
[Code]....
Is the AS2 to AS3 conversion part of the problem (aside from my ignorance of how to use it)?
View 3 Replies
Jan 30, 2010
For some reason I cant figure this out,I have a function thats in a method in a class..I have a second method in the same class, trying to call the function from the second methodeg:
Code:
package com.sarin
{
[code].....
View 4 Replies
Mar 25, 2010
I want to create a MovieClip, pass this MovieClip to a function in another class where it will be modified.The problem is, when I pass the MovieClip as a parameter to a function and start making changes, the changes are only made locally. The "copy" of the MovieClip inside the function gets changed, but the "real" MovieClip back in my main game class remains unchanged. Here's the code from my Main class:
Code:
var resourceLoader:ExternalResourceLoader = new ExternalResourceLoader();
var myMovieClip:MovieClip;[code].....
View 4 Replies
Mar 28, 2011
I'm building a drag and drop quiz. each draggable mc (drag#) has a base class of DragDrop. I want to detect when an drag mc has been dropped on a target
Code:
if(this.hitTestObject(target)) {}
And then add a new drag from the drops Array. so that each time a drag finds its target a new one appears. I tried to make a public var named dropped to switch from "yes" to "no" in the drop function. and even tried making the drop function public.
This code is on the timeline
stop();
var drag1:Drag1;
drag1 = new Drag1;
addChild(drag1);
drag1.x = 100;
drag1.y = 100;
[Code] .....
View 8 Replies
Apr 17, 2012
I am using in AS3 "External Interface ". When I call the JS function that is on the same page as swf everything works fine.
I added a link in the html page to an external JS file, when I move the JS function to the external JS file the website crushes.
I would prefer to have all my JS functions on an external file so I can use them in the future in other project and it also makes it easier for me to update the site.
how to call a JS function that is on an external file from AS3?
View 6 Replies
Jan 27, 2010
I have a problem I just can't seem to solve.I have an FLA .. (augmented.fla)I have a movieclip inside of augmented.fla with a class name of myMaterial that has the following code on it's timeline.
ActionScript Code:
var request:URLRequest = new
URLRequest("main.swf");
[code].....
View 0 Replies
Jun 27, 2009
Lets say I have Main.swf and sub.swf, and I wanna load sub when I press a button from Main, but sub.swf has its own external class file attached, so here is the problem, when I load sub using loader class and I would get this message from the output panel:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at subScript()
seems loader class can not access sub.swf's external class when sub is being loaded.
View 1 Replies
Mar 20, 2005
Problem: cannot get the script to open an external swf into a MC (named "container") that is located on the main timeline Desc: MC "container" is located on main timeline... button is housed within MC "clipAbout" which is located on main timeline
Code:
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "pages/about";
_root.container.loadMovie("pages/about.swf");
[code]....
View 2 Replies