ActionScript 3.0 :: Simple Textloader Class Is Tough
Mar 18, 2009
I thought I had a better grasp at this AS3 stuff.[code]This is the 34th version of different combinations of functions, nesting functions, set and get functions, and everything else I can think of.[code]I got it to the point where a now removed Event.COMPLETE traced the contents of my welcomeText. txt, but I couldn't for the life of me get it out of the function into a variable I could read outside the COMPLETE function.
View 7 Replies
Similar Posts:
Dec 9, 2005
Im wondering if using the tween class is tough for older computers to handle?
View 3 Replies
Dec 24, 2008
I'm trying to make a slideshow of sorts for a friend of mine in which a php script lists the number of files it's found in a directory as well as the relative links to each file. The slideshow parses these values and is supposed to individually fade between two different pictures after loading the new one... but it works erratically at best.
I've got everything working up to a component related to onLoadInit that honestly is just driving me crazy because I cannot for the life of me figure it out, as it works sometimes, other times not at all, etc. It's also supposed to loop infinitely, but it won't.
If you'd like to see what's going on, go to[URL]../moveit to see how weird it acts. Following is the brunt of the code, which I'm just about 100% sure should work correctly.
[Code]...
View 1 Replies
Jun 15, 2010
I cannot believe that implementing a simple class should be so hard. I am trying out the simple example outlined on the Adobe website: url...I copied the class code from here to file Greeter.as in subdirectory Learning. Then I created a dynamic Text field on the stage.
View 3 Replies
Jul 1, 2011
So I'm trying to learn to create a public class, and this is what is in my class file:
class com.RCN.Menu.Menu{
public var title:String;
public var menuItems:Array;
[code]....
and in a seperate SWF I use the code:
import com.RCN.Menu.Menu;
var Accountability:Menu = createMenu("hello",[a,b,c,d]);
trace(Accountability);
yet Accountability traces as undefined?
View 1 Replies
Sep 6, 2009
I'm tryin' to define a simple class in actionscript2 but I receive some errors.Here's the code done in actionscript editor: (name of the file is NavaSpatiala.as)
Code:
class NavaSpatiala
{ // proprietate publica numita viteza (data membru)
public var viteza:Number;
[code]....
How I can use import command in class1.fla (I mean what is the contents of class1.fla when I use command import to import external class defined in NavaSpatiala.as) if I copy this code to NavaSpatiala.as to solve this error:
Classes may only be defined in external ActionScript 2.0 class scripts. line 1
I need to get rid of this error:
Code:
Classes may only be defined in external ActionScript 2.0 class scripts. line 1
View 4 Replies
Feb 3, 2010
I have very simple code for a class: package {import flash.text.TextField; import flash.display.Sprite; public class Greeter extends Sprite { public function Greeter(){var txtHello:TextField = new TextField(); txtHello.text = "Hello World"; trace("hi"); addChild(txtHello);}}}
The above file is saved as Greeter.as in say folder C: est I then create a Fla file named test_display.fla (saved in C: est) and its contents are: import Greeter;var tt:Greeter = new Greeter(); Now the Output window shows hi due to the trace statement but the addChild method should show World in the Flash movie but it does not. The only way to get Hello World to the Flash Movie is to change the test_display.fla to:
import Greeter;var tt:Greeter = new Greeter(); addChild(tt);
In other words I have to use the addChild method twice ( once in Greeter.as and once in test_display.fla ) to get Hello World to display in the Flash movie. Does anyone know why this is so?
View 5 Replies
Feb 1, 2009
I am having trouble getting a simple event listener class to work. The class is:
Code:
package {
import flash.display.Sprite;
import flash.events.*;
[code]...
and I have the ClassPath pointing to the folder that contains this .as file. I do get the trace "In setUp" but I'm not getting seeing any Keyboard events. There also aren't any errors showing up in output so I am kind of stumped.
View 1 Replies
Oct 13, 2009
This is my first meeting with the Shapes; which don't seem cooperating, at all. Following is the Class code:
Code:
package
{
[code]......
View 2 Replies
Oct 14, 2009
This problem is probably very simple to solve but it is not clear to me. It may simply be that I am doing something incorrectly. I have studied OOP and AS3 for quite a few hours so I am familiar with the concepts but not the flow. This is a project that I put together in order to reinforce what I have been studying.The goal here is to load an instance of a pre-created movieclip to the stage from the library then execute a positioning function in the FLA's timeframe ActionScript and execute a function from within the AS files's class ActionScript to both a resize the movieclip and output a trace.I have two files:smileface.flasmileface.as
View 3 Replies
Dec 19, 2010
I'm very beginner in Flash. I'm trying to use document class only. I created a textBox and setting some value with
textBox1.text = 10;
When running, the stage flickers.How can I avoid this flickering effect without using code in timeline but only in document class ?
Update: Would like code in both cases:
all programmatically (no objects on stage at design time)put elements on stage with no actionscript in timelines and control them in document class with actionscript.
View 2 Replies
Feb 3, 2011
In the Main Timeline I have
Code:
import FlashVar;
// Instantiate FlashVar Class and Pass Root.
var myFlashVar:FlashVar = new FlashVar(this);
trace(myFlashVar.getVar('myFlashVar'));
[code]....
Now I have to pass 'this' when instantiating the class so that later I can use DocRoot to get the loaderInfo for FlashVars.Is there any way to not have to pass 'this' and have the external class point to the Main Timeline?
View 1 Replies
Feb 14, 2011
I have recently started making (and am still making) the transition from ActionScript 2 to 3. I have used the _global variable in an AS2 project as I needed a variable to be accessible from within ANY swf loaded into my main movie. This worked like a treat.
However, along came AS3 and whipped that from right under my feet. After much Googling, a few people suggested making use of a simple class with a simple variable that can be publicly set and retrieved. I made a simple class, imported it and manipulated the value, and all went well, however the instance of the class I create in my main loader movie is still not accessible from within a second SWF that gets loaded into my movie. If I re-instantiate the class in the SWF that is being dynamically loaded, the value reverts to the default value in the class code, not the new value set in my parent (first) movie.
Here is my class code, stored in an external .as file, is there any way I can simulate the ostype variable being a global variable?
package{
public class ostype {
public var ismac:Boolean = false;
[code]....
it's used as a simple identifier as to what operating system this flash app is being used on (mac or windows) and as a result let's me server content - such as saving files - in a different manner.
View 1 Replies
Jan 29, 2009
I am looking for a simple scrolling thumbnail class written in AS2. Does anyone know of any tutorials or code samples anywhere? I can't seem to locate one. I have written one but I have a problem. My thumbnails are 100px x 100px. When I have more than like 36 (can't remember the exact number), my mask (which masks a bit on the left and the right side of the horizontal thumbnail scroller) no longer works. I found out that there is a max pic size for flash so I'm assuming that I am exceeding that max pic size which causes the mask to not work when I breach that size.
View 1 Replies
Nov 19, 2009
Does anybody have a simple "load sound" example to show me the proper way to load the sound within a class file?
I tried
ActionScript Code:
import flash.events.*;
import flash.media.*;
[Code].....
Quote:
1067: Implicit coercion of a value of type String to an unrelated type flash.net:URLRequest.
I also tried declaring a "loader" variable, and then setting my sound variable to = my load variable, but that didnt work either ....
View 1 Replies
Jul 31, 2010
I have .fla file where I have instantiated an object of a class( testclass.as ) like this in frame 1
[Code]...
View 9 Replies
Oct 20, 2009
I want to draw a simple circle behind my class both center aligned, but I'm getting problems with the coordenates of my class/movieclip.Here is my class.
public class SM extends MovieClip {
public var auxx:Number;
public var auxy:Number;[code].....
I think that my class/movieclip isn't at (100,50) because when I manually substitute 'auxx' and 'auxy' in drawCircle for 100 and 50, still not ok.
View 7 Replies
May 26, 2011
Well I finaly found a script that's pretty easy but interesting to use.Then I thought, why not help the community out and try to convert it into a class which would be very dynamic and easy editable.Well I figured out how to draw a dynamic mask, but after that I can't seem to figure out how to implement the mouseOver/imgPanning into the same piece of code.[code]The commented section is the code that makes the img pan, but I cant seem to figure out how to implement this so people can still use the drawRectangle function.
View 2 Replies
Apr 13, 2011
To start - its best to say im new to Flex / OOP in general. I have been trying to add a custom class based on StrokedElement in order to implement a simple grid (not like the existing Flex Grids - this would just be for display - not holding elements etc...)
My current class looks like this:
package ui.helpers {
import flash.display.Graphics;
import spark.primitives.supportClasses.StrokedElement;
public class SGrid extends StrokedElement {
public function SGrid() {
[Code] .....
View 1 Replies
Apr 16, 2007
I try to make a simple copy of a flv video in a new MovieClip using the BitmapData class.
Here is my code :
Code:
var video1:MovieClip = this.attachMovie("mcVideo","videoMC",1);
var objVideo = video1.v;
var _nc:NetConnection = new NetConnection();
[Code]......
View 6 Replies
Mar 18, 2010
I want to create a simple component in as3, cs4. There are 2 problems I cant solve:
1.)I can't get the default parameters "loaded" in the class for the component so lets say if I have w = 10 in the parameters how can I refer to it in the code?
2.) How can I get the tool with which I can set which corner of the component should stay the same : it looks like this in the default
flash button component
theLinesTool.png (11.82 KiB) Viewed 290 times
View 2 Replies
Aug 1, 2011
Flash is not in my toolset, but I am an old Director jock and have spent some hours dipping my head into the Flash manual. I suppose that makes me a promising beginner-level poster. I'm working in CS5.
I need to make a simple Flash-based sound player for a website for a newly-released novel (http://www.bearriverbooks.com/index.html). I want the user to click on what appears to be an icon (or image), which kicks open a simple controller and starts playing a sound file (a radio interview, which I will probably export using Flash's voice compression). Nothing fancy. Just want the visitor to hear the sound and be able to apply simple controls (stop/start/rewind/volume).
I can learn ActionScript, I suppose, since I used to dream in Lingo, but my life would be a lot simpler if I could just publish a controller without having to roll my own. I'd like to think there's a magic button somewhere that can do this, but I haven't found it yet.
View 4 Replies
Jun 25, 2007
I'm having some problems importing a class, the message that Flash gives me is this; The class being compiled, 'ImageLoader', does not match the class that was imported, '[URL]'. The only line of code in my flash movie is this: import com.martijndevisser.*; And yes, the class is in that folder The class is from here: [URL] I've used the class before and it works fine, I just dont know what to do?
View 4 Replies
May 17, 2011
I'm new to Flash AS3. I started making a game and I am a bit confused. Let's assume that I want to create a game that has multiple levels/modes, how can I do this in an object orientated way?
When i create games in other languages e.g. XNA C#, i create a separate class then create an object of that class within the main class and run the game based on a simple statement.
[Code]...
View 2 Replies
Dec 19, 2011
I have an xml snippet that contains an object hierarchy:
doc = """
<RootObj val1="ValueOne" stat1="Stat1" stat2="Stat2">
<internalarray type="array">
<InternalObject val1="12" val2="12" />
<InternalObject val1="13" val2="13" />
[Code]...
View 1 Replies
May 26, 2010
I've finished my flash file. I created it with Flash CS3. I didn't use any scripting, dynamic stuff, etc.. It's a simple flash movie of vectors/tweening.I want to insert it in my homepage, but when I publish it, I get quite a lot of code. I've been looking around & I see some sites that have all this javascript & some that don't.Could someone help me identify the correct way to embed my .swf file? I'm not a fan of .js since it doesn't work if it's turned off in a user's browser. I want my .swf file to play as long as the visitor has Flash 8 or higher installed. And if they don't, I want to display a .png instead.[code]
View 2 Replies
Nov 6, 2009
I am having trouble doing a motion tween in CS4. I am just starting to use CS4 again after a little hiatus, I know I was able to do a motion tween like I did when I was using CS3 but I can not find how to do it again.
View 2 Replies
Jul 17, 2009
I'm building a simple soundtrack in CS4 where files are loaded externally, and played according to the frame. So on frame 5 there may be music, and on frame 9 its stopped, frame 10 will be another soundtrack, etc.
I'm trying to build the channel in CS4. I've really looked around and the correct syntax is so confusing. This is what I have so far.
[Code]...
View 1 Replies
Nov 17, 2009
I want to have 4 radio buttons Then which ever radiobutton the user has chosen I want Flash to use it later on.
[URL]
however I receive the following errors why?
**Error** Scene=Scene 1, layer=action, frame=1:Line 4: The class or interface 'fl.controls.RadioButtonGroup' could not be loaded.
var myradioGroup:RadioButtonGroup=new RadioButtonGroup("Group 1");
**Error** Scene=Scene 1, layer=action, frame=1:Line 13: The class or interface 'MouseEvent' could not be loaded.
function showResult(event:MouseEvent):void {
Total ActionScript Errors: 2 Reported Errors: 2
View 10 Replies
Jun 11, 2009
I am having trouble getting a simple animation to play properly, on a site designed by someone else, in IE. It works fine in Mozilla and Safari. In IE, on some computers, it shows up but there is a prompt about downloading a Shockwave add-on. On other computers it doesnt show up at all. Going from Mac to PC is also presenting problems. I'm freelance, so it's not like I'm in the office with these other people, so I only know what's going on with the 3 pc's I have at my disposal; which is as described above.
View 3 Replies