I Dont Want To My Class To Extend Anything?
Hi all,
I've been struggling with this for a while and figured it would be better to seek some advice from the kirupa forums as you guys have much more knowledge of as3 than me.
I am trying to build a simple debug class so I can debug remotely on projects I create. I got my class working using the singleton pattern so that it is only instantated once and it will trace fine, but when I try to add a TextField to the stage I get errors. I can't use addChild unless the class extends a DisplayObjectContainer, but if my class extends anything it throws an error.
The basic code is below for your thoughts? thanks?
Code: package { import flash.display.DisplayObjectContainer import flash.text.TextField;
public class Debug extends DisplayObjectContainer { private static var VERSION:String = "0.1"; private static var _instance:Debug;// enforce singleton pattern Debug instance private var _textField:TextField;
// static function to trace to debugger console public static function write(args) { if(_instance == null) { _instance = new Debug(arguments.callee); } // output arguments trace(arguments); // :TODO: send the arguments to the console }
public function Debug(caller:Function = null) { if(caller != Debug.write) { throw new Error("Debug is a singleton pattern class, use write() instead"); } if(Debug._instance != null) { throw new Error("Only one Debug instance should be instantiated"); } // initialize the console createConsole(); }
private function createConsole():void { // create Debug console here trace("*** New Debugger - " + VERSION + " ***") // :TODO: create the textfield and console this._textField = new TextField(); this._textField.width = 200; this._textField.height = 200; //addChild(this._textField); } } }
KirupaForum > Flash > ActionScript 3.0
Posted on: 03-26-2008, 04:49 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Tween Class In Custom Extend MovieClip Class
I want to use the tween prototype in a custom class that extends MovieClip. I am already including "lmc_tween.as" in my root and I have already replaced the "MovieClip.as" file in my flash directory with the one from the shared/Zigo directory. However, I still get compiler errors if I try to include "lmc_tween.as" in the class file, or without the include in the class it will compile but the tween prototype will not work in the custom class. Does anyone know how to fix this?
AS3 Class Extend
Hi everyone,
Been using classes since AS2.
Started a new project in AS3 has my first approach to the new script. One
thing that confuses me is that every single example of a class in the help
panel is by extending the class to a sprite, movieclip and so on. I compare
this with the AS1/AS2 "prototype":
MovieClip.prototype.setRGB = function (color) {
(new Color(this)).setRGB (color);
};
MovieClip.prototype.getRGB = function () {
return (new Color(this)).getRGB();
};
Doesn't the extend approach overload memory?
- Let's say I need a heavy class to personalize a button that is used
only once on the entire project and I extend it to a Sprite. Wont other
sprites used in the same project be heavier because they now have more
properties and methods available because of the extend?
Regards
How To Extend A PHPObject Class
hello,i wrote the flashObject class as follows:[code]
Code:
class flashObjects extends PHPObject {
//descrive il tipo dell'oggetto
private static var tipi:Array= new Array("router","linea","oggetto","cursore","segnaposto","gruppo","proprietŕ","contenitore");
private var tipo:String;
//parte router
private var id:Number;
private var sid:String;
private var colore:String;
ETC....
...
.....
but flash gives me the following error
**Errore** C:document_rootprove2004novembrephpobjectsfla shObjects.as: Linea 1: Impossibile caricare la classe 'PHPObject'.
class flashObjects extends PHPObject {
Totale errori ActionScript: 1 Errori segnalati: 1
AS2 - Best Way To Extend MovieClip Class?
What is the best/proper way for an AS2 Class to extend the MovieClip Class, to allow access to its methods (i.e. 'attachMovie()')?
Is it possible for an AS2 Class to access MovieClip methods w/o extending the MovieClip Class?
Thanks for any advice.
Extend MovieClip Class
I would like to write some clips, but it seems do not work.
my test.as file:
class test extends MovieClip {
function test() {
this.lineStyle(1, 0xff0000, 100);
this.moveTo(50,50);
this.lineTo(111,111);
}
}
code in first frame script:
var aline;
aline = new test();
stop();
Why the clip does not draw anything!?
But if i modify the class definition as follows:
class test extends MovieClip {
var mc;
function test() {
this.mc = _root.createEmptyMovieClip( "mc1", 10);
this.mc.lineStyle(1, 0xff0000, 100);
this.mc.moveTo(50,50);
this.mc.lineTo(111,111);
}
}
evrything is ok.
So, must be create a property and assign a new mc to it,
or it possible to use simply the this. object for drawing ?
Thanks if someone could help.
Extend MovieClip Class
I want to add a property to the MovieClip class that tells me if the object is draggable or not.
I tried to do this:
Code:
class MovieClip extends MovieClip
{
public var _draggable:Boolean;
}
But this doesn't work.
I tried to add:
Code:
class MovieClip extends MovieClip
{
public var _draggable:Boolean;
this.prototype._draggable = true;
function isDraggable():Boolean
{
return _draggable;
}
}
But it still doesn't work.
What I need to write?
How To Extend Movieclip Class ?
OK, I understand that I could create a separate *.as file that contain within it drawing functions to draw a shape out and in that class create within it static variable or just plain public variables for example each "Player" object have a direction, speed and such.
It would be no problem if the player is just merely objects that can be drawn with codes.
But...what if it's an image ?
I would import the image in flash, make it into a movie clip, give the clip a class name through the "Linkage" option and now I have the "Player" Class with the imported image I need....it's all good...but I don't want the "Player" class to just contain an image, I want to give it internal properties.
I presume I could do things like these in the first frame of the timeline:
ActionScript Code:
class Player_with_properties extends Player
{
public var PlayerDirection:int = 0;
public var PlayerSpeed:int = 0;
public function Player_with_properties()
{
trace("Constructor Initialized.");
}
}
But nooooo...Actionscript 3 says "Classes must not be nested.".
All I hear is, Ha Ha Ha from the Actionscript three....
So how do I create a class with image and properties ?
Model/Class To Extend XML
I'm a newbie to Flex 3/Actionscript, but have done OOP before.
My flex3 application downloads XML in e4x format from my web server, and and is left as a bindable XML object locally in my flex3 application. My visual objects then bind to various aspects of the XML object to display the data that I want.
My simple program is getting more complicated, and I'd like to extend the XML object and add some functions to it, so I can keep the code that manipulates the XML object separate from my base application. Lets call this new object LoginXML.
Can I please get an example of how to extend the XML object in flex3/as3 to create my own custom object with it's own functions. Part of my XML looks like
<nodes>
<node id="1">A</node>
<node id="2">B</node>
<node id="3">C</node>
</nodes>
and I'd like to make a function that outputs an Array of of the data and attributes of this XML section.
Sorry if my vocabulary is off Thanks.
--matt
Extend Array Class
I am trying to extend the array class.
In my fla I have this:
ActionScript Code:
var myArr:Array = new Array('1','2','3');
myArr.implode(myArr,';');
And my class looks like this:
ActionScript Code:
package{
import Array;
public class Array extends Array{
public var str:String = '';
public function implode(arr:Array, sep:String):String{
for(var i:int=0;i<arr.length;i++){
str += arr[i].toString()+sep;
}
return str;
}
}
}
When I run it, I get this:
Quote:
1113: Circular type reference was detected in Array.
How can I fix that?
When To Extend The MovieClip Class
1) When your class is used to produce anything visual (Put mc's on the stage)
2) When any part of your class needs to use a property, event, or method of the MovieClip class
Do I have this correct?
This Class Only Loads XML...what Should It Extend?
I have a class which allows the document class to say:
var mynewxml:XMLCLASS = new XMLCLASS("xmlfile.xml", newsTextField);
All that class does is load the file and put its contents into newsTextField. I have it currently extending Shape, to simplify it the most, I'm not sure what to extends to make Flash know its super simple and all it does is load an xml file and place the text.
*seems like extends Object keeps the filesize down the most. But I thought object was the biggest thing to inherit, and extending Shape adds 0.06KB to the size.
Extend TextField Class
I've made a lot f search on this subject and got no answers until now.
I've developed a class to extend the TextField Class, this is a simple class that checks if a textfiled is selected (focus) and cleans default text from it:
ActionScript Code:
class clean_txt extends TextField {
/*
* constructor
*/
private function clean_txt() {}
/*
* function checks if onSetFocus exists if true - cleans textfield
*/
public function remove_txt() {
this.text = "insert your name here";
this.onSetFocus = function () {
this.text = "";
}
}
}
No my problem is to assing the clas to a text field without the use of ptotorype.
I have this code on the movie:
ActionScript Code:
this.createTextField("name_txt", 1, 10, 10, 200, 20);
this.name_txt.background = true;
this.name_txt.border = "1px";
this.name_txt.type = "input";
name_txt.remove_txt(); //this should work now :(
//
Using:
ActionScript Code:
name_txt.__proto__ = clean_txt.prototype;
the class works fine but prototype is bad use.
Any opinions on this subject?
Custom Class To Extend Button ?
Can this be done? I got my custom class to extend an MovieClip no problem. Can't seem to get it to work when I try applying it to a Button. I've found no examples of this. Just curious as to if this is even an option.
Can A Class Extend Multiple Classes?
Anyone know if this is possible, and what proper syntax would be?
thx!
Sadly the debugger is telling me NO!
Quote:
Line 9: A class may not extend more than one class.
class XmlMenu extends Sound, extends MovieClip {
How To Best Extend A Static Class To A Dynamic
i wanted to create a Label and attach another variable to it (called "link") and make it a button. However Label is not a dynamic class so i decided to do this:
ActionScript Code:
package {
import flash.display.Sprite;
import flash.display.Shape;
import flash.events.MouseEvent;
import flash.text.TextField;
public class DynamicLabel extends Sprite {
public var link:String;
public function DynamicLabel(_title:String, _link:String) {
//bg
var _bg = new Shape();
_bg.graphics.beginFill(0x888888);
_bg.graphics.drawRect(0, 0, 100, 15);
_bg.graphics.endFill();
this.addChild(_bg);
//text
var title:TextField = new TextField();
title.text = _title;
this.addChild(title);
//link
this.link = _link;
this.addEventListener(MouseEvent.CLICK, clickHandler);
this.buttonMode = true;
}
private function clickHandler(e:MouseEvent):void
{
trace(e.target.link);
}
}
}
However when i run it and click on the "DynamicLabel" object (when the "clickHandler" function in executed) i get this error:
Code:
Property link not found on flash.text.TextField
i want to property "link" to be a part of my class, my object. Why does it look for it in the TextField?
Any workaround is greatly appreciated too All i'm trying to do is make dynamic buttons...
AS3.0: How To Extend A Class That Extends MovieClip
When I try to set the base class of a library symbol to a class that doesn't DIRECTLY extend MovieClip, but instead extends another class that DOES extend MovieClip, it's disallowed, saying, "The class 'Whatever' must subclass 'flash.display.MovieClip' since it is linked..."
Is this just a validation bug in the property windows, only checking one class deep into the inheritance hierarchy? Because the specified class does extend MovieClip, just two levels in instead of one. Is there a fix for this? Or must library symbols always directly extend MovieClip? If so, why?
Creating A Class To Extend Math
i have a function that i wrote in flash mx, and now that i'm using flash mx 2004, i'm going to have to use a class.
the function is like this:
ActionScript Code:
//as 1.0:function formatNumber(numberToFormat, decimalPlaces) {//}
how would i format that to put it into a class that extends the Math setion of as 2.0?
Cant Extend Web Service Connector Class
hello there, thanks for checking this. I am trying to extend the WebServiceConenctor class to make a class that checks a web service at set intervals and has some other functionality. I want to set the properties of the object in the constructor but I cant get it to work, also I want to be able to trigger the webservice from methods within the Check class but I think I have the syntax wrong.
If anyone could let me know what I'm doing wrong I would be really grateful. Thanks
ActionScript Code:
class Check extends WebServiceConnector { var active:Boolean; //interval vars private var checkInterval:Number; private var checkFreq:Number; private var log:String; //constructor: public function Check(frequency:Number, url:String, theOp:String) { trace("url set:"+url); trace("operation set:"+theOp); this.WSDLURL(url); this.operation = theOp; this.suppressInvalidCalls = true; checkFreq = frequency; } // methods: function sendLog():String { trace("sendLog called"); this.trigger(); return log; }
Creating A Class To Extend Math
i have a function that i wrote in flash mx, and now that i'm using flash mx 2004, i'm going to have to use a class.
the function is like this:
ActionScript Code:
//as 1.0:function formatNumber(numberToFormat, decimalPlaces) {//}
how would i format that to put it into a class that extends the Math setion of as 2.0?
Inherit / Extend Class Calls Constructor...
Hi,
Class A extends class B like so:
public class A extends B{}
Why is class B's constructor called? I thought when A extends B, A gets all of B's methods and variables, great; but I don't need the constructor called because class B has already been created. I just want class A to inherit all of B's methods and variables. Can a class have two constructors, so when I extend class B an empty constructor is called but when I instantiate it the constructor with code is called?
I feel like I’m missing something here.
Thanks,
4dplane
Making A Color Tinter... Which Class Do I Extend?
Hi everybody,
I've got some code that will change the color and tint of an object and return the hex value of the new color. I am trying to make a custom class out of the code and I'm not sure which class this color tinter should extend. Should that be the color class?
Also, how do I go about determining the class to extend when I want to create new classes?
thanks!
-brian
Inherit / Extend Class Calls Constructor...
Hi,
Class A extends class B like so:
public class A extends B{}
Why is class B's constructor called? I thought when A extends B, A gets all of B's methods and variables, great; but I don't need the constructor called because class B has already been created. I just want class A to inherit all of B's methods and variables. Can a class have two constructors, so when I extend class B an empty constructor is called but when I instantiate it the constructor with code is called?
I feel like I’m missing something here.
Thanks,
4dplane
Logic Behind Flash's Classes (or: When/where To Extend A Class)
Hey there,
I'm still quite new to flash &programming and I'm half way through a book called "object-oriented actionscript for flash 8".
I am reading about the framework of classes that flash provides and I'm just wondering how exactly "borders" are decided between classed and extensions for them
for example: the movie class and the UIObject class (UIObject extends Movie class):
in Movie class there is a function called moveTo(x:Number,y:Number)
then in UIObject there is a functin called move(x:Number,y:Number)
so why aren't both in Movie or both in UIObject? are they really the same thing, but it just depends where you want to access movement from? I'm generally confused in when I extend classes, and where I would "draw the line" between one class and the extension of it, and Im trying to get an idea of logic by looking at how flash does it.
Any comments or pointers are much appreciated!Thanks!
[AS2.0]extend Class, No Error, Doesn't Work
Hi, to find an error in ths one is pretty challenging, I have a class which I wanted to make this "menu" moveclip thing extends when I roll Over and go back to the original length if roll out, here's the code, it returns no errors, just doesn't work...
thanks for your help, the code is pretty long but please, if you have time, I really need your help...
ActionScript Code:
//ClASS CODE
class ExtendBar extends MovieClip{
var homeX:Number;
var finalX:Number;
var myClip:MovieClip;
var extendSpeed:Number;
var slowDown:Number
var extend:Boolean;
function ExtendBar(origX:Number, endX:Number, clips:MovieClip, slow:Number){
homeX = origX;
finalX = endX;
myClip = clips;
slowDown = slow;
}
function extendIt(){
myClip.onEnterFrame = function(){
this.extend = true;
extendSpeed = Math.round((finalX - homeX)*slowDown);
if(extendSpeed == 0){
this.extend = false;
this._xscale = finalX;
delete this.onEnterFrame;
}
myClip._xscale += extendSpeed;
}
}
}
ActionScript Code:
//FLA CODE
var menu:ExtendBar = new ExtendBar(20, 400, this, .05);
menu.onRollOver = function(){
extendIt();
}
When Making A Document Class Should You Extend MovieClip Or Sprite?
When creating a project with a Document Class should your Document Class extend MovieClip or Sprite?
It seems that if your Fla uses the timeline and contains more than a single frame you'll need to extend MovieClip.
If your fla uses only one frame Sprite might be the better choice. But, are there cases where you might want to use MovieClip still?
Any project could be built around either base Class, MovieClip or Sprite, is one a better choice than the other? It seems MovieClip uses more memory, but is this enough of an issue to make it a best practice?
I'm just getting up to speed with this AS3 stuff and was looking for some thoughts on the subject.
My Xml Class Dont Work :(
Im trying to set up a class which will load xml and return data I can later parse with a parser class.
When I run the getRawData function from the fla, I get [type function]. any ideas?
Code:
class XMLloader {
public var rawData:String;
public var setTimeout:Function;
private var _filePath:String;
private var myXML:XML;
function XMLloader(filePath:String) {
this._filePath = filePath;
this.myXML = new XML();
init();
}
private function init() {
myXML.ignoreWhite = true;
myXML.onLoad = function() {
rawData = this;
};
myXML.load(_filePath);
}
public function getRawData(){
return rawData;
}
private function toString():String{
return ("[XMLloader]")
}
}
from the fla
Code:
import XMLloader
var myXML:XMLloader = new XMLloader("test.xml");
trace(myXML.getRawData)
[/code]
My Xml Loader Class Dont Work :(
Im trying to set up a class which will load xml and return data I can later parse with a parser class.
When I run the getRawData function from the fla, I get [type function]. any ideas?
Code:
class XMLloader {
public var rawData:String;
public var setTimeout:Function;
private var _filePath:String;
private var myXML:XML;
function XMLloader(filePath:String) {
this._filePath = filePath;
this.myXML = new XML();
init();
}
private function init() {
myXML.ignoreWhite = true;
myXML.onLoad = function() {
rawData = this;
};
myXML.load(_filePath);
}
public function getRawData(){
return rawData;
}
private function toString():String{
return ("[XMLloader]")
}
}
from the fla
Code:
import XMLloader
var myXML:XMLloader = new XMLloader("test.xml");
trace(myXML.getRawData)
Extend Class Movieclip And Movieclip Off Stage
Hi all,
Using Flash 8 and getting over to AS2.0 I got this problem. Could not find any answer on the forum until now.
I am trying to get some more grips on AS2.0 and do this by making a small game. On several frames are movieclips: mc1 mc2 etc. When the user clicks on them, the total number of clicks is recorded (among others) for each movieclip. On different frames are different movieclips.
I tried three ways.
1. First I defined a class MyMovieClipClass extends MovieClip with:
code:
private var clicks: Number
private function onPress: Void {
clicks++;
// do other things
}
public function howMuch: Number{ // return clicks }
Movieclips mc1, mc2, etc are defined being a member of this class in ‘linkage’.
The problem arose that when on a frame without mc1 I could not access mc1.howMuch() becase in that frame there is no mc1.
2. Then I defined two classes MyMovieClipClassA and MyMovieClipClassB
The movieclip on stage mc1 is a member of Class A and var clicks is in Class B.
The instance name of class B is derivated from the instance name on stage:
mc1 (ClassA) is kindof connected with mc1_obj (ClassB)
MyMovieClipClassA extends MovieClip with:
code:
private function onPress: Void {
// make instName = this._name + “obj”;
instName.clicks++;
// do other things
}
MyMovieClipClassB with:
code:
private var clicks: Number
public function howMuch: Number{ // return clicks }
In the timeline I then define:
code:
var item1: MyMovieClipClassA = new MyMovieClipClassA();
var item1_obj: MyMovieClipClassB = new MyMovieClipClassB();
which is not very elegant.
(the movieclip to which this belongs has the name item1)
3. I tried to declare ‘_name + “_obj”’ in de constructor of ClassA but did not succeed.
Anybody any suggestions for an elegant solution in which different movieclips in different frames on stage can be tracked using classes?
Thanks in advance for your reaction.
Display Object From Child Class ? Sound But No Video. I Dont Get It...
So I have a main package with a main class, then it breaks down into children from there (I think thats how you explain it). I am trying to stream a video and get it on the stage. I know my issue is with adding the display object but I dont get it - I have too many forum posts / books open but I just cant seem to get it. How do I get it to display when compiled? I can hear the sound but cant see it.
Main Package:
package core {
import flash.display.*;
public class SecretSolutions extends MovieClip {
var secretsXMLFile = "../xml/secrets.xml";
public function SecretSolutions() {
var secretsXML = new GlobalXML;
var secretsVideo = new GlobalVideo;
secretsVideo.showVideo();
secretsXML.importXML(secretsXMLFile);
}
}
}
Global Video Package
package core {
import flash.display.*;
import flash.net.*;
import flash.events.*;
import flash.media.*;
internal class GlobalVideo extends MovieClip {
public function showVideo () {
var video:Video = new Video(320,240);
addChild(video);
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
function onStatusEvent(stat:Object):void{
trace(stat.info.code);
}
var meta:Object = new Object();
meta.onMetaData = function(meta:Object){
trace(meta.duration);
}
ns.client = meta;
video.attachNetStream(ns);
ns.play("video_001.flv");
}
}
}
Thanks in advance and for any insight - Im new to AS3
Check Dont Works,I Dont Know Where Is The Mistake
What I´m trying to do is next. When you roll over a button , him has to check if a mc has the frame in number 27 and if its oky tell another mc to play o what ever
on (rollOver) {
if (_root.klip.de.klips.pantalla.klips.pntgrand._curr entframe == 27) {
_root.klip.de.klips.pantalla.pntgrand.gotoAndstop( 1);
} else {
_root.klip.de.klips.pantalla.pntgrand.gotoAndPlay( 2);
DONT WORK I DONT KNOW WHY
if (_root.klip.de.klips.pantalla.pntgrand.currentFram e<=27) {
tellTarget ("_root.klip de klips .pantalla.klip panta back") {
gotoAndPlay(2);
}
}
}
}
dont work ider
Easy Question... I Dont Know Why I Dont Know It....
erm..
this is a bit stupid really.. what do i put on a button instance to make a file download to the user's computer..
eg when they click on the button it downloads a jpeg from the sever..?
stupid aint it...
Dont Understand Why This Dont Work
ok this file is from another post and workes fine as far as the movement and stopping. i tried to add a button to it but the function seems to overtake every other script in the movieclip. heres the fla. is there a workaround or am i doing this wrong?
thanks for your time!
To Extend Or Not To Extend
I'm doing so work with Hindi/Devanagari text. The problem with Flash and complex languages like this is two-fold. You can't embed the fonts, so you can't count on things looking right. And Flash doesn't seem to know to break words at the spaces instead of just in the middle of letters.
So I need to make a custom TextField class. I can't decide if it should extend the regular class or if I should do a composition and just wrap an instance of a TextField in my class.
I'm leaning toward composition. Anybody have any guidance or suggestions?
Extend...
Is there a tutorial out there that shows how to make like a bar, and the bar keeps on extending? Does that make any sense?
How To Extend This?
Need to make each button in this script have its own unique color? Anyone want to help me to achieve this?
Download .fla here
The code;
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
#include "lmc_tween.as"
function hitButton(btn) {
btn.onRollOver = function() {
this.colorTo (0x3366FF); }
btn.onRollOut = function() {
this.colorTo (0x000000); }
btn.onRelease = function() {
for (var i = 0; i<5; i++) {
_root["btn"+i].enabled = true;
}
flop(myPrevButton);
if (this._xscale>-50) {
this.enabled = false;
flip(this);
myPrevButton = this;
}
}
}
for (var i = 0; i<5; i++) {
_root.hitButton(_root["btn"+i]);
}
function flip(who) {
for (var i = 0; i<5; i++) {
who.colorTo (0x3366FF, 2); }
var twflip:Tween = new Tween(who, "_xscale", Bounce.easeOut, 100, -100, 1, true);
}
function flop(who) {
for (var i = 0; i<5; i++) {
who.colorTo (0x000000, 2); }
var twflop:Tween = new Tween(who, "_xscale", Bounce.easeOut, -100, 100, 2, true);
}
Extend Or Not To Extend?
Hey,
Whats your opinion on extending a class from MovieClip? I could just make a movieclip variable in the class to make it simpler. I heard if you extend from Movieclip it makes it feel like its dynamic because you have frames (gotoAndStop, etc). However, it allows me to have direct access to variables (or this.) instead of somemc., and I believe thats faster because 1) smaller name variable lookup, 2) no get function call.
Opinions?
Thanks
Extend...
Is there a tutorial out there that shows how to make like a bar, and the bar keeps on extending? Does that make any sense?
Need To Extend Timeline
I want to make a flash slide show that runs the lenght of a song. the time line runs out before the song is over. Is there any way that I can extend the time line to go as long as the song? Do I have to chop up the song some how and us many scenes or can I do it all as one scene?
Extend Vars
hello
I want to set this variable "url" it has to be something like test.php?idrace=12
But this code is not right... please help.
_root.gehele_kalender["report"+aantal2].url='test.php?idrace='_root.inhoud["verslag"+j];
Extend Timeline?
(Using Flash 5 on Win 98)
I know this is probably a simple Q, but I can't figure it out. How do I drag the timeline out to see a full song wav? I imported a song from the library, dropped it on the workspace in the first frame, but when I try to pull the song out, it just moves it to another frame. I don't think I understand how to extend my timeline to see the full wave file. Can someone help? Thanks :/
How Do U Extend The Timeline?
alright, i know this sounds rudimentary but i can't figure it out. i know u can simply drag the scroll bar or extend the timeline window but there is a limit to this. how do u manually extend the frame count in the timeline? there has to be some way to extend the timeline to "x" amount of frames. i need to do an animation that's like 3 minutes long so i need to know. otherwise i have to do separate scenes which i'd rather not do. if anyone can help me out, that would be great!
Extend Movieclip
I know how to attach a class to a movieclip via the linkage dialog, but how can I do it if I create the movieclip by createEmptyMovieClip(); ?
any help on this would be greatly appriciated
Can I Extend ALL Movieclips At Once?
Basically I'm creating a script that will extend the MovieClip class by adding an isPlaying boolean similar to what Senocular explained here:
http://www.kirupa.com/forum/showthread.php?p=2098269
I'm trying to develop a basic play/pause button that can be applied to any flash file to play/pause the animation (most animation that I deal with is timeline based). The idea is for it to go through the display list and find all the movieclips and stop or play them, depending on the isPlaying attribute.
Now the issue that I'm running into is how can I apply this class to every MovieClip in the library without having to go through, one-by-one in the properties of that clip and assigning the class? Is this even possible? Or am I just completely inept at how to really apply this class? Thanks!
How To Extend A Package
I'm not an expert on OOP (as you'll see) and I'm making a GUI using AS3 and Colin Moock's implementation of the MVC paradigm and want to streamline this and future production by creating a set of superclasses which I'll extend on a project by project basis.
I've added the main folder that houses these classes to my Classpath in Flash's ActionScript 3.0 settings. Let's say the fully-qualified name for that package is fully.qualified.packagename. And suppose the main class for the application is Interface. I have an FLA in another part of my hard drive entirely, and I'm able to use the package via its fully-qualified name, putting fully.qualified.packagename.Interface as the document class. No problem there.
Where I'm ignorant and run into problems is in trying to extend this package, to create another local one that inherits from the individual model, view and controller classes of the original package. Any advice on how to do that? Part of my problem is that I don't really understand the use of the "package" keyword and don't know where/how it is necessary.
"MOBS" is the acronym for the project I'm working on (no, it doesn't stand for "Multiple Orbital Bombardment System" ). There's a folder next to my Flash movie called "mobs_interface", which contains the subclasses. Within it, I've created a MobsInterface.as which I'm using as the Document class for my flash movie - mobs_interface.MobsInterface - and it uses/references the nearby subclasses rather than the original ones.
For the moment, these "subclasses" are not subclasses at all, but just have different names from the original classes. Everything still compiles.
But, I'm in the process of making them subclasses, so suppose I take one of those component classes and try to inherit from the original package in the most minimal way:
ActionScript Code:
package mobs_interface{
import fully.qualified.packagename.*;
class MobsInterfaceModel extends InterfaceModel {
public function MobsInterfaceModel() {
//super();
}
}
}
Well, I'm getting the message that it can't find the definition for the InterfaceModel class, even though I've imported fully.qualified.packagename.InterfaceModel. I know that compiler errors can be very cryptic and that my problem probably lies elsewhere but I'm not sure where to start.
I don't think anyone here needs to solve my particular problem for me, but if someone could direct me to a specific technote or tutorial for extending a package like this, I'd be most grateful. If you've read this far, thanks for doing even that much!
Extend Strings
I'm trying to learn how to code my own class to extend the String class.
I want to be able to add more methods to it.
i have this class, and I named the file XString.as and put it in the same directory my FLA is in.
ActionScript Code:
class XString extends String
{
private var XStr:String = "";
function XString(s:String)
{
// Comstructor
if (s == undefined) s = "";
XStr = s;
}
function firstChar()
{
return XStr.charAt(0);
}
}
in the FLA i try to use it like this...
ActionScript Code:
var s:XString = new XString("testing");
trace("firstChar["+s.firstChar()+"]");
trace("charAt["+s.charAt(0)+"]");
trace("s["+s+"]");
that traces the following...
firstChar[t]
charAt[]
s[]
so my firstChar() method worked. but it seems like the class isn't really extending the String class, because charAt didn't work. plus i don't know how to access the string without making an annoying access method.
can someone please help?
Extend TextInput
Hi --
I am just beginning to migrate from ActionScript 2 to Actionscript 3. I
would like to create a simple custom control with the TextInput as the base
component and just a few custom properties of my own to help me understand
how AS 3 works. I have started with this code:
package {
import fl.controls.TextInput;
public class MyTextInput extends TextInput {
public function MyTextInput() {
}
}
}
I have my document class set to MyTextInput and I have my publish settings
set to AS 3 and I have "Export to SWC" checked.
When I try to publish my component I get two errors:
1017: The definition of the base class TextInput was not found
5000: The class "MyTextInput" must subclass "flash.display.MovieClip" since
it is linked to a library symbol of that type.
I am confused by the 5000 error as I have no items in the library.
Any help would be appreciated.
Thanks
Rich
Extend FLVPlayback
Hello,
I would like to extend the FLVPlayback class. More precisely, I would like to access to the property uiMgr and control skin's visibility. I tried to extend the class but uiMgr is not accessible with an extended class.
I tried to create a swc file after having added some functions to fl.video.FLVPlayback. I did it with flash8/AS2 but I failed with FlashCS3/AS3, and I don't know why...
If someone can help me... thank you !
TC
Extend Components
hi,
can anybody tell me abou how to extend Components, like if i hav to place images next to the content inside a listBox Component, how do i do that??????
Extend Components
hi,
can anybody tell me abou how to extend Components, like if i hav to place images next to the content inside a listBox Component, how do i do that??????
|