ActionScript 3.0 :: Embedded Two Class File Into Main.fla File?
Aug 10, 2010can i embedded two class file into main.fla file?
View 0 Repliescan i embedded two class file into main.fla file?
View 0 RepliesI can't seem to remove / unload the external swf files e.g when the carousel.swf (portfolio) is displayed and I press the about button the about content is overlapping the carousel (portfolio) . How can I remove / unload an external swf file from the main flash file and load a new swf file, while at the same time removing garbage collection from memory?
View 15 Repliesi want to add to stage a movieclip in another class not the .as file as the same name of .fla file how can i get this.When i run same code in main.as i get the result but in another class it runs but no result.
View 2 RepliesI have a menu btn that is created via an external class. I want to move the main timeline of my flash file to a frame label but I'm having a hard time referencing the main timeline via my external class code.
How do I control the timeline via this external class.
How can a function in main timeline be called from class file?
View 4 RepliesI'd like to access the stage of the main timeline from w/i a class that extends a movieclip. Basically, I have a button in the main timeline that makes a HUD appear. The HUD is an extended MovieClip class. When people click on a button in the HUD, I'd like to remove the object from the stage of the main MovieClip.I think your confusion may come from the fact that I am running this code from a class definition file. Clicking on a button w/i this object should remove it from the DisplayList of the MainTimeline. Here's the code from the class definition file:
package classes {
import flash.display.Stage;
import flash.display.MovieClip;[code]....
trace(e.currentTarget.parent.parent) gets me the MainTimeline, and trace(e.currentTarget.parent.parent.stage) appears to return the main stage, but I cannot use removeChild w/o getting an error that I am trying to coerce the stage to be a DisplayObject (which it ought to be).What's on the stage of the MainTimeline: A single button that, when clicked, adds an instance of the Answers class to the stage.
I have some functions defined at the main timeline, and I need to call them from a class, how can I do this?
I've tried object(parent).function();
and object(root).function();
but didn't worked
those functions need to be on the main timeline because they removeChild() of the class
How do i tell the playhead to gotoAndStop(); on frame 2 of the main timeline from a class file?....I'm trying to oop this program.
View 2 RepliesI am facing a technical proble when I am importing a "FlashVarsParam.as" class file in my main class " VideoPlayer.as" and when I am using "FlashVarsParam.as" in my FLA doucument class "VideoPlayer.fla" then it is workining fine. "FlashVarsParam.as" file given below so I am accessing in my main class and then it gives me error
[Code]...
loadVariablesNum("testimonials.txt", 0);
gotoAndPlay("load");
This code works perfect when testing, and it works perfect viewing the SWF, but when you view the HTML file with the SWF embedded, it doesn't display the text file content.
I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*; public class HelloWorldImage extends Sprite { private var background:DisplayObject, foreground:DisplayObject; private var url:String = "hw_jpg.jpg"; private var loader:Loader = new Loader( ); public function
[code].....
The navigation on a website I am designing is an swf file embedded inside another swf file, the latter being the body of the site. The navigation buttons are themselves embedded inside movie clips inside the embedded swf file...
I'm sure I'm missing some sort of line of programming, however my actionscript skills are rudimentary at best. I have assigned a simple goto webpage behavior on each of the buttons. However, when I look at the site all put together, they do not work.
Is it possible to let's say, have a button in an swf file that affects another embedded swf file?
View 2 RepliesIs it possible to let's say, have a button in an swf file that affects another embedded swf file?
View 2 RepliesI have created a MovieClip "Main" that have a class file "Main.flv" attached to it. Inside this movieclip I have several buttons and movieclips.The problem I have is with the reference "this" inside the class file.When I write "this" I get a reference to my movieclip "Main". But when I write this.button I dont get a reference to my buttons inside the "Main" movieclip. The button have an instanse name "button".
View 3 Repliesusing 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?
I have to make a project for school. It will be like a tutorial, but into an application. I already made a part of it in MXML and a bit of action script but I encountered a few problems that are over my newbie limits. So the Flex Builder 2 makes a SFW file, in the main folder of the "project". I want to make that SWF file my main executable file. I have a folder with some pics, and another folder with Action Script Files. The code lvl that I know atm is ABSOLUTE BEGINER... I don know how to make my SWF file have a specific name when I run it.Here is a picture of a training exercices that should make thing more clear:Some people told me that I should use a HexEditor and stuff. Is it ture(what u think?).
Next problem. I dont know how to make the Stage to be fix. I mean.. I dont want the stage to be resizeble. I tryed to change the stagescalemode but that wasn't it. I toke a look at the help files of Flex from the net, about the Resize action and SystemManegment, but I didn't find out what I wantend.
how to pass variables from one Movie clip's AS file to my Main AS file. Let say my Movieclip's AS file is calling damage = 1; so how the Main AS file retrieve the damage value from the Movieclip's AS?
Code:
public class robotMC extends MovieClip
{
public function robotMC()
{
[code]....
Got a really big problem here. I keep on getting "NetConnection.Connect.Failed" when I load a .asc file on my main.asc file, i use the method load() in my code. I really don't understand why this happens, but when i comment out the code that loads the asc file, I can successfully connect to fms. I can't figure out what's happening here. Btw, i'm using fms4 in windows 7 32bit.
View 6 Repliesi want to load variable from text file to my main movie (swf file).what should i put in the second parameter of the function loadVariables ("target" parameter) - should i insert _this? _parent? _global? (nothing works.
View 3 RepliesI'm creating a flash 3d website for a company. The idea is that there is one overall swf file - this holds the navigation and design. Once the user clicks on a button, it goes to frame 10, I have included the following script to load a swf file
loadMovie("deepbartesting.swf", maincontent);
this.onEnterFrame=function(){
if(movieClipName._currentframe==5){
[Code]....
the preloader works, but instead of going to frame 2 of that swf file, it goes to frame 2 of the overall swf that holds the navigation. Does anyone know how to get around this so that it goes to frame 2 in the same swf file as the preloader?
I am using preloader from the main swf file to load other swf file, if i use a preloader inside my other swf file then it wont show so sorting that problem I am referencing this nice material on preloaders [] I have sorted the preloader problem by calling the preloader from the main swf file and hiding the other swf file till its fully downloaded. but now the problem is I have got no functionality from that swf file, i mean i have got that mouse effect in the other swf file that where ever you move the mouse in the screen the showreel adjusts itself but its static now.
I have got this container mc in my main swf file, and i am using the other swf file by clicking the button, the swf file loads in the container mc after showing the preloader but its kind a static.
I have problem in loading multiple swf file into a main swf file. I will state the things clearly at first. I have a main Index file to which i have to load some swf files which i have placed in a seprate folder. I tried to load those movies to main swf file using loadMovie it worked well when i give the exact path of the swf movies in subfolders. Aslo it worked when i placed the entire swf files including the Index file on a single folder, this worked only on my local machine suppose if i copy those entire folder to some other Computer and tried to run the Index file it doesnt works if it is in an single folder it works. The thing i need is the Index file alone has to be placed on the main folder and rest of the Swf file has to be placed on sub folder so when i run the index file it has to load the required swf file from sub folder this even have to work when i run the application on some other computers.
View 4 RepliesI have a video in .flv format that I have converted into .swf. And this .swf file, I have added it in into my main flash file by using Loader. And now, I want to detect when this video will finish playing so that I can go to the next frame which is not looping the video again and again.
View 3 Replieswhen we create a flash file with xml loaded data, do we need to supply that xml file all the time with the main file?Cant we just send main file to the client?
View 3 RepliesI wanna know if it is possible to load an SWF file, from a main swf file, but OUTSIDE of it. What I mean to say is, to open it as it was a completely different thing.. like, for example, when you click a link of a video on a website and it automatically brings up your windows media player.. i dont wanna load the swf inside the main swf, I want another flash player to pop-up and play it separately..
View 1 RepliesProblem with external swf loading into a main swf.I have a button inside my main.swf file that should open another swf-file, putting it on the same place as an invisible movieclip called "(projectyta)". I want it there and it works out fine.[code]The external swf file shows just as I want it to show when I press the button from the main.swf, Only, I have buttons inside my external swf that doesn't work. The external swf file just stays in frame 1 all the time.
View 2 RepliesI am trying to pass XMLList from one class to another class using public function get.
Below is the code I am using.
XMLContents.as
ActionScript Code:
package com.ad.loading
{
/**
* ...
[Code].....
The problem is I get a "null" on trace.
I Have a flashmovie thats almost done and will soon hit the internet, but I want to add some animations into the website it�s two gears that I�m about to put at the bottom of the page and when a button releases in the main flashmovie the two bottom gears will turn a few frames and just stand still.These three movies are all separate (main movie, first gear and second gear).
It's a homepage designed in HTML and flash that has this "main flashmovie" in the middle of the screen, the size is about 1500(width)X800(height). And the gears is about 800wX200h placed at the left and right side bottom of the page. Dont worry the site is easy to apply to any screen resolution.I have been looking everywhere for any soul out there who suffering from the same problem but no success. Is it possible to script a button in the main movie to launch two separate movies in their own contents?
I have a class file that displays a slideshow and preloads each image in an xml file. the code is below. What I want to know is, is there any way to improve this code?
Code:
package {
import flash.display.MovieClip;
import flash.net.URLLoader;
[Code].....