ActionScript 3.0 :: Handle Existing MovieClip From External Class?
Aug 6, 2009
how to addChild() a new Object to an existing movieClip on stage from an external class....
for better understanding:
This is my external Class:
ActionScript Code:
package joueur
{
public class CreeJoueur
[Code]....
Then i have the main .fla file with a movieClip on frame1 called 'terrain'.
When i try my code, the external class does'nt reach the terrain MovieClip :
ActionScript Code:
Error 1120: Access of undefined property terrain
View 4 Replies
Similar Posts:
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
Oct 20, 2010
Is it possible to handle/control a movieclip that's on stage through a class? (not the main class)?
View 4 Replies
Jun 22, 2011
I've written a simple MovieClip replacement that converts an existing imported MovieClip to a sequence of BitmapData. This removes the requirement for Flash to render vector data in the MovieClip on each frame.
But BitmapData has a huge memory footprint. I've tried converting the BitmapData to a ByteArray and using the compress() method. This results in a significantly smaller memory footprint. But it has proven impractical. For each redraw, I tried uncompressing()'ing the ByteArray, then using SetPixels to blit the data to the screen, then re-compressing() the frame. This works but is terribly slow.
So I was wondering if anybody else has an approach I could try. In Flash, is it possible to compress bitmap data in memory and quickly blit it to the screen?
I wonder how native animated GIFs work in Flash. Does it uncompress them to BitmapData behind the scenes, or is frame decompression done on the fly?
View 1 Replies
Jan 22, 2010
I have a base class which is being created via remote_object [RemoteClass alias] from the server.I have other specialized classes that are derived from this baseclass, but serialization with the server always happens with the base class.The base class has meta data that defines what the derived class is, for example
[RemoteClass (alias="com.myco...')]
public Class Base
{
[code]....
View 2 Replies
Jul 2, 2009
i m making three movie Clip A, B, C in Main movieclip on stage .
how to handle these movieclip by cleass file in actionscript 3.0.
i dont want to access these movieclip from libaray.
View 1 Replies
Jul 3, 2006
how I might go about adding a method to flash.display.Graphics so that I can call it just like I would drawRect()¯
for example, graphics.drawDottedRect()¯
I tried extending Graphics with a new class called Graphics and adding my function but this does not work. I'm sure that the display object is making its graphics instance from the real flash.display.Graphics class and not my extended class.
View 2 Replies
Oct 25, 2008
I'm trying to load an external swf on a button push but cant seem to get the code right. it loads behind instead of replacing what is already there.
var bg_mc:Background = new Background();
addChildAt(bg_mc, 0);
controls_mc.play_btn.addEventListener(MouseEvent.CLICK,
[Code].....
View 1 Replies
Sep 1, 2008
What I wan't to do is load a .swf into an existing .swf to keep down loadtimes. I've placed the visual representation of the actuall loading on the external .swf [URL] (Actuall website I need this for, I'm redesigning it)
I would copy the elements/AS from the website above but it doesn't work. So obviously I've missed something. What I've got is quite simply:
Code:
loadMovie("my_path/my_swf.swf", "stageloader");
"stageloader" being the instance name of a movieclip on the _root containing a graphic at the size I want loaded loaded .swf's to fit.
View 3 Replies
May 9, 2009
Instead of posting my entire files and such, I'll make a brief example of my situation and my desired outcome. My files consist of my document class entitled Engine.as and another class Abilities.as all within the same folder. On my stage I have a MovieClip with the instance name of item1_mc. On its personal timeline I have 2 frames, one entitled "inactive" and the other "active". Here's a sample of very similar code....
[Code]...
View 4 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
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
Sep 30, 2011
I have an external class which will add an eventListener to a bunch of movieClips. I did this this way so I dont have to write 80+ eventListeners. BUT how can Flash tell which movieClip I'm pressing?And how can I specificly let something happen for that specific instance?
View 1 Replies
Apr 7, 2010
in Adobe tutorials, they suggest to create a class to handle the events (see below the copy/pasted code, and link to page).I was wondering if I have to handle all events with the function handleAllEvents, using if statements to check if the target is the one I want, and the event is the one I want.i.e. if (event.type=="click") && (event.currentTarget == "myId")Should I have a list of ifs (for each target and each event type ?)[code]
View 1 Replies
Jul 5, 2009
I'm trying to make a new method for the XMLNode class and I want to use this method in other classes of mines that manipulate XMLNodes. Here's what I did :
1. I wrote an Ext class which you can read here :
[Code].....
It didn't work (saying that myMethod doesn't exist), so I added this line "static var e : Ext = new Ext();" before "function Testing () {}" Then my method worked. I don't understand why but great.
3. The problem is that I want to use the method not only in the main function but also in other classes of the application. However, when another class tries to call the custom method, it says that it is not defined. I don't know how to solve that.
Additional infos: I'm using the Eclipse IDE rather than the traditional Flash IDE so I don't have such a thing as "the first frame". My app only has the main function.
-MTASC which compiles my code doesn't support #include
View 1 Replies
Feb 6, 2010
I'm creating a scrollbar gallery from a tutorial on this site. Though I've completed the tutorial, and customised the gallery to my own needs, however I'm trying to make a very small change to it - and no matter what I do, keep running into problems. I'm trying to replace the rectangular handle with my own customised handle - a (20 x 20) 'circular' png image that I've imported into Flash, made a graphic and stored in the library (though I understand it can be imported using actionscript, like the other images in the gallery).
[Code]....
View 7 Replies
Jun 13, 2010
Recently, I found a great little Flash project that acts like a jukebox for external mp3 song files, and am using it on my website to play my song demos.I'm now trying to find if there is an existing solution like that for video. I just need some way to progressively download video files from my webspace when the thumbnail is clicked... and am now looking into some sort of Flash jukebox.
I've tried just embedding the video files into HTML, but they don't progressively download for some reason (even though they are saved as Progressive With Compressed Header). I've even tried using prettyPhoto (...a script that mimics a Lightbox like feature, where the whole page dims, and a floating window appears over your site, displaying any media, and allowing you to move back/forth through your list of media)..... works great, but again, not a progressive download, so you stare at a blank screen for a while.
Seems the only way it works is if I have the file on YouTube or some other site, then embed it or use the prettyPhoto app.So, can someone either tell me how to make the embedded file download (OT, but I figured I'd ask), or point at some existing Flash file that serves as a video jukebox, showing all media on a common window?
View 2 Replies
Apr 17, 2009
Instead of posting my entire files and such, I'll make a brief example of my situation and my desired outcome.My files consist of my document class entitled Engine.as and another class Abilities.as all within the same folder.On my stage I have a MovieClip with the instance name of item1_mc. On its personal timeline I have 2 frames, one entitled "inactive" and the other "active". Here's a sample of very similar code....
Code:
package
{
import flash.display.MovieClip;
[code]....
How do I access item1_mc? In reality I have 6 different clips and I desire to access much more than frame changes...what's the overall best way to be able to interact with an item placed on the stage via an external .as file that is not the document class?
View 11 Replies
Jun 19, 2010
I am trying to load images from external XML files, and display on a movieClip name thumb_mc, The following codes will generates a list of buttons using button_mc, my task here is to add a thumbnails to each button from each record of xml.I have added below codes in red, However, what I am getting is the thumbnails are overlapping each other. What should I do to make it display on the thumb_mc on each button?
Code:
public function showXML(e:Event):void {
XML.ignoreWhitespace = true;
xml = new XML(e.target.data);//loading the xml[code]....
View 1 Replies
Apr 3, 2009
I have problem with removing dynamicly generated MovieClip in external class. How can I remove it? I'm getting this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.at flash.display::DisplayObjectContainer/removeChild() at SomeEffect/updateMc()
View 1 Replies
Jun 10, 2010
I am making a Thumbnail class which is part of my Photo Gallery Package that I am building with the intent of automatically generating my thumbnails. I do not want to limit myself to just AS3 animations, I would also like the ability to use timeline animations. I have a system using "in" and "out" for frame labels which I find very efficient and I get stuff done quickly. So I created the thumbnails holder MovieClip with the animations and have it linked in my Library, however, when I try to pass it to my Thumbnail Class, I only get one instance and I need to create several instances.
Document Class
ActionScript Code:
var thumbCont:mcThumb = new mcThumb();
thumbNails = new Thumbnails(thumbCont);
Thumbnails Class
ActionScript Code:
var thumbContainer:MovieClip;
public function Thumbnails(thumbCont:MovieClip,) {
thumbContainer = thumbCont;
}private function createThumbs():void {
for (var i:int = 0; i < aThumbs.length; i++) {
[Code] .....
I eliminated most of the additional stuff. What this does is that it doesn't create several thumbContainers, rather it just uses the one. So how would I be able to generate several of them? I can obviously create an Array with them and create them in my document class, but if I can avoid that and have my thumbnail class do it by itself, that would be perfect.
View 2 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
Jun 30, 2010
I have swf with multiple scenes.Controls in each scenes are different. How can I manipulate these controls in different scenes in a single document class for this swf?
View 1 Replies
Jan 30, 2009
I'm not sure if it's possible, but can you override a variable of a parent class like you can override a function? I'm trying to create my own event class that can handle the target property. I have a custom imageLoader class, but when it dispatches it's loading complete event:
ActionScript Code: dispatch(new Event("load_complete")); and a listener picks it up, e.target = null where I would like e.target to equal the imageLoader instance that has finished loading.
Does anyone have an answer or a better way to accomplish what I am aiming for?
View 1 Replies
Dec 9, 2005
Im wondering if using the tween class is tough for older computers to handle?
View 3 Replies
Mar 28, 2011
I'm totally new to Adobe Flex Builder 3. I've been assigned a fully functional project but when I want to add the simplest function to any class, I always got the same error :
Call to a possibly undefined method through a reference with static type
For example, in some random class there is a function defined like this :
public function GetID() : String { return m_strID; }
If I try to define a new one like below :
public function GetIDFoo() :String { return m_strID; }
And then I try to call both of them like this:
trace ("This line is ok : " + oPhysicalScreen.GetID());
trace ("This line gives me an error : " + oPhysicalScreen.GetIDFoo());
[Code] .....
View 2 Replies
May 18, 2009
I simple want to have a resize handle at the bottom right corner of a Movieclip that is being created dynamically via AS3. Can anyone point out an example of how this might be done?
View 2 Replies
Nov 28, 2010
I would like to automatically load an external swf inside an existing empty mc (or a new one) and load/unload different external swf on several button click functions. I've been trying so many different methods until its probably loaded with irrelevant functions!
var myLoader:Loader = new Loader(); addChild(myLoader); var url:URLRequest = new URLRequest("homepage.swf"); myLoader.load(url);
myLoader.x=477;
myLoader.y=0;
/* Click to Load/Unload SWF or Image from a URL.
Clicking on the symbol instance loads and displays the specified SWF or image URL. Clicking on the symbol instance a second time unloads the SWF or image.
Instructions:
1. Replace "[URL]" below with the desired URL address of the SWF or image. Keep the quotation marks ("").
2. Files from internet domains separate from the domain where the calling SWF resides cannot be loaded without special configuration.
*/
button_1.addEventListener(MouseEvent.CLICK, fl_ClickToLoadUnloadSWF);
var fl_Loader:Loader;
//This variable keeps track of whether you want to load or unload the SWF
var fl_ToLoad:Boolean = true;
function fl_ClickToLoadUnloadSWF(event:MouseEvent):void
[Code] .....
View 17 Replies
Apr 13, 2009
i just need to know about loading external sxf into an existing flash site. i used the load external code. but i just want to know about the link . how must i be. the example it like so
[Code]...
now the path where it says path how must it be. once these files are uploaded to my server. must it be like so(as above) or how the full part which is ./public_html/pics.swf
View 1 Replies
May 29, 2010
I have a file with existing MovieClips on the stage that I want to add Loaders to that will call external .jpgs from an XML file. I have the code working, but currently I have to add the Loaders one by one to the MovieClips. I'm sure there's a way to do this more easily by using a Loop, but I can't seem to get it to work no matter what I've tried.
I also want to be able to call a larger version of the image by clicking on the MovieClip/thumbnail. I've got the code working just fine, but when I tried to add a preloader to the full size image Loader, I got an error: Error #1009: Cannot access a property or method of a null object reference. Flash indicates this is happening at the callFull function so its definitely an error with my preloader code. [code]...
View 4 Replies