ActionScript 3.0 :: Making Interface - Add 'Screens' To My Current Class

Sep 3, 2011

I think I understand how to make a interface but the problem is im unsure as to how to add it to my existing code! To make a interface (as far as i know) You can create classes such as mainScreen, intructions and so on. Ok i get that, make the classes then add ther buttons from the library i these classes. But i followed a tutorial bu Emmanuel Feronto, and adapted that to the needs of my game.

So im unsure as how to add these 'Screens' to my current class, the I currently only have 1 class, Main which currently has 300 lines of code, and i dont know how to break it up into smaller classes. Thats the problem i think, The main is quite large, normally i have heard people keep this clear... But then say i made a bland main, and added the screens into that then how do i make the main that makes the game play on the play button?

View 14 Replies


Similar Posts:


ActionScript 2.0 :: Error - The Class Or Interface 'gui.screens.game.ContinueGame' Could Not Be Loaded

Mar 8, 2008

There are 77 classes in my project and around 30 of them are linked to MovieClips. If I do a size report it says that my Actionscript classes are 110296 bytes.

I am having a mysterious problem. I have a MovieClip, and I would like to link a class to it in the library.

But I get the following error:

The class or interface 'gui.screens.game.ContinueGame' could not be loaded.

The class at the moment is empty (see code below), although I have tried renaming, deleting and recreating it a few times.

Code:
class gui.screens.game.ContinueGame extends MovieClip {
public function ContinueGame() {
}
}

I have also tried linking the class to other MovieClips that have been successfully linked other classes before - which didn't work.I have tried linking other classes I have used before to the MovieClip - which worked. So the problem lies with the linking of the specific class. Since I have tried renaming it, I'm wondering if there is you can only link a certain number of classes or something. Or I am missing something obvious and will kick myself when I find it.

View 4 Replies

ActionScript 3.0 :: Removes Screens With AddChild And RemoveChild These Screens Are Movie Clips

Feb 20, 2011

I have a main class that calls and removes screens with addChild and removeChild, these screens are movie clips.My issue lies in these movie clips, each clip is linked to a class - e.g. confidence.as links to my confidence screen.I am trying to add buttons and pieces of text from this class file onto the confidence screen, so essentially adding more movieclips on top of a movieclip that has already been added. I keep getting this error:TypeError: Error #2007: Parameter child must be non-null.I could do with some help figuring out how to add objects to my screens, as I am trying to prevent having everything in one class.

View 6 Replies

Flash :: Expose A Method In An Interface Without Making It Public To All Classes?

Nov 7, 2009

I have a issue where I'm working with a particular interface for quite a lot of things. However, I have a particular method that I want to be available only to a particular group of classes (basically, an internal method). [code]...

View 4 Replies

ActionScript 3.0 :: Making Video Fullscreen Without Scaling Interface Controls?

Oct 21, 2011

Sites like The Daily Show (I can't post URLs since I'm a new user, but just go to their front page to see) are doing what I need to do. When you go fullscreen with their video, the bottom video controls and the top social media bar aren't scaled. They adjust themselves in width, but the text and button graphics remain the same size.Now, I've had success with a method where, when the FULLSCREEN event is invoked, I downsize my interface elements by a ratio equal to the difference between my SWF size and the screen size, essentially keeping the interface at a constant size in both modes. However, all text and graphics inside those elements are distorted or blurred when I do this.

View 3 Replies

ActionScript 3.0 :: Making Video Fullscreen Without Scaling Interface Controls

Oct 21, 2011

Sites like [URL] are doing what I need to do. When you go fullscreen with their video, the bottom video controls and the top social media bar aren't scaled. They adjust themselves in width, but the text and button graphics remain the same size.

I've had success with a method where, when the FULLSCREEN event is invoked, I downsize my interface elements by a ratio equal to the difference between my SWF size and the screen size, essentially keeping the interface at a constant size in both modes. However, all text and graphics inside those elements are distorted or blurred when I do this. At [URL], the text looks exactly the same in both modes, and uses no anti-alias.

View 3 Replies

Flash :: Creating An Instance Of A Class That Implements An Interface Based On The Class Name?

Feb 17, 2011

Is there a way to generate an instance of a class that implements an interface based on the name of the class?

I am trying:

var ClassReference:Object = getDefinitionByName("movement.OuterSpaceMovement") as IMovement;
var m:IMovement = new ClassReference as IMovement;
trace("startup..." + m);

-But I am getting an error message ReferenceError: Error #1065 (OuterSpaceMovement) not defined.

I have several classes that implement the same interface (IMovement) but I need to be able to generate new instances of these classes and then pass these instances as a datatype (IMovement datatype) to other classes...

So then I tried:

var ClassReference:Class = getDefinitionByName("OuterSpaceMovement") as Class;
var m:IMovement = new ClassReference() as IMovement;
and this doesn't seem to work...but the following
var m:IMovement = new OuterSpaceMovement();

View 1 Replies

Actionscript 3 :: Flash Failing With A RSL Library, When Main Class Extends A Class And Implements An Interface?

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

ActionScript 2.0 :: Class Scripts May Only Define Class Or Interface Constructs

Sep 7, 2007

i am working on a project where i have some common code which i import in different movie clips and different files the code is in actionscript 2 in an external .as file. this is not a class its just a bucnh of functions and temporary variables.Problem is when i use the check syntax button or auto format button i get the following error."ActionScript 2.0 class scripts may only define class or interface constructs."this used to work fine in flash 8 but it always gives this error since i started using flash 9.the code works fine too. its just that my auto format button and the check syntax doesn't work.

View 5 Replies

Actionscript 3 :: Class Implements An Interface (or Is A Subclass Of Another Class)?

Mar 25, 2010

With this code

function someFunction(classParam:Class):Boolean
{
// how to know if classParam implements some interface?
}
i.e. Comparing classParam with IEventDispatcher interface

[Code]...

There is a way that DOES NOT USE describeType or creates a new operator?

View 2 Replies

ActionScript 2.0 :: Making Some PHP Flash Shortly To Replace Current Website?

Nov 11, 2005

I'm looking at making some PHP Flash shortly to replace my current website, http://www.mathsnotes.com. I was thinking about allowing users to download a standalone version, i.e. the SWF file or an EXE file. My question is: Will the PHP still work, or is it parsed by another entity, e.g. the users browser?

Also, I wanted to add a live news feed - So is it possible to have flash check every frame ( like a _root.onEnterFrame() = Fucntion{ ... ) the mysql database to look for anything with a timestamp less than say, 5mins, and then display it? Or does PHP require a user to do something like "Update News"?

View 5 Replies

Actionscript 3 :: Call A Method From A Different Class In Current Class

Nov 4, 2010

I have a class, my document class, called SilkRoadTweeter. as I also have a class called User.as In my User class I need to call a method called nonce() I have tried this, trace(SilkRoadTweeter(root).nonce()); But I get the error, TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 4 Replies

ActionScript 3.0 :: Making A Code That Automatically Writes The Mouse's Current X And Y Position As Text?

Jul 6, 2009

I have trouble making a code that automatically writes the mouse's current x and y position as text every frame.

View 3 Replies

ActionScript 2.0 :: Error "class Scripts May Only Define Class Or Interface Constructs"

Aug 13, 2006

i have incuded an AS file in my fla. But is gives an error ball.as: Line 73: ActionScript 2.0 class scripts may only define class or interface constructs.

[Code]...

View 1 Replies

Class Or Interface Could Not Be Loaded?

Apr 20, 2009

I'm trying to publish a swf with Flash CS3.

I have one .fla file and two .as files. I think my problem is I don't know how to set the path for the action scripts. All three files are in the same directory

The files:
dtd.fla
TransformItem.as
TransformManager.as

The error: The class or interface 'gs.TransformManager' could not be loaded.

dtd.fla code appears to have an appropriate import: import gs.TransformManager; var manager_obj = new TransformManager([], onTransformEvent, true, false, false, false, false, true, true);

TransformManager.as code appears to have an appropriate import: import gs.TransformItem;

View 2 Replies

ActionScript 1/2 :: Class Or Interface Could Not Be Loaded

Nov 30, 2009

I'm doing a simple link code. I've tried many diferrent ways to do this but this error keeps comming up saying The class or interface could not be loaded...

home_btn.addEventListener(MouseEvent.CLICK, gotoURL);
function gotoURL(event:MouseEvent):Void{
navigateToURL(new URLRequest("my site"));}

This is the most recent method I've tried in doing this. I've tried changing the publishing settings of the document to and from Action Script 3.0- using an import command. But thats too complicated.
Attachments: Flashfla.fla.zip (767.8 K)

View 11 Replies

ActionScript 3.0 :: Implement More Than One Interface To Same Class?

Feb 3, 2012

Can I implement more than one interface to the same class?One option is to make interface A extend interface B and than have my class inplementing interface A. Is there any other way that I can implement two or more interfaces directly to the same class?

View 3 Replies

C# :: - Does A Class Have To Implement A Interface Directly

Dec 30, 2009

Quick question. Does a class have to implement a interface directly to be accepted, or can it be a child of a parent class that implements it. so If I pass a child object into a method that only accepts IOBJECT, but the child class parent implements IOBJECT. will child object be accepted ?

View 1 Replies

Actionscript 3 :: Class Implementation With Interface?

Sep 11, 2011

I have created the following classes for sharing images. They implement an interface, but I need a way of switching between them with user interaction. I've done it the following way:As you can see, service 1 and service 2 implement iSharingServices, and inherit from PolimorphSharing.PolimorphSharing is simply and an abstract class that implements the methods I want public from Service 1 and Service 2. Those methods will then be overridden on the Service 1 and Service 2. Because I need a way to switch the service in runtime, I've created a gateway class that inherits from PolimorphSharing. I can then call it the following way:

private var sharingService:PolimorphSharing = new SharingServicesGW('svc1').createService();

This all works flawlessly, and I can now switch between services with no problem whatsoever. However, I feel there's something wrong about it, so I would like to ask you guys for some advice on how to better implement this.

UPDATE:
Just adding some more insight to this. Basically the idea here is for my client to be able to upload images with various different public sharing services such as imageshack, imgur etc. I want my client to be able to select the service in which the image is to be published to (hence the "switching between them with user interaction" bit of the question.

The method that does the uploading bit, is requestShareImage(), processResults() simply turns whatever gets returned to a unique format, so my client can read off it always the same way. getObject() is my accessor, and onIOError will handle exceptions with any of the public API's

View 1 Replies

ActionScript 3.0 :: The Class Or Interface Could Not Be Loaded?

Jul 30, 2010

I got the error message below when I try to put them onto my own flash file, The source codes work well by themselves.The class or interface 'URLLoader' could not be loaded.The class or interface 'URLRequest' could not be loaded.

View 1 Replies

Professional :: Getting Error With RegExp Class / Interface At AS 2.0

Jun 11, 2011

I am getting an error with RegExp class at my flash document. I am using an Action Script 2.0 at my document. Is RegExp class is not supported in AS1/AS2 ?

My code is as follows
function validateEmailAddress(emailString:String):Boolean {
var myRegEx:RegExp = /(w|[_.-])+@((w|-)+.)+w{2,4}+/;
var myResult:Object = myRegEx.exec(emailString);
if(myResult == null) {return false;}return true;
} if(validateEmailAddress(email) == false) {
contacterror = "Error ! Please Enter Valid Email Address";}

If RegExp not supported in ActionScript 2.0 then how to validate email address at ActionScript 2.0 ?

View 1 Replies

Actionscript 3 :: Extending A Class And Implementing An Interface?

Dec 30, 2009

I am creating objects for a game, they are all sprites. but I also want them to implement an interface. Is it possible to do both ? If not, how can i have an object have the capabilities of a sprite and also have it implement an interface. I am wanting to create another class that checks all my objects to see what datatype they are and evaluate them accordingly

View 1 Replies

Flash - Class Or Interface Event Could Not Be Loaded?

Jun 16, 2011

I have an older site that is coded in AS2(I can't get it to AS3 sorry) I found this script online that allows for mouse scrolling. It is in AS3 and I can't figure out what Event replaced in AS2. I'm sure there are much better AS programmers than me that could tell me off the bat. I'm just trying to get this converted to AS2.

var verticalCenter:Number = stage.stageHeight / 2;
var limit:Number = stage.stageHeight - content_mc.height;
var speed:Number = 0.1;

[Code]....

View 1 Replies

Flex :: Identify If Class Reference Is An Interface?

Oct 10, 2011

As in Java I want to know if my reference is declared as Interface.

function foo(classRef:Class){
if(classRef.isInterface(){
//something

[code].....

View 2 Replies

ActionScript 3.0 :: Purpose Of Having Abstract / Interface Class?

Feb 2, 2009

whats the purpose of having to have an extra class such as abstract class in Flash where the methods has no implementation,but the subclasses declare those implementations.The advantage of having the methods declared in subclass than the superclass is that it would not affect the other subclasses when there are certain changes.That makes me wonder, isn't it better not to extend(inherit) empty methods but directly create a class as its own? unless there is something that the child could use from parent.Anyone could give me examples of how applicable using abstract classes/interfaces?

View 3 Replies

ActionScript 2.0 :: Class Or Interface Of MouseEvent Could Not Be Loaded

Jan 30, 2012

I am currently doing this gallery with prev and next button.But i got this error message.."The class or interface of MouseEvent could not be loaded." [code]

View 1 Replies

Flash :: Test If A Class Reference Implements An Interface?

Jan 18, 2011

How can I test if a class reference implements an interface? Note that the is and instanceof operators do not work with Class references.
Example:

public function set someClassref(value:Class):void
{
if(value is IMyInterface)[code]........

View 1 Replies

Actionscript 3 :: Reflection - Reflect Swf/swc For Class That Implements Interface?

Apr 29, 2011

Not sure if this is possible but I would like to reflect a swf or swc file selected by the user at runtime to find any classes that implement a certain interface. Can this be done or do you actually need a reference to the class you want to reflect using describeType();

Note - this would be done in actionscript.

View 1 Replies

ActionScript 3 :: Check If Class Implements Specific Interface

Sep 7, 2011

In ActionScript 3.0, there are a few ways to check a class's extension. For example, if I want to know of a custom class extends Sprite I could use the is operator:
trace(MyClass is Sprite);
Or I could use flash.utils.getQualifiedSuperclassName:
trace(getQualifiedSuperclassName(MyClass));

I would like to accept a class as an argument and check to see if the passed class implements an certain interface. Is there an equally simple or common way to check if my custom class adheres to an interface? Perhaps something like:
trace(MyClass implements IMyInterface);

View 2 Replies

ActionScript 3.0 :: The Class Or Interface 'it.sephiroth.XML2Object' Could Not Be Loaded

Aug 17, 2009

The class or interface 'it.sephiroth.XML2Object' could not be loaded?? I did the installation of extension and adobe extension manager confirmed installation to be successful and yet I cant

[Code]...

View 0 Replies







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