ActionScript 3.0 :: Use A Button From The GUI And Code It With A External Imported Packaged Class?

Aug 30, 2008

I have tried to add a button a .fla and code it with a packaged class (Main.as).is it possible to use a button from the GUI and code it with a external imported packaged class?

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Packaged Class Recognition?

Jan 26, 2009

I don't know if the topic describes the problem correctly, but here's the situation:I created a folder structure so I could work with packages, which I named com/gamistry/someproject"Then I created several .as files. "EggLoader.as", "Main.as", "Egg.as"EggLoader is a class that shows a basic progress bar, and is also the Document class. It is defined as being in the package "com.gamistry.someproject". Once it's done loading the swf, it creates an instance of "Main" (not having imported anything), and passes its stage property as the only argument. This all works perfectly.

Then the Main class starts running, and attempts to create an instance of "Egg", not having imported anything just like the previous example. It attempts to pass the single argument (defined as floor:int in Egg's constructor), but for some reason I get a compilor error 1136 "Incorrect number of arguments. Expected 0."It furthermore seems to know of none of Egg's public functions. Has anybody come across something like this before? Perhaps I am misunderstanding the purpose of packages?I've tried importing com.gamistry.someproject.*, but to no effect. If I explicitly define the myEgg instance as a "com.gamistry.someproject.Egg", and then call the new operator as a "new com.gamistry.someproject.Egg( floor )", the error disappears, but the program still does not execute as expected. No instance is visibly created on the stage, as it was when I was working with the exact same code base from the root package.Here's code samples (I omitted a lot of irrelevant code):

ActionScript Code:
package com.gamistry.someproject {
import flash.display.MovieClip;

[code].....

View 1 Replies

ActionScript 3.0 :: Download An External Class From Code?

Jul 25, 2009

i download an external class from code.google.com. now i want to know where should i put that class so that i can import it into my actionscript code.

View 1 Replies

ActionScript 3.0 :: Refer To A Class Linkage Set In Library From External Code?

Jan 12, 2011

If one uses [Embed] to refer to external graphic assets its easy to instantiate and use them.However, I've got a png in an Fla, with the Class identifier set to "Symbols", Base class is BitmapData.I need to instantiate it like this:

var symbols:BitmapData = new Symbols(1, 1);
addChild(new Bitmap(symbols));
 
Of course the compiler complains about a call to a possibly undefined method Symbols.For a temporary fix I guess i'll put the graphic external to the swf, but for this project it needs to be in the library along with everything else.

View 9 Replies

ActionScript 3.0 :: Sharing Vars Between Document Class And An Imported Class?

Jan 27, 2009

I've been sorting through the XML docs and i've bumped my head into a bit of a question. So, to preface, I have been able to load the XML successfully, but I want to be able to use my own XML loader class to load the XML and then be able to reference it from the document class. Also, I'd like to be able to send a file path to the loader class when I call it.

The document class:

ActionScript Code:
package rg.sites{
// flash classes

[code]....

View 8 Replies

ActionScript 3.0 :: Calling Method In Parent Class From Imported Class?

Jul 15, 2011

I have the following parent class that I'm working with:

Code:
package {
import com.poptent.SubClassOne;
import com.poptent.SubClassTwo;

[Code].....

I am trying to set it up so that a parent method called by subClassOneInstance can affect subClassTwoInstance.

View 4 Replies

ActionScript 3.0 :: Flash Access TextField From Class Imported By Doc Class?

Aug 17, 2010

I'm just now learning the new object oriented way of scripting. It's been a wild ride, but I've finally learned how to keep script off my frames (very hard coming from as2).Here's my problem:

I have a TextField on the stage in my main .fla file named loadPercent.

I'm loading a jpg with preLoad.as and displaying the bytes loaded in loadPercent.

I can access my loadPercent TextField from my MainClass

but I can't access it from preLoad.as

the document class is MainClass.as

Code:
package
{
import flash.display.MovieClip;[code]....

I get three '#1120 access of undefined propery' errors for each time i try to access loadPercent.

a few basic questions: 1. all my files are in a folder in my documents, not in the flash directory, is this bad? I've seen people using com.whatever etc.

2. my main .fla file does not share the same name as my MainClass.as (it's not named MainClass.fla) Is that a problem?

I'm assuming these are inconsequential because my code seems to work up to a certain point.

View 7 Replies

ActionScript 3.0 :: Changing A Document Class To An Imported Class?

Oct 23, 2009

My following document class is working fine. But, when I want to import it instead of using as a document class, it reports an error "1067: Implicit coercion of a value of type Class to an unrelated type flash.display:DisplayObject.". My class code is here:

package{ import flash.display.Sprite; import flash.display.Shape; import flash.text.TextField; import flash.events.MouseEvent; public class Shapes extends Sprite {  var square: Sprite = new Sprite();  var txt: TextField = new TextField();  public

[code].......

View 2 Replies

Button Code Not Opening External Html Pages In Flash Website?

Feb 26, 2012

- I made a flash-based website using Flash CS3 and then embedded the file into a blank html page with Dreamweaver cs3.-All my buttons, linking, and content were made in Adobe Flash CS3 using ActionScript 2.0 (AS2).The issue I am encountering is that when i click on some buttons that have get URL codes, they will not load the html files assigned to the As2 code of the button. The html files are supposed to load in a separate browser window for each html page assigned to each button. The html files are located within subfolders in my Main Site Root Folder.All my AS2 code is Object-based; meaning I applied it directly to my button symbols.

View 4 Replies

ActionScript 3.0 :: Loading External SWF With Button With Class?

Aug 2, 2009

I'm trying out a game from a tutorial for a project, and I'm trying to load the next game from within the first .swf by means of a button, in this case loadButton, when this MC displays on the main swf (this is the GameOver menu screen). The syntax seems fine and there are no errors displaying, but the .swf itself isn't loading.The startLoad function I'm having problems with is at the bottom. I've tried loading external .swfs before but that was without classes... this is my first try with classes so I'm not sure if I named the public functions wrongly or put the wrong codes in the wrong places, screwed up my public vars, etc.

ActionScript Code:
package
{

[code].......

View 4 Replies

Actionscript 3 :: Swf File To Be Packaged In An Apk (Android)?

Jan 2, 2012

I have an android tablet. I made a swf file with mouse events, it rotates images to right and left. I wanted to put it on Android and run it as an .apk file which consists of the swf file embeded within it. I tried running the swf file through webView it works perfectly fine. But i wanted to make it as an application.

View 1 Replies

Flex :: Cannot Write To Sqlite Db In Packaged Air

Jan 18, 2012

I can write to db when running in IDE(FB), while after packaging a air, the app wont write to sqlite db, Why?

View 2 Replies

AS3 - Function In Imported Class Not Being Called

Dec 28, 2011

mainClass.as
package {
import mfClass.CarSelector;
import flash.display.MovieClip;
import flash.events.Event;
public class MainClass extends MovieClip {
[Code] .....

Now, when I run this in flash. I get this message.. in output.
TypeError: Error #1006: sel_Fun is not a function.
at MainClass/show_selector()
at MainClass()

View 1 Replies

Actionscript 3 :: Create Class For Imported SWC Elements?

Sep 14, 2011

I have imported a SWC into my actionscript project. It includes many different movieclips that I can access in my project. My question is this: How can I create a custom AS3 class that I can use to add functions and properties to my movieclips?

For example I have a movieclip with a linkage name of LevelButton. I tried creating a class that was the same name but they didn't seem to go together.

View 2 Replies

ActionScript 3.0 :: Reposition A Textfield From An Imported Class?

Nov 29, 2009

My project imports a custom class with a function called at runtime that creates a textField.

I want to be able to change the x and y coordinates of this textField [tf.x and tf.y in the class] from within the parent movie (not the class itself) but am having trouble.[code]...

View 5 Replies

ActionScript 3.0 :: Removing EventListener From Imported Class

Jan 30, 2011

I have an on enter frame listener defined in a function:
Code:
function sideClicked(e:MouseEvent):void {
removeEventListener(Event.ENTER_FRAME, loop);
var targetName=e.target.name;
var a:Array=[];[Code] .....

The looptoposition() function simple calls a function from a custom class repetitively to move an object until it reaches its position. This is the function it calls from the included custom class:
Code:
public function rotateToPos(a:Number,b:Number,c:Number):void {
if(!cubeReady){return;}
if(cube.rotationY<b){
cube.rotationY+=3;
[Code] .....

This gets the desired result visually - the cube rotates until the chosen point and then stops - however the listener continues. I have two problems:
1) I would like to remove the listener but can't seem to do so from the imported class - I'm having trouble referencing my functions in the root flash file.
2) I also need to declare that the function has completed - but the equalities mean that b is either greater or less than but never equal to? Whats a better way of getting the cube to rotate to a set position on each frame? The reason for the equalities are the cube can turn two different directions. So rotation could be negative.

View 7 Replies

ActionScript 3.0 :: External Class That Controls The Button And Adds Interactivity To It?

Jan 29, 2009

i have an annoying problem. I have a mc that i use as a button. I have an external class that controls the button and adds interactivity to it, here's part of the code:

Code:
package
{
import flash.display.*;
import flash.text.*;

[Code]...

The problem is, i want the btn that, when clicked, remain inactive.That's why I remove all the listeners in the class. HOWEVER, it still functions as a button, I mean the functions haven't been removed at all after I click it. What's wrong here?? Why are the functions still there, if I have removed them when clicked at the btn?

View 4 Replies

ActionScript 3.0 :: Flash Button Class Referencing/controlling External MC?

Feb 2, 2011

I have this following class attached to some of my buttons to simply control the roll over and out states, as well as the click event. But i want to use the same class on my buttons but would like to control a movieclip outside of the button somewhere else on the stage etc.

put simply: Clicking my button 'moveLeft' will move a movieclip left let say:

[Code]...

View 2 Replies

Flash :: Relationship Of Code On First Frame Of Main Time Line To Class Code And Library Objects?

Mar 27, 2011

Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?

View 1 Replies

Flash :: External Swf Is Imported As AVM1Movie On One Computer

Jul 7, 2010

I have a bunch of AS3 swfs. They are imported into an AS3 application using a Loader. On 10 or so different computers these AS3 swfs are imported as MovieClips and I can control them as necessary. However, on one computer no matter what I try (casting loader.content as MovieClip, remaking the AS3 swfs from scratch) they are always imported as AVM1Movies.All computers including the one that doesn't work are running Flash Player 10.

View 2 Replies

IDE :: Access Xml Data Imported From An External As. File?

Jan 20, 2010

I am using Action Script 3.I have loaded some xml data using an external as file called importxml.as.If I put a trace statement in it to access the content it works perfectly.But how do I access the data from the Flash main timeline or from another as file?I am using the statement ïż½import xmlimportïż½ but if I then write:trace(xmldata.category[1].word[1].text); I get the message;

1120: Access of undefined property xmldata.

If I try this on the main timeline

var myXMLmlimport=new xmlimport();

I get the error message

TypeError: Error #1010: A term is undefined and has no properties.

View 2 Replies

Professional :: Creating 'packaged' SWF File With Flash Prof?

Feb 15, 2011

Firstly, I've created with Adobe Captivate an SWF file which I have been able to reference in an aspx page and when I view the website, it runs fine (no other file is referenced to run this).  Example of the below code in the aspx page I have created:

object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab# version=8,0,0,0"width="500" height="400" id="Untitled-1" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="progressive2.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#aaaaaa" /><embed src="MY_VIDEO.swf" quality="high" bgcolor="#ffffff"width="500" height="400" name="Untitled-1" align="middle"allowScriptAccess="sameDomain" type="application/x-shockwave-flash"pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>

My objective is this. I have a final edited FLV video file. I also have Flash Professional. What I want to do is create a single SWF file (like with the Adobe Captivate example), which will include the video and the skin for the progress bar, volume etc and then reference this in another aspx page for the website.

I want to be able to have the same 'packaged' SWF file, as in the captivate, created from this FLV video. In Flash Proffessional, I've imported the FLV into the 'stage' and added a skin through the wizard.  But trying to publish or other options, I've not been able to get this single 'packaged' SWF file to run correctly in the website, via the same apsx code as above.Am I missing a trick here?  I would presume it would be fairly simple as I don't want to edit the video, more I want to embedded it with a skin in the one SWF file.

View 2 Replies

Flex :: Application Packaged In AIR Doesn't Show It's Window

Feb 1, 2010

I have a Flex application that builds and runs from Eclipse without any problems. I've created an Ant build based on the sample provided by Adobe and builds the application and packages it up into an AIR application. No errors occur during the build process and an AIR file is created.The problem is that when I install the AIR application and run it, there is no UI at all. The process is running because I can see it in Task Manager but I can't see the app window. I've commented out all of my initial code so just the first window should appear but still nothing.

View 1 Replies

ActionScript 1/2 :: Class Linkage Breaks With Imported Symbols?

Mar 29, 2007

I stumbled upon this while trying to customize the tree component following the example on the LiveDocs, see [URL].. To see the problem, do the following:

PART 1:
1) create an empty test.fla file
2) put a tree component on the stage
3) convert it to a symbol named TreeNavMenu, export for
Actionscript as TreeNavMenu

[Code]...

View 1 Replies

ActionScript 1/2 :: Refering To A Class Imported On The Root Timeline?

May 22, 2009

This is probably ueber basic, but I don't know how to do it. I am importing tweenlite on the root timeline like this: import gs.TweenLite;

I now want animate things in other MCs. I tried something like this, but it did not seem to work.parent.TweenLite.to(text1, 3, {_alpha:100, overwrite:0});

View 5 Replies

ActionScript 3.0 :: Imported Class Reference And Static Variables

Jun 8, 2010

I'm trying to make methods available like so:
ActionScript Code:
MyClass.myFunc();
Instead of
ActionScript Code:
var myVar:MyClass = new MyClass();
myVar.myFunc();

I know that to do so I need to declare the functions/variables/constants as static:
ActionScript Code:
package MyPackage {
public class MyClass extends Object {
public static function myFunc():void {
} public function MyClass() {
[Code] .....

When I try to access the static function through the full reference (i.e trace(MyPackage.MyClass.myFunc);), it works, while trace(MyClass.myFunc); returns undefined. This contradicts what I've read in tutorials and posts on the Internet. They all use the short syntax, not the full path.

View 9 Replies

ActionScript 3.0 :: Make Xml Imported In Loader Class Global?

Aug 11, 2009

I tried to search for this but the search wasn't working. I have a loder class where i load in some xml. This is the function that's called after the xml is loaded[code]...

The xml traces out fine. My question is how do I define var xml so that I can access it from outside of the class in another class or from the timeline?

View 1 Replies

ActionScript 3.0 :: Code Vs Class Code / Stage Items Go?

Oct 22, 2011

I had a 2 frame setup with some actionscript for each frame. Tried to move it all into one class file and a

1. frame .fla. ; Hiding and showing the resp. moviclips when i virtually move from frame 1 to frame

2. Now I get these ...Error #1069: Property edit_panel_mc not found on flash.display and there is no default value. errors or..

when i thought beeing clever adding the stage. prefix ReferenceError: Error #1069: Property edit_panel_mc not found on flash.display.Stage and there is no default value. The mc's are on the stage... i have a single .as classfile. Why cant I reference them? or how should i do it/ what should i do to change it from beeing .fla script to class script.

View 9 Replies

Actionscript 3.0 :: Code A Class Instead Of Putting Code In The Stage?

Oct 1, 2009

I see a lot of tutorials about coding actionscript 3 when they use all the code in a Class.I keep thinking every time why they use it in a class, instead of using actionscript on the stage.why it is more functional to code a class instead of putting code in the stage actionscript?

View 3 Replies

ActionScript 3.0 :: Successfully Imported External Swf, Can Not Put It Into Movie Clip?

Aug 27, 2010

Successfully imported target swf and put into stage, when I publish this I see target swf is playing.

import flash.display.MovieClip;
var BGLoader:Loader = new Loader();
var BGurl:URLRequest = new URLRequest("HomeBG.swf");

[Code].....

View 2 Replies







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