ActionScript 2.0 :: Semi Colons Ever REQUIRED After Function Definitions?
Nov 22, 2003are semi colons ever REQUIRED after function definitions? From my experience Flash's parser doesn't seem to be too picky.
View 9 Repliesare semi colons ever REQUIRED after function definitions? From my experience Flash's parser doesn't seem to be too picky.
View 9 RepliesI have shortened this example to keep it simple, otherwise I wouldnt be doint this
I need to pass different variables to function inForLoop each time.
Code:
function someFunction():void {
for (var i:int = 0; i < columns; i++) {
for (var j:int = 0; j < rows; j++) {
[Code]....
creating a frontend for a podcasting website. It will basically run from an xml feed produced by podpress. This isn't particularly important.My question is, how do I import xml entries with colons ":" in them. For example the line highlighted below.
Code:
<item>
<title>podcast1</title>
[code].....
I am using the following AS code to call a javascript function which will return me the required value.[code]However when the function is called , it seems it is returning me a 0 always tried hard to understand the issue , but i guess i am not able to figure it out.I tried to alert the value returned by javascript function , it is proper,[code]
View 2 RepliesI have a XML schema.I want to read only table tag and its geometery tag using action script3 code.Any Idea.
<table name="TableBase 1" id="TableBase3010" overflow="false" direction="lr-tb" suppress-empty-lines="false">
<style-ref name="default"/>
<geometry size="absolute" position="absolute">
<location left="117" top="102"/>
[code]....
Is there a way to tell Flash to allow functions to be redefined? I made 10 different programs, but then it turns out I need to put them all together, so now I have 10 different scenes with similarly named functions that do slightly different things. And of course I get a million "duplicate function defintion" errors. Is there any way around renaming each and every one of them?
View 8 RepliesI want to use semi-transparent mask on external swf for smooth transition. I'm using
clip.cacheAsBitmap = true;
mask.cacheAsBitmap = true;
clip.setMask(mask);[code].....
it doesn't work... what am I doing wrong?
Can you export a semi transparent .swf? I need to send a .swf file with 70 percent opacity that will eventually be an overlay over a video.
View 1 Repliesusing action script how to draw a semi circle...i need to add tha semicircle in another circle the circle looks like this ![alt text][1] how to draw a semi circle inside that circle
View 1 RepliesI've been developing in AS2 for a few years now, and I'm learning AS3 at the moment. I ran into a problem about setting alpha on a PNG image.
I have a movieclip that holds a semi-transparent PNG image which comes straight from the library. Now I want to edit the alpha property of the movieclip. In AS2 it all works fine but when I set the alpha property in AS3 all semi-transparent pixels in the PNG image will fill with black first; then the alpha setting is applied.
Do I need to save my PNG's in particular way or do I need to edit settings in Flash to display correctly?
i need to create an arbitrary number of display objects using a for loop because the number of objects will depend on the number of items in an xml file.
so i want to control the objects using actionscript. in as 2 i could create a temp variable in the for loop and use attachMovie() and assign an instance name. i know in as 3 you can use the .name property, but i heard you had to use the variable handler to control the object.
so i can't do this because it generates an error:
var numOfItems:uint = 5;
for(var i:uint = 0; i < numOfItems; i++)
{
var mc[i]:MovieClip = new MovieClip();
}
Is there a way to get a list of the exposed functions from a Flash object? For example, you could get a list of all methods in an object by executing[code]...
The only issue is that this won't expose any methods registered through the ExternalInterfaces API. I can try and see if the function exists (object['method']) and it tells me it is a function, but I would have to guess every existing method in this manner..
When load and SWF into another, the loader SWF can get definitions in the loaded SWF using ApplicationDomain.getDefinition(name:String) in example:
package
{
// ... imports
public class SWFLoader extends Sprite
[code]....
how can I get ALL the definitions and not just ONE of them?
I use Loader.unloadAndStop() function on loader which was used to load an SWF, but I can still reach classes using getDefinitionByName. How to remove them from the memory?
View 1 Replieswhen you iterate through an array using for / each, assuming the elements in the array are primitive types, the looping var takes on the type and value of each item, but is not a reference to the item.
Code:
var arr:Object = {a:1,b:2,c:3};
for each (var a:int in arr) {
a++;
[code]...
This differs from the behavior of PHP5, for example, where even though most objects are passed by reference automatically, objects within foreach loops are treated as copies unless specifically passed as &references like
PHP Code:
foreach ($arr as $key=>&$b) {}
Is there any way to get AS3 to do the decent thing and give you a choice whether subarrays are passed as references or not, without resorting to making ByteArray copies of your objects for every iteration of a loop?
I am trying to find out if it is possible to a) create a semi transparent box in flash, b) motion tween that box into place, c) subsequently use it to run forms and PHP scripts (connect to a MySQL instance, ect). I know that an exact answer to c) will be long and complex, so a simple (general) yes or no will suffice... but if someone could point me in more detailed direction with a) and b), If you need to see the actual project I'm working on, or if I need to clarify my questions,
View 1 RepliesI am quite experienced in Photshop and other elements however I am an absolute novice when it comes to flash.
What I am trying to create is an effect for a logo in which the motif in a semi circle shape which i want to appear in a wipe fashion starting left to right so that in wipe across and the shape appears in full at the end.
The shape in a rainbow....this would also have the company name below the logo which would be visible from start to finish. I have attached the picture of the logo. I would like the gold pot to also appear in the swipe of the rainbow.
I'm trying to make a simplegame in which you have to avoid a bunch of angry looking circles as they move across the screen. What should happen is that they all spawn outside of the stage and move across it then when they reach the other side they appear from somewhere else outside the stage So far I have managed to only make them come from one side of the screen by using this script on the enemy
[Code]....
I've tried using a switch() function with a random number to choose which side the enemy comes from but that didn't work it just skipped to default
Once I have a semitransparent object (with alpha not equal to 1) and put a glow filter on it, the glowing area is visible not only near edges of an object, but also under the object. It changes the whole look of an object, while it (probably by my logic) only should have changed the look of edges.
how to glow (or drop shadow) only edges of an object?
I have a string that looks something like this: 00110; book1,book2,book3,: 6 What I need to do it spilt it up into sperate values by the semi colon. so in the end it would be like
[Code]...
I have a bunch of different Movieclips from about 10 different classes moving about the stage. What would be the fastest/most efficient way to detect collisions between two of them? They can overlap each other a bit before the collision is detected, so I thought the easiest way would be to draw a couple rectangles that take up a majority of the object for each class and use hitTestObject to see if any of the invisible rectangles of one instance are colliding with the invisible rectangles of another. Is this a good method? I figured that since a bit of overlapping is okay and actually preferred, that two or three rectangles can easily take up all the room I need for each object.
View 2 RepliesI'm loading 10 jpg images into _root.content.section_4.mc_anim, each is placed into its own movieClip.
Code:
_root.content.section_4.mc_anim["gall_img_"+img_view_index]
These movieclips are hidden and then have the images from an array loaded into them.
[code].....
magine a Flex application which contains spam/eggs.as: package spam {public var eggs:Eggs = new Eggs();
} At what point in the process of loading the .swf file will Eggs be instantiated?
I'm accessing the classes from an externally loaded SWF so that I can "skin" SWF applications at runtime. Everything works fine but I'd like to make it as dynamic as possible and allow developers to access all the class definitions in a loaded SWF without having the FLA file or a list of their names.
[Code]....
This seems like it would be really easy but for some reason it's not working.
I have a class file, class DataSet, which right now only takes an XML file, parses it, and pushes the XML into an array:
The object is instantiated and an XML file is passed back to the object definition. If the XML file is successfully loaded, the class should then called the function parseXML() and put the data into the array.
But for some reason, parseXML() is never called. I have no idea why this isn't working, because the syntax checks out and I've seen millions of other files where functions call other functions.
Here's the class file:
[Code]....
would like to know if there's a way to overwrite a specific definition in the "currentDomain" with one available in a child swf?
I'm loading swfs as assets, and since some of them have code in timeline (mostly stop()'s) i'm exporting symbols as subclasses of my .as
however would like if theres a way to be able to simply write:
var myBall:Ball = new Ball();
instead of:
myBall:Ball = new ballSwfAppDomain.getDefinition("sandbox.Ball")
I try to animate a Movieclip (box or circle) thru a half ellipse path. Circle or ellipse path will be random.
View 1 RepliesI'd like to add a couple of different MC's to the particle stream. I'd like to do that by referencing different items in the library.So I have 12 different particles in the library exported with classes named from Bubble0 to Bubble10 now as I run through my for loop I'd like it to use a different particle each time. first time I tried:
ActionScript Code:
var bubbleArray:Array = new Array();
bubbleArray.push(Bubble0,Bubble1,Bubble2,Bubble3,Bubble4,Bubble5,Bubble6,Bubble7,Bubble8,Bubble9,Bubble10,Bubble11)
for (var j:uint = 0; j < NUMBER_OF_BUBBLES; j++) {
[code]...
Scene 1, Layer 'actions', Frame 1, Line 871086: Syntax error: expecting semicolon before leftbracket.Is what I'm trying to do possible without some clunky switch statement?
P.S. I tried searching the forum for an answer but the terms are so common I couldn't find what I'm looking for.
I wrote two projects using the same 3D library but I modified it pretty heavily in one (to the extent that the inheritance is pretty different on one) - now I need to load one into the other and I'm getting some weird errors that look like the child swf is trying to use the same class definitions as the parent even though it should be in an entirely different namespace.
So - anyone have a tricky way of forcing the loaded swf to use the classes it's compiled with rather than the ones already defined in the parent swf (and vice versa) or do I need to refactor all my stuff?
So I know you can assign a base class to a library definition within the Movieclips library information field but If I have 30 items in the library and I change the Base class this becomes a pain in the ass, can this be done programmatically when I instantiate the library definition?
var new_shiz:MyItem1 = new MyItem1(); // Needs to have a generic base class of MyItem