I'm sitting here doing some C# programing and in one of my switch statements I ended up using the goto keyword. Well just out of curiosity I booted up FDT and created another switch statement in ActionScript 3. Well to my surprise there is apparently no goto keyword in AS3 or at least I couldn't find a substitution.
I'm trying to create a movie, that when a correct word is entered, it goes to a specified frame. The code below words fine but I need to make an addition to it,
on (release, keyPress "<Enter>") { if (inputtext eq "word1") { gotoAndStop("frame1"); } else if (inputtext eq "word2") {gotoAndStop("frame2");[code]....
I was hoping to add extra words that would go to the same frame. I know I ca do this by�
if (inputtext eq "word1") { gotoAndStop("frame1"); } else if (inputtext eq "word3") {gotoAndStop("frame1");
but was wondering if there is an easier way, something along the lines of�
if (inputtext eq "word1", "word2", "word3") { gotoAndStop("frame1");
I was wondering if there is an easy way to search a string for a keyword. I am working on a twitter piece which searches strings for keywords and have found a way of loading all the data properly.
I'm a complete novice to ActionScript, OOP and Flash. I have no idea when you are supposed to use the keyword "this". I have searched the forums but obviously searching for the word "this" is not very successful! I've read quite a few tutorials now and it seems that different people have different opinions on when and where it should be used. For example what should I be doing in the following class? Both seem to work but is one the "correct" way? Are there situations where things will not work if you omit the "this"?
ActionScript Code: public class Sector { private var _radius:Number; public function Sector(radius:Number){ [B]this.[/B]_radius = radius; } public function get radius():Number{ return this._radius; } public function set radius(value:Number):void{ this._radius = value; }}
I have another possibly related question with regards to naming conventions. I like the use of underscores for properties with getters and setters but what about the names of the constructor parameters that are used to initialise these properties? In the above example I have used "radius" for the constructor parameter although it is also used for the getter and setter functions. It seems a bit of a palaver to come up with different names for the same quantity but is what I have done really bad coding practice?
I am trying to create a number of movie clips in my main movie but I don't seem to be able to access these movies using array notation and the 'this' keyword. Here's some example code in a main timeline. var i=0; createEmptyMovieClip("clip"+1,0); trace(this["clip"+i]); ////undefined - why????? var clip=createEmptyMovieClip("clip_holder",1); clip.createEmptyMovieClip("clip"+i,0); trace(clip_holder["clip"+i]); /////_level0.clip_holder.clip0. This is ok. What's wrong with this["clip"+i] ?
i got an error in AS.1042: The this keyword can not be used in static methods. It can only be used in instance methods, function closures, and global code.this is the error line.public static var defaultEase:Function = this.easeOut;
I am trying to do the search api for my flash site. I need to know how to enter the keyword and search on youtube. Then youtube will return the videos list which the user can click and watch it.
I am again in trouble with my new project where i have to make a keyword search popup.There is a online study material from which i have to search keywords.Study materials are coming from XML file.So I placed a button for search option.when I'll press it there should be a popup window with keyword search fields ( as shown in image in attachment ).What I could do is, I can popup the window with given fields bt i dont know how to search for given keywords.
i have a big problem with Search function to build the Glossary.. First, what is the best way to build up the Search function that contains 400 more keyword?? what way should i use, with XML, or combo box or etc????
I have used the text field with String.indexOf() .. but it seem like not the best way.. because it's really long..
I was ust wondering how I would go about linking a button to a keyword within a .jpg file, within a folder and making that .jpg appear within a window. The word that the button will search for will not be the full name of the .jpg, it will only be part of the .jpg file name.
I have been building my website using a simple mouse event click system that makes movie clips play at specifically names keyframes. it took me a bit, but I got it right and the code was simple. here is an example of the code that works: films.addEventListener(MouseEvent.ROLL_OVER, btnOver1); function btnOver1(event:MouseEvent):void{ sketch_5.gotoAndPlay("f_over"); }
Pretty simple stuff. but now I am working on a paid project for someone, and it is a bit more complicated in scope, but essentially I would be using the same code over and over again. it's a glorified slide show. but I ran into a problem. I used this code, which is the same (with different names and mouse event) as the one above. mcLifeLED.addEventListener(MouseEvent.CLICK, Light_Type); Function Light_Type(event.MouseEvent):void{ mlights.gotoAndPlay("p_life"); }
Its telling me that "Function Light_Type(event.MouseEvent):void" is wrong with this message "1071: Syntax error: expected a definition keyword (such as function) after attribute Function, not Light_Type." I may be wrong, but from what I can read in it, it's telling me that the function I named about "Light_Type" can't be found...
I was interested in searching through text in a textfield, and applying text formatting to keywords. For example, every time the word 'the' appears, apply a text format that changes it to green and 14pt. Here is an example of a format and text applied to a textfield. How would I go about searching through the textfield and applying this format only to specific words? my_txt.text = 'The cat jumped over the house.'
/// my format I want to apply with (_lt_fmt) { align = 'left'; blockIndent = 0;
I am a flex developer, well this time , client requirement has came to search the keyword in google adword, go to the following link, if i enter some keyword here in the search box like [URL] "dog training tips", so i get lots of results, i have to develop this same application in flex, which will fetch the data from this google's tool, Does any one of about how to get this data from flex, is there any flex or actionscript API available which will return me the data, that i'll filter according to ma requirement,
I am currently reading the Actionscript 3 Bible and the author shows an example in which a custom eventDispatcher class is created. When the class is later used in the code it's called as such:
//Thermometer is a custom eventDispatcher that extends the eventDispatcher class. var thermometer:Thermometer = Thermometer(event.target); //why no new keyword?
I'm a new programmer and I was curious if someone could explain how this works? Why is the new keyword omitted? When you omit the new keyword on a class that extends another class is it essentially just calling the superclass(eventDispatcher) constructor?
I've been testing what you can do with loaded content lately and I'm trying to use the 'new' keyword to create new instances of a loaded swf. For example...
ActionScript Code: function onLoadComplete(e:Event):void{ var loadedSwf:MovieClip = e.currentTarget.content;
Today I've received a small ActionScript 3 application that I need to have a look at and make some changes to.I've noticed that the entire application is riddled with the return keyword, eg:
// Constructor public function MyClass() { // some logic[code].....
Is there a possible reason for this, or is the developer who worked on this using some weird, self-taught practice?
package { import flash.display.MovieClip; import flash.display.Graphics; public class Rail extends MovieClip
[code]...
this is a simple Rail class, what I am trying to do is take the for loop out of the timeline and build into the Rail class itself. How do I refer to the Rail class itself within the method? If I am doing this the wrong way please let me know! Would it be better if I created another class, say a "RailSpacing" class and build the for loop into the contructor into that?
Also, if I wanted to add depth to the rail(textures or something else to make it look real) and still be able to change the color without transforming the entire rail instance, what could I do ActionScript wise. I have come to the conclusion the only way to do this is creating a multilayered movieclip and target the base object and not the highlight/ shading layer.
Also, if I created a nice graphic/movieclip and exported it for ActioSncript, how can I find the class file and add too it? Is this even possible? Is it possible to draw something that is detailed and export it and then add some methods?
Is it posible to custom flash to behave like powerpoint ? can it move to next and previous scene by clicking on keyboard arrows or by using the mouse wheel?
-In the constructor of a separate class named "Vec", I call testFunction in the AppMethod object by:
NameSpace.AppMethod['testFunction']();
-After I create an instance of Vec, flash traces the AppMethod object. I thought it would trace the Vec object? At least that how it worked in javascript. The keyword "this" doesn't change scope in Actionscript 3? Is there a keyword that will trace the Vec object instead of the AppMethod object?
When an instance variable is constructed by a constructor method, why do you need to refer to the current instance variable being created when its the only one being created? I understand assigning an expression to it but why name it "this." when it is the only object that the constructor is building? Does it have some hing to do with being able to naming that object in the Local Variable? In other words am I creating a generic object that will be named in another class?
I know this may be a basic question, however.how to encode a Flash Video (possibly with Flash Video Encoder using Cue Points?) and when the video ends, direct the user to a specific url. In other words when the video is over the browser automatically refreshes to a specifc page.
is there a tutorial for somtehing like this?
Are there any code examples?
Can I use Flash video encoder and cue points, Or should I use Flash WITH video?
I have an flv video playing from a FLV Playback component. I am trying to have the movie goto the next scene at the end of the FLV video. I have go through numerous tutorials online to get the action to do this, but to no avail. I have tried both addeventlisteners and NS. way to have the movie advance to the next scene after the flv and where the AS has to be to get the movie to function properly.