ActionScript 2.0 :: Go To Frame 4 When All Base Symbols Had Changed To 100?
Nov 24, 2010
using array and for loop.I have 4 simbols named base1,2,3,4 with an alpha = 0. and I have 4 buttons named mur1,2,3,4. when I click over "mur1" the symbol "base1" change to alpha = 100. and so on.I need to go to frame 4 when all base symbols had changed to 100; I had tryed meny time but never get it to work.Example:
Realy i dont know if this is the right way of the script, please can you help me to write this action s. or maybe there is another way to put out this final test.
I frequently create a lot of Library Symbols, export for Actionscript, letting Flash auto-generate the Class & extending a custom base-class in order to give them all custom functionality w/out having to create a Class for each, and/or without having to create a FactoryClass for instantiating X number of ClassObjects for each Symbol to be added to.It's really fast for prototyping, and with this workflow I've only hit a few obstacles. Those are:
1 - If the Symbol has children you cannot give the children instance-names, else the compiler gives an error related to automatically declaring stage instances. Two workarounds for this are that you can uncheck automatically declare stage instances, and do it manually in your base-class. or you can avoid using instance-names, and use getChildAt().
2 - If the Symbol is a MovieClip, the timeline doesn't inherit the base-classes imports. I don't have a workaround for this.are these limitations that could be addressed by Adobe's Flash team, or are they limitations that are unavoidable without altering the workflow?
This question stems from this question that I asked yesterday.I've followed Theo's advice and created a .swc with all the common classes and added the .swc as an external library to my module .swf. This all seems to have worked smoothly--I don't get TypeErrors and my classes are all present in the catalog.xml of the .swc file when I unzip it--but now I've encountered a new problem: when I try to link a symbol in the module .fla's library to a base class from my .swc rsl, it says the base class definition can't be found in the classpath. The whole reason I want to use rsls is so I can do this,If I now include the project's source path or the .swc in the normal (not external) library path, will that cancel the sharing benefits of the rsl, or will the compiler still know not to compile the shared classes into the module .swf?
In my library I have:A Sprite named Emily of base-class "Character" with a sub-sprite labeled "head" of auto-generated Class "EmilyHead".A Sprite named Jess of base-class "Character" witha sub-sprite labeled "head" of auto-generated Class "JessHead".
Flash compiles with the following warning: Warning: All instances named 'head' will be automatically declared as JessHead in symbols that use Character as their base class. In symbols that are linked to user-defined base classes, instances with the same name must be of the same type. And then the runtime error:TypeError: Error #1034: Type Coercion failed: cannot convert EmilyHead@3a0d1e81 to JessHead. at flash.display::Sprite/constructChildren() at flash.display::Sprite()at Character() I can turn of auto-declare stage instances in the Actionscript 3 panel, but then I have to manually add a public var for all sub-child's, such as the head sprite. But then at least everything works as expected. This is more setup than I'd prefer to do, but everything else about this workflow is very fast & easy. What can I do to sidestep this error, while keeping the same workflow?
a_modified_dog suggested, and was kind enough to provide working code in the thread, Assign text to dynamic text fields on different frames, using the "onChanged" event placing code in the main time line of both frames 1 and 2 of a Flash Actionscript 2 movie. The "onChanged" event has been designed apparently for input style text fields only - requiring the user to input text. The code example provided works well for that sequence. But my intended sequence of user events does not permit the user to input a text value. The "onChanged" event does not work with the following intended sequence of user actions:
(1) the user makes a selection from a scrolling list of items that appear within a movie clip (MC1) on frame 1. The list is comprised of a number of selectable buttons.
(2) When the user clicks a button (BTN1) contained in MC1, the onRelease event assigns a string value to a text box (TXT1) within a separate movie clip (MC2) on frame 1. (this is working well)
(3) the user then clicks a stand alone button (separateBtn) on frame 1 that invokes a "gotoAndStop" at frame 2. (no problem)
(4) The text (TXT1) from within the movie clip (MC2) on frame 1 needs to be assigned to a text box (TXT2) on the stage of frame 2. (BIG PROBLEM)
I've played with both dynamic text fields and input text fields. Using the "onChanged" event works well with input text fields IF the user actually enters text into the input text box. Using the intended sequence, a text value is being assigned to TXT1 in MC2 by a button "onRelease" event from within MC1. This same text value (TXT1) should also appear in the text box TXT2 on frame 2. I've tried both input and dynamic style text boxes for TXT1. Both work well for showing the assigned text string on frame 1. Both styles also, when advancing to frame 2, show "undefined" in the corresponding text box (TXT2) on frame 2. Neither input or dynamic style of text box seem to recognize the "onChange" event - from having no text when starting up to having text within TXT1 dynamically appear after the user makes their selection from the button (BTN1)event (onRelease) in MC1.I tried assigning the text in TXT1 on frame 1 to a variable (var_txt1) - in the main time line - and having TXT2 on frame 2 read and assign the variable to TXT2 (TXT2.text = var_txt1), scripting also on the main timeline of frame 2.. Again, all attempts result in "undefined" appearing in TXT2 instead of the variable value (var_txt1). Using 'trace" on frame 1 shows the correct value for the variable (var_txt1). When advancing to frame 2, "trace" shows "undefined".
I have an exercise like a puzzle to learn how to manipulate the x and y buttons and mc position in AS 2. all the code work ok, just only I dont know how to go to the second frame when the base mc are iquall to alpha 100.
Exercise: on the left of the stage are 4 mc (base1, base2, base3, base4) with an alpha = 0. in the same place are 4 butons (tor1, tor2, tor3, tor4). And there is a button to scramble and a little code to rotate the pieces and change the counter. When I hit this button all 4 pieces change position. When I click on tor1 I have to drag it on his place marked for his xy position(base1), when I drop it, this Tor1 go to another xy position outside the stage and base1 change to alpha 100, and couter sume +1. but I don�t know how to check if all base mc are in alpha 100 and go to 2 frame. Here is the code.
stop(); _root.counter = 0; store base symbols in array[code].....
I have a small flash tidbit that is basically used like a menu. It scrolls through the thumbnails left and right, when clicked the pages navigates to the appropriate location. However, the flash movie jumps back to the beginning of the movie. Is there anyway I can get it to stay in the same spot when the page is changed? I tried using iframes, but this did not work out, it had the same result. ref:[URL] to see the problem scroll the images to the right and select 'wall boarder buddy' (fourth image from the left) this takes you the page and the flash resets to its original position.
So I added a bitmap to my library in flash CS5, and in its symbol properties I checked "Export for AS" and "Export in Frame 2" (I set Export Classes in Frame: 2 in AS settings.) On the first frame of my main timeline, I have
I created a multi symbol model character and rigged it with bones. Now when i add a keyframe, some of the symbols (hand, belly) disapear in the new frame. also, some of the symbols return to 100% alpha when they should stay invisible (handles for legs, arms etc.)
is it possible to prevent the exporting of embeded-font symbols in first frame? on my embeded-font symbols "export for as" is turned on and even if "export in first frame" is turned off my font symbol loads before firs frame.
I have a method that converts an int to a base60 string (using 0-9, a-z, and A-Z chars), but can't work out how to convert it back again. Here is my method for converting base10 to base60:
public static function toBase60(value:Number):String { var targetBase:uint = 60;
[Code]....
Works well. But how do I get the base60 string back into a base10 int?
Its been a while since i touched flash, which is funny considering i started my web/development career here.Anyway, in PHP there is a nice little function called base_convert (http:url....) which will take any number in any base (e.g. base 10, decimal) and convert it to any base (e.g. base 16, hex).So base_convert (15, 10, 16) will output F, which is convenient.I am wondering, as i cannot seem to find, if there is any similar function in actionscript. I am trying to convert from base 10 to 16 and then base 16 to 36.
I used this tut to create a menu. [URL] And my question is; Can I make the slider to move after a movie clip symbols instead of button symbols? That way my menu would be animated.
I'm working through a book called Foundation Game Design with Flash, and I'm finding the Flash IDE confusing. I've been programming for several years, so working with AS3 directly is far easier than trying to understand symbols and nested symbols and the difference between graphics and movie clips and scoping issues and all that -- when tied into the IDE.
How many of you who are making games in AS3 also use the Flash IDE? Can anyone recommend a resource that is AS3 heavy and Flash IDE light? I don't care how much time I may or may not save by using things like the timeline, I just want to understand what I'm using.
I'm attempting to use CS4 (PC/Vista, if that matters) to create a SWF file that will basically act as a "library" of commonly used symbols. This SWF would be loaded at runtime by other SWFs, which could then use the symbols within it, including all art and code assets.
how i can to know if the value of a FlashVar (in as3) has changed. For example: if i inicialize the flashVar with "1" and after set the flashVar to "0", everyOne knows that this flashVar has changed. the problem is if i have the FlashVar value setting in "2" and i set the flashvar value to "2", again.
There are any way to know if this flashVars has changed his value for the same value?
I've a basic portfolio page with 5 links. The idea being that 4 stay small and the active page is a larger font. When one link is clicked, itself and whatever font is currently large both swoop down and then the large text is replaced by whatever section the user chose.
I haven't keyframed anything, it's all done with actionscript and here it is. I made one of the links show what the var is currently set to in a dynamic text box. That all seems right. But whenever the 'currentchoice' mc is asked the swoop down, it just disappears rather than animates out. Here's the actionscript.
import mx.transitions.Tween; import mx.transitions.easing.*; var currentchoice:Object = new Object(); currentchoice.selection = large_anne;
Is there a way to Check if the xml file that your loading in has changed since you loaded it in last? I want to check to see if it has changed before i reload it into flash.
code: var myXML:XML; var myLoader:URLLoader = new URLLoader(); myLoader.load(new URLRequest("Data.xml"));
how i can to know if the value of a FlashVar (in as3) has changed. For example: if i inicialize the flashVar with "1" and after set the flashVar to "0", everyOne knows that this flashVar has changed. the problem is if i have the FlashVar value setting in "2" and i set the flashvar value to "2", again.
There are any way to know if this flashVars has changed his value for the same value?
Is anyone aware of a clever way to query (in AS3) an .xml file so that when the .xml file changes (as the result of an Access query in this case) the AS3 application (Google Maps API) refreshes using the new .xml data?
I have an animated SWF that I created. It is supposed to be at 3FPS, however it runs at 24FPS which is my stage's current FPS. How do I have different FPS's for my stage, and my SWF?
So... I'm asking, is there an eventlistener in flash that instantly detects change in XML?
What I do currently is to just load the XML again and again and check if something has changed. BUT it takes about half a second to load the XML again (not from cache).
I have a flash file(full link to flash looks like [url]... which loads mp3-file(link to mp3 I send with php through flashvars)
I've embed dynamically(with swfobject) this swf to my page. It's ok. Then I send ajax-request to script, which reloading div with flash. Div is empty.
Experimentally I found out that I've trouble with relative paths. Flash file embed with this address ./swf/audio/player.swf and mp3-address is ./media/audio/user/1/random.mp3.
I know I've read something about this here before but I can't find it, so for Mr. Thicky here, I have dragged some buttons on my stage - each one is actually an instance of the same movieclip. In the IDE, I have given them instance names like 'myButton1', 'myButton2' etc. I've then grouped all these buttons together into a single container movieclip called 'buttonHolder'. Now, in my code, I am trying to retrieve the instance name of the button I have clicked on:
I inherited a custom component from TextField. The component needs to know when any of its styles got changed at runtime via setStyle. How would I do that? It's probably obvious but I couldn't find an event or appropriate method to override.
Check bottom of this post. I am using MVC and the problem concerns my model. With my code I am creating a board which in turn creates tiles. Every tile on the board gets an X and a Y value. After this I want to prevent access to the setter to prevent myself from accidentally changing the value ever again.
I was thinking of using a constant instead of a variable, but it seems I have to define the value at the time of creation. In other words: const myConst:uint; myConst = 2; // does not work
Right now I have a work-around which I am not happy with. Surely there's a cleaner way.