Actionscript 3.0 :: XML Load Via Secondary Class?
May 28, 2010
I have three Class files: Main, Sub, XMLLoad.
XMLLoad is a simple XML loader Class.
Main calls the XMLLoad.
Main also loads Sub as a navigation.
I want to access the xmlData that XMLLoad loads. How do I go about that?
Code: Select allpublic function Main()[code].........
View 11 Replies
Similar Posts:
Jan 14, 2011
I have a SWF called Application.swf that loads another SWF called jeu.swf. My main class (don't know how to call it haha), is called Main.as. Another class is called actionObjets.as. When I call:
dispatchEvent(new MicroJeuEvent(MicroJeuEvent.JEU_TERMINE, 8, ""));
It works perfectly from Main.as, it works perfectly.
But when I call it from actionObjets, it doesn't work. No error either. I tried putting this line in a static function, doesn't work either. Why can I dispatch an Event from my main class and not from another one? I'm not a programmer and I just don't get a few of the basic principles of as3. Is there a way of doing differently?
View 1 Replies
Sep 16, 2011
Is there a mechanism by which an AIR application can manually display in whichever monitor I choose? I can look at the display list in Screen.screens, but I'm unclear on how to actually force the drawing of the app into one of those.
View 1 Replies
Dec 20, 2010
Everything was going fine on a website project I've been working on, until yesterday. I'll try to explain the whole scenario first, and I'll put the code in here too so anyone can try to figure out what is wrong. Here's the breakdown of the site:
1) There is a MAIN SWF file that plays an intro and then stops on the last frame with the "Main" Navigation buttons.
2) Inside the Root folder where the MAIN SWF resides, there is another folder called "swfs" which contains six main external navigation pages, as well as another folder called "galleries" which contains additional external swf files for six gallery pages.
3) On one of the layers of the MAIN SWF, there is a movie clip called "mySWFLoadingClip" that the "Main" Navigation buttons load and unload the main swf pages onto. These all work perfectly. The problem start on the next step. This is the code I used for the navigation buttons on the MAIN SWF timeline:
var Xpos:Number = 0.0;
var Ypos:Number = 0.0;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("swfs/home_page_swf.swf");
[Code] .....
4) One of the external navigation SWF pages is called "portfolio_page_swf" and gets loaded into the "mySWFLoadingClip" moveclip on the MAIN SWF. This is where the problem begins. The "portfolio_page_swf" has six buttons that call out to an additional external swf from the galleries folder. Now when I open the "portfolio_page_swf" file to test out if the buttons work, they work perfect. When I click the buttons, the external swf gallery files show up like they should. But the problem is that when I open the "MAIN SWF" file to test out the site, I can click the Main Navigation buttons and they work. I click on the Portfolio button on the Main SWF time line, and it places the "portfolio_page_swf" onto the stage like it should, but when I click the buttons that are within the "portfolio_page_swf" the galleries don't show up. The buttons from the "portfolio_page_swf" page only work if I open the "portfolio_page_swf" file directly.
Here is the code that is used in the "portfolio_page_swf":
var Xpos:Number= 0.0;
var Ypos:Number = 0.0;
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("galleries/gallery_print_swf.swf");
[Code] .....
How to load an External SWF onto the main time line and then load an additional external swf from within the first external swf.
View 1 Replies
Nov 2, 2009
I'm currently working on a project where I mix animation sequences with short videos. My project also has two scenes and the FLV will be placed on the main time line of the second scene. The problem I am having is, if the movie is previewed from the first scene, or exported, the FLV on scene 2 won't load. the timeline on the playhead will just spin. I'm currently using "Load external video with playback component" as the method for importing the flv file.I have already worked with this video multiple times in other flash files and have never had a problem loading the video. Is there a limitation to FLV playback in multiple scene movies?
View 5 Replies
Jun 15, 2010
Does anyone know of a way to get Flash CS5 for Windows to preview an animation in a secondary browser?
Dreamweaver CS5 lets you specify a browser as a secondary browser -- pressing Ctrl+F12 launches it. In Flash, however, F12 and Ctrl+F12 both launch the primary browser...
View 1 Replies
Mar 16, 2009
I'm having a problem trying to call an specific label or frame in a secondary MC.
-There is a main time line (120 frames) with an Intro animation stop in frame 103.
-There is 2 buttons in frame 103 (b1,b2). On release this buttons play 104 and stop in the last frame of the main time line (120).
-In the frame 120 these 2 buttons fade and an MC called navmenu and an empty mc (to load external flash) appear
-MC navmenu is the main menu with 6 frames, one for each button.
I'm trying that when I click on b1, it play 104 go to the end of the main time line, and call frame 3 on navmenu MC, plus load movie on empty MC.[code]...
View 6 Replies
Feb 13, 2011
I have a line chart with a column chart as a secondary series. When I roll over the line, the datatips appear. However, if I move the mouse to a spot where a column appears while still on the line, the data tip item appears for the line AND the column. How do I get it so that I only show datatips for the line but not the column?
[Code]...
View 2 Replies
Jul 26, 2011
I have a main flash movie, that launches an external swf. Now this works fine, but this external SWF, launches more external mini SWFs. What happens is that after going opening and closing these mini swfs, is that eventually the main swf, will start to to run beneath the the 1st external swf. i.e. I have a small animation that is suppose to stop and remain invisible until the secondary swf is closed.
But this is not the case, and very randomly this will start to happen, and it makes everything look like crap. At first I thought it was the fonts that I was using through out the swfs, because there were some design changes, but after updating the SWFs with the new embedded font I am still running into this issue.
Look at it like this.
main swf---->2nd swf--->numerous 3rd swfs
View 4 Replies
Jul 25, 2011
why my image won't load when I have it's class referenced from the document class rather that being in the document class?
This produces no errors and the second class traces the note, but it doesn't load the image.
// ----- Main Class
package {
import flash.display.Sprite;
[Code]....
View 2 Replies
Aug 18, 2009
I found myself loading a new XML file every day and so decided to create a small class that will load the xml file and return it.The class is loading the file but when i try to return it to a new xml object in the document class it doesnt load it.I think that it's something to with the return being in a nested function but i tried a few ways and non seems to work.
[DOCUMENT CLASS]
loadXML:LoadXML = new LoadXML();
myXML:XML = new XML(loadXML.loadXMLFile("gallery.xml"));[code].....
View 1 Replies
Apr 4, 2011
I need to make a video page. i used a flash player and implemented the videos on the pages. now my client needs that, the same page have to work with ipads, i know that we have to use html5 video player for that.
My question is in case eventhough html5 video supportable player available that should play the flash content first. in case it will not run the flash player then it should run the html5.
View 2 Replies
Jul 19, 2011
I have an array of three values.focal[x,y,z]these values change based on user input.however when the change occurs, they are logged into a new array to test for valid changed.A simplified psuedo version of my code:[code]However, when the focal[1]++; focal[0]--; ect, ect, code takes place. It also changed the temp array.and since it changes my temp, it never resets me original code back to its previous nature.I have never seen this behavior and its kinda throwin' me off.
View 2 Replies
Sep 29, 2010
I am using AS3 and OOP to load multiple images, 1 image per class but I cant do this!The constructors dont take paramaters?I want this but I cant do this
var li:atest1= new atest1("img1");
var li2:atest1= new atest1("img2");
var li3:atest1= new atest1("img3");
[code].....
View 4 Replies
Sep 8, 2009
I have a class that will read an xml file and then load the xml into a public variable like this:
Code:
package
{
import flash.events.Event;
import flash.net.URLLoader;
[code]....
the xml loads and I can trace it out from within the LoadXML class but when I try to access it from the class where I created the instance like this:
Code:
trace(xmlLoad.myXml);
it just returns "null".
View 2 Replies
Dec 14, 2004
I have classes witch resides in this package :com.network.interface_as. When I try to load one class from that package in another class in the same package like this:
[Code]...
View 2 Replies
Jun 23, 2009
I'm trying use the MovieClipLoader class to load up a swf and have it start at a particular frame. Such as:
Code:
var myloader:MovieClipLoader = new MovieClipLoader();
myloader.addListener(this);
myloader.onLoadComplete = function(target:MovieClip) {
[Code]....
The Bold underline text is where I would imagine most of the magic happens. How Would I place the MovieClipLoader into this and have that swf go play that particular frame label?
View 1 Replies
Aug 20, 2011
I'm having some issues with images loading from another class other than the document class.
I currently have two classes: Loader and GamePanel.
I also made a picture into a MovieClip type with a self generated class.
When I use the Loader to construct it :: new someBackground().
And addChild, it appears.
But if I construct the GamePanel class and call the generation of that same background, it does not appear. I'm currently using actionscript 3.
View 2 Replies
Mar 31, 2009
I'm using the tweener class in this file just fine. But whenI try to use the sound manager class I cannot get it to load why?I keep getting type was not found ....
import com.richardsongraphics.soundmanager;
var manager:SoundManager = new SoundManager();
=======================================
[code].....
View 2 Replies
Sep 30, 2011
Making a game and I have a preloader class which is linked to the main 'game.fla' file, in the preloader class I have imported the 'Game.as' class that contains ALL the code to run the game. The problem I am having is that I can't seem to 'initiate' the game once all the elements are loaded.
View 2 Replies
Sep 6, 2010
I'm trying to build my flex modular app, and got the following scenario
Portal (which includes, 2 modules:)
-Mod1 (.swf)
-Mod2 (.swf)
Also, I have Mod1-API (.swc). The Mod1-API, defines interfaces which are implemented on the Mod1 (.swf). Both the Mod1 and Mod2 swfs import the Mod1-API swc. I'm trying to call the API method on the Mod2. On Mod2 I've the interface, since it is shared via the Mod1-API project. What I'm trying to achieve is the real implementation class loading on Mod2, via reflection, using the getDefinitionByName method, but it says its not defined. How from the mod2 load a class that is on the Mod1 project, returning just the interfacce to the mod2 so it can call methods just like an ordinary API method?
View 1 Replies
Sep 25, 2011
I'm developing a tile engine with actionScript-3 for IOS machines. Is there a way to package JPG files with IP and then read them with Adobe Air's FileStream Class. I need to read files asynchronously.I understand how it works on desktop.
var file:File = File.documentsDirectory.resolvePath("myfile.txt");
On desktop, means:
[user_dir]/Documents/myfile.txt
[code].....
View 2 Replies
Feb 17, 2009
I have an as class :
Code:
package
{
import flash.display.MovieClip;
[Code].....
View 4 Replies
Dec 1, 2009
i have let's say a folder with more than 15 .as files, each of one represents a class that I want to load in another "main" .as file.
Those 15 .as files are NOT used anywhere else and are not loaded in the library so no instance of those classes exist anywhere.
when I try to load one like this
Code: var theHandlerClass:Class = getDefinitionByName(classPath) as Class; var theHandler:XMLNodeHandler = new theHandlerClass() as XMLNodeHandler; where theHandlerClass will be one of the 15 files I mentioned, I get a Variable is not defined error. classPath is defined by the user. All 15+ classes are subclasses of XMLNodeHandler.
The problem is solved if I create 15+ instances of all the different .as files I have inside main.as, or create 15+ objects in library with all the different classpaths in the "export for as" field, but this something I don't want.
How can I somehow deploy all these .as files so the main .as can see the classes, but without creating objects in library, or instances in main.as .
View 1 Replies
Jun 26, 2011
I have lots of images in the library (tile1.png, tile2.png, tile3.png...) each of which are on one frame of my Tile MovieClip. My Tile class which was created when I made the Tile movieclip and pressed export for actionscript also contains some other data such as height, texture, movementCost... et cetera.
I would like to take all the stuff out the library, and load the images from a local folder, have them loaded into my "Tile" class so that when I make a new Tile object and in my main fla file if I write addChild(someTile) it will draw the tile image to screen.
Basically what I am asking is how I can do this:
Create new movieClip (Tile) object and put it in the library
Export the new MovieClip (Tile) for as3, so it gets its own class (Tile.as)
import all my pngs from local folder into the library
put them all on a seperate frame on my new movieclip (Tile)
var myTile:Tile=new Tile();
myTile.gotoAndStop(x);
addChild(myTile);
WITHOUT using the library. I want to be able to do this with only as3 if it's possible.
View 2 Replies
Dec 14, 2004
I have classes witch resides in this package :com.network.interface_as. When I try to load one class from that package in another class in the same package like this:
Code:
import com.network.interface_as.SomeClass_A
class com.network.interface_as.SomeClass_B{
private var class_A:SomeClass_A;
public function(){
class_A = new SomeClass_A();
}}
I get error message that "class com.network.interface_as.SomeClass_A could not be loaded".
View 2 Replies
Mar 16, 2010
I have a textfield on the stage, and I have made a class to load in some text into it. I just cannot get it to work :: would someone look at my code and see whats up.
[Code]...
View 7 Replies
Oct 18, 2010
I cant load an image from a class.I have main.as which calls Classplayer.as Classplayer calls ClassMisiile.I cant load an image from ClassMissile . I can load the image in Classplayer and dont know why the image in ClassMissile doesnt appear and it is spelt right and in the correct directory.I dont get an error and the functions work but no image.I cant load an image from a class.I have main.as which calls Classplayer.as Classplayer calls ClassMisiile.I cant load an image from ClassMissile.I can load the image in Classplayer and dont know why the image in ClassMissile doesnt appear and it is spelt right and in the correct directory.I dont get an error and the functions work but no image. [code]
View 4 Replies
Apr 25, 2009
I have a flash rotating banner script that I purchased, and wish to incorporate into my homepage. Instead of creating a page with HTML and adding the banner code as a separate object on the page, I wish to load it as an external swf into a movieclip on my stage. This is what the banner looks like:
[URL]
I have a page that I'm redesigning, it's located at:
[URL]
I have a movieclip named load_banner. Inside the movieclip in its own frame, I put in the following code:
Code:
import flash.net.URLRequest;
import flash.display.Loader;
import flash.events.Event;
[Code]....
However when I test it, the images load off to the right hand side of the screen, not centered in the movie clip like I want...
View 11 Replies
May 31, 2011
I would really like a class that i can use to load all my movieclips from.I have 100's of external swfs - and i want to load them to stage from one class - as they are requested.I did manage to do it one way, to get access to the stage i did this:
Actionscript Code:
private var _stage:Stage;
and in the constructor code, just did:[code]...........
how to actually load the swfs, what i'm really looking for is a way to use addChild to the stage from within my class.
View 8 Replies