ActionScript 2.0 :: Library Access/attachMovie From Within A Class?
May 4, 2007
I'm currently attempting to build my first classes in AS2 (with high hopes to soon move to AS3..baby steps). I have run into a problem that has cost me the last few hours of the night tonight and I still feel like I'm no closer to the solution >_<
The scenario: I am attempting to create a couple classes that work together to handle the creation of textFields and the methods by which to scroll them (if needed). One class method creates the TextField, populates it, then calls the next class that attaches and sets up the scrolling components/methods if needed.
The problem: I cant access items in my library from my class no matter which way I slice it. I need to attach movieClips from the library to act as my scroll components and am currently attempting to do so by passing the linkageIDs through the constructor. Tracing the items passed through works fine, but attempting to use attachMovie with them (or with the ID's as literal Strings) fails silently; nothing gets attached.
View 4 Replies
Similar Posts:
Aug 20, 2006
Is there a way to extend the movieclip class without using a library item and attachMovie?
View 3 Replies
Jan 27, 2010
Got two classes "Engine.as" and "Player.as". Engine.as is the document class that is calling Player.as.
The point is to have Player.as create a movieclip on the stage, but it seems it cannot access the library or something. Because when the player class is at the createHero() method it gives me the "error 1009 cannot access a property or method of a null object reference"
Engine class:
Code:
package test{
import flash.display.*;
import flash.events.*;
[Code]....
View 2 Replies
Dec 4, 2009
If it's possible to access the class library, i.e. instantiate custom classes, from a loaded external SWF file?
I have a sprite on the stage with the instance name "speakers". I've got this working so far[code]...
View 8 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
Feb 26, 2009
I'm creating a card game and I need to use graphics from the library. All the movieclips have their linkage setup. How do I access the library movieclips from a class?
View 2 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
Nov 9, 2009
I have a movieclip library symbol exported for ActionScript with name McFloor and identifier McFloor and I'd like to access it from OneChart class.
[Code]...
View 1 Replies
Jan 23, 2010
I have an item in the library that is exported for actionscript. Its class name is MoveArrow and in the document class I create an instance of it the following way[code]...
HOw do I access a library item from outside the documentClass?
View 2 Replies
Aug 16, 2009
I'm having a problem adding a library clip to my stage I can do no problem if I have a testFLV.fla that has a library clip called test_clip with the linkage set to: com.attach_clips.Clip.
import com.app.views.mediaDisplay;import com.attach_clips.Clip;
public class FLVTest extends Sprite { private var _mediaDisplay:mediaDisplay; public function FLVTest() { this._mediaDisplay = new mediaDisplay(null); var clip_1_mc:Clip=new Clip(); var clip_1_mc:Clip=new Clip(); this.addChild(clip_1_mc); clip_1_mc.x=100; }}
If I use the same concept in my mediaDisplay class, the clip isn't added to the stage. Obviously it's got to be a scope issue since 'this' in the first examplerepresents the .fla itself but in mediaDisplay this doesn't have a stage object.
package com.app.views {
import flash.display.Sprite; import com.attach_clips.Clip; public class mediaDisplay extends Sprite { public function mediaDisplay(attachControls:Sprite) { var clip_1_mc:Clip=new Clip(); this.addChild(clip_1_mc); clip_1_mc.x=100; }; }}
how I could 'attach' test_clip to the stage from mediaDisplay?
View 13 Replies
Nov 11, 2003
I can't make Flash do a gosh darn thing 'flashy', no matter how many tutorials I read, and how many demo's I see, it never seems to do what would make sense. This worked fine until I tried to plop the dynamic text box into its own movie object in the library... I've opened flash, drawn a simple dynamic text box. Set the dynamic text box's data variable to szTextBoxData (why don't text boxes just have a value property? anyways..).
Then selecting it, I convert it to a symbol (as a movie) call it DynamicTextMovie, and stuff it away into the library. Now I delete it from the layer, as I want to add it dynamically at run time. Next, on frame one of the main movie, I insert this code. (sorry for the bad formatting, limit of the forum here..)
[Code]....
View 4 Replies
Mar 15, 2010
I am trying to access a text object inside an MC inside a variable (with a corresponding Symbol name) after dynamically attaching an MC. the code that sets the "dockTemplate" variable is below. I'm trying to write to the "item" property called "label" on a rollover function called "dockRolls".
var dockTemplate = {
layout: 0
icon_size: 80,
icon_min: 50,
[Code].....
externally, there is another AS file that extends the MovieClip class which is setting up the functions, etc. in 'var dockTemplate'. that seems to be working fine. my question is:
HOW do I write to/access the text object 'orderEntry_txt' inside 'dockTemplate'?
View 0 Replies
Sep 7, 2006
but the thing im trying to achive is something likethe seperating lines you can see on this page:I dont really find it that difficult just to create some lines like that,.. but im tryingmake a class. So one seperatorline would be an instance of the class..
View 3 Replies
Oct 14, 2010
I created an flv video player using Flash Builder 4. This "BasicVideoPlayer" project is compiled into a SWC that will be eventually be used to create other video players that extend the functionality. One of the features is a view that appears when the video has finished playing that displays a "Play Again" button. This "Play Again" view has its own class, "BasicPlayAgain", that accepts a graphic asset that is exported from a .fla file that contains all of the graphic/UI assets.
In my new project, "EnhancedVideoPlayer", I'm using the BasicVideoPlayer SWC as a library to create a new video player that will add more functionality to the "Play Again" view; specifically it will add more buttons to that view.The EnhancedVideoPlayer uses a default class that extends the BasicVideoPlayer class. The BasicVideoPlayer class has a member called "playAgainScreen" whose type is BasicPlayAgain. The EnhancedVideoPlayer needs to override the playAgain member and recast it as EnhancedPlayAgain so it can control the new buttons properly.
View 1 Replies
Mar 13, 2011
I'm trying to load a RSL library into a flash animation developed with Flash CS5 IDE, that extends a custom class and implements an interface. I have reduced the problem to the simplest setup and find that I can have my main class extend another class or implement an interface, but not do both at the same time if I want to load an RSL.I have a very simple class to extend:
import flash.display.Sprite;
public class MySprite extends Sprite
{[ code]...........
but if I want both I get the VerifyError: Error #1014 with MySprite not found and ReferenceError: Error #1065.
View 2 Replies
Jan 22, 2011
The use of library classes confuses me once again. I have the following situation:
[Code]....
I cannot put in any baseclass when using the class, so I'm forced to remove the baseclass. When using only the class I get a whole bunch of errors don't make any sense at all, and still appear even if I comment out all the code in the Page class. comop_padpagesFavorietenPage.as:7: 1152: A conflict exists with inherited definition com.op_pad.pages:Page.help in namespace public.
[Code]...
View 1 Replies
Dec 9, 2010
Library symbol "Card" is linked to class "Card" which extends "MovieClip". Library symbol "Card" contains a card background image.Library symbol "Ace" is linked to class "Ace", which extends class "Card". Library symbol "Ace" contains a TextField with a big letter "A".So we have Ace extends Card which extends MovieClip. Ace therefore extends MovieClip, but does not DIRECTLY extend MovieClip.When I drop an instance of Ace on the stage and compile the clip, all that shows up is the big letter A. However, I expected the background image from Card to be included, since Ace extends Card, and the Card symbol contains the background.It seems like Flash ignores symbol content unless it belongs to the top-level class being instantiated.I think it's LAME that one symbol can't extend another. The IDE could easily draw Card as a non-editable background while I'm editing Ace which extends it, and it should instantiate Card's content and then Ace's content when an Ace is instantiated.
View 3 Replies
Dec 11, 2009
I was working on a file where I imported a few sounds to the library but now lost the actual sound files, but I have the sound in my library (in the fla). How can I use them through AS3? Currently I do something like: Quote:
var music:Sound=new Sound(newURLRequest("outbreak.mp3"));
var sc:SoundChannel = music.play();
how can I access the sounds in the library?
View 2 Replies
Jun 3, 2009
I have a main swf called, main.swf; Inside it I load another movie, skin.swf (this has 10 movieclips in the library with linkage name). What I want is to attach the movieclips from skin.swf inside the main.swf.
But problem is I am not able to attach the movie clip in the main.swf from skin.swf.
View 3 Replies
Sep 23, 2011
Flash is great tool for animations. I was wondering if I could send events to Java and receive results back. In other words call some functions in flash and get their results.
View 2 Replies
Aug 15, 2010
Does flash store the items in the library in an array? I would guess yes. For example if i have an array named pics in my fla file can i write something like:
for(var counter:int = 0;counter < library.array.length;counter++){
pics.push(library.items[counter];
}
View 9 Replies
Jan 9, 2012
I'm having some doubts about how to access some features of embedded files and loaded.
For example, I created a .fla and added a symbol to your library - a MovieClip with name and class circle. Then convert the .fla to .swf, thus becoming test.swf.[code]...
View 8 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]How to access them when doing it with swf and loader class?
View 1 Replies
Jul 15, 2004
wants to know whether i can access a online library for actionscript.Example: A place where it'll explain what "==" means, aswell as listing other script definitions.
View 2 Replies
Jan 29, 2012
If I have three classes:
public class Example {
public function Example () {
}[code]............
You can see that the two last classes extend the first one, and both have the 'variable' property. In case that I have an instance of Example and I am sure it is also an ExtendedExample OR AnotherExtendedExample instance, is there some way to access the 'variable' property? Something like
function functionThatReceivesAnExtendedExample (ex:Example):void {
if(some condition that I may need) {
ex.func()
View 3 Replies
Apr 8, 2010
I have a initApp.as which instantiates a class which needs to access the "currentState" property and the States array as well. However we cannot get this to work as we cannot see how we can access this information.
Within initApp.as currentState is accessed via "this.currentState". This does not work in the class which is instatiated within initApp.as. The following error is thrown:
"Access of undefined property currentState."
View 1 Replies
Nov 24, 2011
I have the following inheritance structure:
var environment:AvEnvironment = new AvEnvironment(...);
addChild(environment);
environment.addChild(new Terrain());
environment.addChild(new Player());
I am trying to access a public property from AvEniroments class through the Player class, however I'm getting an undefined property error (#119). I've tried the following:
this.x = AvEnvironment.xs // public property in this class
this.x = parent.xs
I've also tried something like this:
var ev:AvEnvironment = AvEnvironment(parent);
this.x = ev.xs
but I get a TypeError. Error #1009: Cannot access a property or method of a null object reference.
View 1 Replies
Jan 7, 2009
I'd like to put a given cursor design in the library, then make a call to it using the custom cursor script I'm working on (detailed in the other thread). This is more professional and attractive than keeping some thing on the stage.
View 8 Replies
Sep 10, 2009
Having this litle code, how do I access the erro textArea?[code]...
View 1 Replies
Feb 14, 2012
And I'd like to create app with air for ios. how can I access iPhone camera with air and use library ( ASFEAT and Away3D ) for create AR app.
View 1 Replies