ActionScript 2.0 :: [FMX] Custom Sound Class Not 'inheriting' OnLoad

Jun 28, 2004

My problem is with a class i wrote called frameSound which extends the Sound object. Well that was the plan but.. it doesn't seem to react to the onLoad event. Here's the code:

Code:
//custom frameSound class constructor.
frameSound = function(){
frameSound.count++;

[Code].....

View 4 Replies


Similar Posts:


ActionScript 2.0 :: [FMX] Custom Sound Class Not 'inheriting' OnLoad?

Jun 28, 2004

have read the brilliant OOP for actionscript 1 tutorial from cover to cover and it has me enormouslyMy problem is with a class i wrote called frameSound which extends the Sound object. Well that was the plan but.. it doesn't seem to react to the onLoad event. Here's the code:

Code:
//custom frameSound class constructor.
frameSound = function(){

[code].....

View 4 Replies

Actionscript 3 :: Error 1120 When Inheriting Document Class?

Feb 25, 2011

I am working in Flash CS4 with AS3.

I have a TextPage.fla file that contains a dynamic text field (name: PageTitle) as an instance on the stage. In the document class (TextPage) I set the text of PageTitle according to some XML. This all works fine.

I have another fla file, SpecialTextPage.fla, and that also has the PageTitle dynamic text field on the stage.

I now try to have the SpecialTextPage document class inherit from Textpage:

public class SpecialTextPage extends TextPage
{
...
}

but I get a "1120: Access of undefined property PageTitle." error when trying to publish SpecialTextPage. The error location is given as TextPage.as

As a workaround I can just copy the whole TextPage.as file and add in the extra things I need in SpecialTextPage.as but I'd obviously prefer it if I could just extend it.

I got the feeling I am not quite understanding the relationship between flash's objects on the stage and the document class.

View 2 Replies

ActionScript 3.0 :: Loading Sound On Onload?

Jan 14, 2010

I want to load a function/sound to play ONLY on the first load.eg/I have four pages, one page has a sound that loads every time I click back to that page. Is there a way to make it only load the first time that page is loaded?

View 5 Replies

ActionScript 2.0 :: Sound.onLoad + OnError

Dec 23, 2004

i'm making somekind of music / video player in flashmx2004. it plays streaming mp3 en flv files. random people can put a link into the players database. of course there will be some that insert a dead link, now i want to check with actionscript (1.0) if the link is dead and if so, the player automaticly will skip this track.this is what i've got allready to load te streaming sound:

_root.playSound = new Sound();
_root.playSound.loadSound(trackurl,true)

trackurl is the link to the file. link to the player atm: [url]

View 1 Replies

ActionScript 2.0 :: Include In A Class The Implementation Of The OnLoad Function Of The XML Class?

Dec 14, 2005

how to include in a class the implementation of the onLoad function of the XML class. I have something like:

[Code]...

View 2 Replies

ActionScript 2.0 :: Calling A Function From Within Sound.onLoad()

Sep 11, 2007

So I'm trying to call a function from the onLoad method of my sound object and something is wrong with my scope.

see my example...

Code:
class com.infect.SoundController{
private var soundObject:Sound
private var soundMC:MovieClip

[Code].....

View 2 Replies

Actionscript 2.0 :: Access Sound Duration Outside Onload Function?

Jan 21, 2009

How to access the sound duration outside the onload function....im trying to diaply the duartion of each song in the playlist by loading them one after the other...but am not able to access duartion of all the mp3 files....i want to knw if there is any way to access the sound duration outside the sound.onload function.

View 3 Replies

ActionScript 2.0 :: Sound.onLoad + OnError - Making Music / Video Player In Flashmx2004

Dec 23, 2004

i'm making somekind of music / video player in flashmx2004. it plays streaming mp3 en flv files. random people can put a link into the players database. ofcourse there will be some that insert a dead link, now i want to check with actionscript (1.0) if the link is dead and if so, the player automaticly will skip this track. this is what i've got allready to load te streaming sound:

[Code]...

View 1 Replies

ActionScript 3.0 :: Create A Custom Class That Extends The MovieClip Class And Contains A Custom Property Of "marker"

Jan 23, 2010

I am new to AS3, as well as Flash in general, so forgive me if this seems highly elementary. All I am trying to do is create a custom class that extends the MovieClip class and contains a custom property of "marker". I want to be able to use and change the value of this custom property on the timeline for an instance of this class and have it behave just like any other (Ex: this.x ==> this.marker).

[Code].....

View 13 Replies

ActionScript 2.0 :: How To Call Function Within OnLoad In Class

Jun 14, 2006

I'm trying to call a function with a onLoad function in a Class
XML_var.onLoad = function(success) {
anotherFunction();
}

View 6 Replies

Actionscript 3 :: Passing Custom Class As Parameter To Custom Class Where Parameter Class Not Constructed?

Jun 16, 2011

I have a custom class being constructed from my main class. In the custom class it has another custom class that is passed in as a parameter. I would like to strictly type the parameter variable but when I do, 'the type is not a compile type constant etc'.This, I understand, is because the custom class used as a parameter has not yet been constructed.It all works when I use the variable type ( * ) to type the parameter.I suspect this is a design flaw, in that I am using an incorrect design pattern.It is actually hand-me-down code, having received a large project from someone else who is not entirely familiar with oop concepts and design patterns.

I have considered using a dummy constructor for the parametered class in my main class but the passed in class also takes a custom class (itself with a parametered constructor). I am considering using ... (rest) so that the custom classes' parameters are optional.Is there any other way to control the order of construction of classes? Would the rest variables work?edit)in main.as within the constructor or another function

var parameter1:customclass2;
customclass1(parameter1);
in customclass1 constructor:

[code].....

View 1 Replies

ActionScript 2.0 :: LoadVars OnLoad Delay In External Class File?

Mar 25, 2012

I'm building an external class file that other developers can use to include a set of functions that essentially read and write data to MySQL via PHP.

The idea is that their AS2 script calls a method in my class which uses LoadVars to verify the data passed to it and write it to a database, and then it returns a value back to the AS.

I'm having a problem where the delay in waiting for OnLoad means that the calling AS function gets an undefined value back. i.e.

var returnValue=myClass.myMethod(params);

This (I assume) is setting returnValue instantly, despite the fact that LoadVars can take a little while to work.

What's the recommended/normal way to deal with this? I don't want to have to bring the OnLoad part of the process back into the developer's script, it would be nice to keep it all in the class. is there a way to make the calling script wait for a response?

View 0 Replies

ActionScript 2.0 :: [FLASH CS5] Custom List Class That Manages Custom List Item Class?

Dec 2, 2011

This is my first time working with a class attached to a movieclip that is nested inside a class attached to a movie clip.I've tested all the properties and methods of PTListItem.as and they work properly but when I try to call them on the list item through PTListTop.as it returns undefined.The end goal is to dynamically load a checklist via a txt file.

View 1 Replies

Actionscript 3 :: Flex 4.5 Not Listening To Custom Event Dispatched In Custom Class?

Nov 4, 2011

I have the following situation:I have an event handler, that displays small messages in my application's statusbar.These messages get passes through by dispatching events from custom components.A simple message could be like "HTTP Error" or so.Now, the main event listener, in the main application file, listens to the event dispatched by any custom component,but seems to refuse listening to events dispatched by custom AS classes.Here is my code for the custom event:

package main.events
{
import flash.events.Event;[code]..

So to sum it all up:

- The event listener listens to the custom event dispatched by any custom component.

- The event listener does not listen to the custom event duspatched by an AS class.

Those who wonder, the event really gets dispatched, that's why I added a trace call.

View 2 Replies

Flex :: Access A Custom Property In A Custom Class?

Jan 25, 2010

I couldn't work it out yet...

package components {
public class templateSelection extends VBox {
static public var tempSelectionBag:Dictionary;

[Code]....

I want to have a custom class tempSelection with a Dictionary as a public accessable property of that class. If I use this code, the compiler tells me:

1046: Typ wurde nicht gefunden oder war keine Kompilierungszeit- onstante:Dictionary

Which translates to:

Type was not found or was not a compile-time constant: Dictionary

View 1 Replies

ActionScript 3.0 :: Sound Class Type - Cannot Convert C$ To Flash.media.Sound

Oct 25, 2009

I have some sounds in my library. They are all exported and have been given class names like C, D, E etc. I have another class that represents a button. This class stores a reference to one of the Sound in my library. I set the type for this variable to Sound. When I try to set it I get the error: cannot convert C$ to flash.media.Sound I try as Sound, for example key.note = note_array[p] as Sound; The value ends up as null.

View 2 Replies

ActionScript 3.0 :: Advanced Sound - Missing Properties Not Available In The Sound Class

Apr 23, 2010

I use this class as a base for all my streaming sound. It gives you two missing properties not available in the Sound class: a reliable soundchannel always available for referencing and a latency value indicating how long it took for your last call to play() to actually play the sound. I'll probably post it on my blog when I get the time but here it is:

[Code]...

View 8 Replies

ActionScript 2.0 :: XML Loads Other XML Files, Onload Function In Onload Function?

Nov 20, 2006

I am writting an image gallery that loads one intial xml file named galleries.xml.From this point each xml node loads a XMl file for that gallery that holds all the images.The problem arises in the fact that to do this I need a onload function within an onload function.Onload functions dont accept parameters so I can pass down the variable that shows what loop the gallery loop is on as I need that in the function that holds the images.

View 4 Replies

Actionscript 3 :: Sound Class Unloading Sound?

Dec 27, 2011

There must be a simple solution to stop the sound and unload it in as3.

This is not all of my code, but in short I am loading random sounds. I need certian vars to be outside of the function so I can reference them with other functions for a progress bar.

How do I unload a sound so I can load a new one using the same names without getting an error the second time its called?

I have two buttons in this test. A play Sound and a Stop Sound Button.

here is my code:

var TheSound:Sound = new Sound();
var mySoundChannel:SoundChannel = new SoundChannel();
PlayButton.addEventListener(MouseEvent.CLICK, PlaySound);

[Code]......

View 1 Replies

Actionscript 3 :: Can A Document Class Extend Another Custom Class That Extends MovieClip?

Aug 16, 2011

If I have a Document class that extends MovieClip, and I want to use it as the basis for another Document class, is it possible to create a subclass that extends the main document class and use that for a different FLA?

For example,

fla1.fla has a document class of MyMainClass:
public class MyMainClass extends MovieClip
fla2.fla has a document class of MySubClass:
public class MySubClass extends MyMainClass

I've tried, but now I'm getting errors that all of my variables that reference stage instances aren't being found.

View 1 Replies

ActionScript 3.0 :: Pass Data From Custom Class Back To Document Class?

Apr 20, 2011

I have a custom class created by a main document class, and I want the custom class to run a function in document class after some time.

How can I sent the instruction from custom class back to the document class?[code]...

View 6 Replies

ActionScript 3.0 :: Making An Auto-generated Class Inherit From Custom Class?

Mar 5, 2007

get a bunch of objects in my library to inherit from (or even be) one class that i have made, but without having to make .as files for every single one is this possible, or is there any other way to give objects another classes functionality in an auto-generated class?

View 3 Replies

ActionScript 3.0 :: Reference Movieclip On Stage From Custom Class Of Document Class

Dec 7, 2009

Is there a way I can reference a Movie clip I have on the main stage from a custom class of a document class?[code]

View 1 Replies

Actionscript 3 :: Stage Properties In Custom Class, Not Document Class?

Oct 14, 2011

I need to use stage.width/height in my CustomClass so I found some topics about it.

if (stage)
{
init(ar,firma,kontakt,oferta,naglowek,tekst,dane);

[code]......

View 1 Replies

ActionScript 3.0 :: Passing A Variable From The Document Class Into A Custom Class?

Dec 28, 2009

I'm trying to create a class which will create a tween for several different instances of an object. I am creating the instances in the Document Class. The trick is, I would like to specify how long each tween will take.

Here's what I have so far:

DOCUMENT CLASS

ActionScript Code:
package {
import flash.display.MovieClip;
import mcCloud;

[Code].....

As you can see, I have a variable "myTime" which syncs the timer and the tween. This causes to tween to repeat and the clouds to continually scroll across the stage. How can I determine the var myTime at the time I create each instance of the Movie Clip mcCloud?

View 6 Replies

ActionScript 3.0 :: Calling Function In Custom Class From Document Class?

Feb 24, 2009

I keep getting an "undefined property" error when I try to call an external function from within the Doc class. I added the error message to the Doc Class below so you can see where it occurs.

If I take the code from the Tooltip.as below and place it on the FLA's main timeline I can get things working fine, but I would like to move all script to classes. The document class structure looks like this:

Drag_and_Drop.as

Code:
package {
import Tooltip;// Import custom class
public class Drag_and_Drop extends MovieClip {

[Code]....

I realize that I could just combine all the code in the Doc class to get it working, but it would be nice to separate out this particular code which has only one use.

View 4 Replies

ActionScript 3.0 :: Document Class And Custom Class Communicating Question?

Jun 2, 2009

the website I'm work on has the document class Main. Within this website I have a movieclip on the stage which I built a custom class for its functionality and I linked this movieclip to this class to make it work. There is no reference to this movieclip or class in Main.

Now, I need to communicate between these two classes. Can I do this? Can I dispatch an event from the custom class linked to the movieclip and have the document class listen for an event? How?

View 2 Replies

ActionScript 3.0 :: Create Custom Event Class If I Dont Need To Pass Custom Property With That Event?

Dec 28, 2009

Is there a point of creating custom event class if i dont need to pass custom property with that event?

View 3 Replies

Flash - Listener In Main Document Class For Custom Dispatch Event From Another Class Does Not Respond Or Call Function?

Apr 1, 2011

I have a document class called Main.as In the class constructor I have the following listener:

enter code here
var listeningFORModeChangeToStudent:Sprite = new Sprite;
listeningFORModeChangeToStudent.addEventListener(TellAllModeChangeToStudent.STUDENT,exp);
addChild(listeningFORModeChangeToStudent);

[code]....

In a third class I make a call to the despatcher in the previous class:

enter code here
var ThisTellAllModeChangeToStudent:TellAllModeChangeToStudent = new TellAllModeChangeToStudent;
ThisTellAllModeChangeToStudent.tellAllModeChangeToStudent();

I have trace statements in eveything and from this I know the despatcher in TellAllModeChangeToStudent is being called.The problem is that the listener in the main.as is not calling the function exp.I cant see why and I dont know how to check if the listener is actually seeing the dispatch event?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved