AS2 :: Terminate A Conditional Test Only One Level?
Jun 19, 2011The break statement terminates the whole loop or test, but I want to terminate it only one level. How would you do that?
View 1 RepliesThe break statement terminates the whole loop or test, but I want to terminate it only one level. How would you do that?
View 1 RepliesI have a loop
[Code]...
This if statement is checked by compiler 10 times but I only need once(i.e. when i==0).So once it has been executed or say the statement condition is true,can I kill it. Meaning that this statement won't read by compiler or ignored.
I have a loop
ActionScript Code:
for(var i:int =0;i<10;i++)
{
[code]........
Closebutton to terminate Flash app I wonder how one can do the following: How do I add a Close button to my Flash application? So that the app is terminated upon a click - and also if certain criteria are met (like totalsystememory size too large) that this be done with As3 calling some "Terminator function"
It seems there is a way out there as sold below;
experts-exchange. com/ActiononScript/Q_26578921.html note url above is not complete due to forum rules...
The fills behave as expected but I can't get the stroke to break. For some reason it ends up connecting back to it's first coordinate. I've attached an image illustrating the problem.Here's the code:
ActionScript Code:
import flash.display.GraphicsPath;
import flash.display.GraphicsPathCommand;
[code]......
I have a loop that is running to display images of all my clients.So, the image names are client0.png, client1.png,client2.png and so forth.I have a movie clip that is duplicated and uses the Loadmovie command to call the images. The code I'm using looks like this.
var position = 0;
for (i=0; i<50; i++) {
emptyMC.duplicateMovieClip("emptyMC"+i, i, {_y:+position});
var position = position +150
loadMovie ("http://www.url.com/client"+i+".png", "emptyMC"+i);
It's working great! But I don't have 50 clients, so I was wondering if there was a way to terminate this loop once it was unable to find a file. Does it already terminate once the file isn't found? Every time I test, the output unfortunately tells me "file cannot be found blah blah blah" or whatever. And all I want to do in order to update this page is to upload another image to the server without going back into the .swf and changing the i<50 to the exact number of clients I have.
im trying to create a level select screen so the buttons unlock as you complete a level, so far i have this on each button:
on(release){
if(this.number <= currentItem){
gotoAndPlay(3);
}
}
[Code]...
How to apply this kind of logic inside FMS?
View 6 RepliesIs there a way to immediately terminate the loading on an external swf and the loading of that external swf's dynamic content? I've tried the code below in the parent swf, but no success. The external swf's dynamic content continues to load.
View 2 RepliesI am writing up an app that must not be allowed to shut down the users system under any circumstances, thus I need to learn how I can terminate my app. What tools are there to do this? So, Is there a basic way to have a "global error sniff" that somehow determines that the app needs to be terminated - and thus prevents affecting other processes that are running?
View 1 RepliesHow to terminate a Flash application upon unforeseen errors? I am writing up an app that must not be allowed to shut down the users system under any circumstances, thus I need to learn how I can terminate my app.What tools are there to do this? So, Is there a basic way to have a global error sniff that somehow determines that the app needs to be terminated and thus prevents affecting other processes that are running?
View 1 RepliesI have two layers in my FLA both with empty movie clips as follows:In mc_Empty1, I attach a faded background movieclip as I wait for mc_Empty2 to load a SWF. Once the SWF is loaded into mc_Empty2, I want to remove the faded background movieclip from mc_Empty1. When I load the SWF from the main timeline, the onLoad() function works and removes the faded background from mc_Empty1. However, when I load the SWF from mc_target, the SWF loads, but the onLoad() function does not. Here's my AS2 code:
//Loading SWF from main timeline
mc_Empty1.attachMovie("mcFadedBg", "mc_FadedBg", 1);
mc_Empty2.loadMovie("My.swf");mc_Empty2.onLoad = function():Void{ trace("loaded"); //This works removeMovieClip(mc_Empty1.mc_FadedBg); //This works}
[code]....
I know I'm targeting properly because the SWF loads as it should, but the onLoad() function does not.
This is making me a little kooky today. I thought I could defined a library path in PREFERENCES > ACTIONSCRIPT > ACTIONSCRIPT 3.0 SETTINGS then that library would be available to all AS3 FLA files, but that doesn't seem to work for me. If I use the PUBLISH SETTINGS and define the library path everything is fine.
Is there something that I could have done to disable the application level class path functionality? I guess I'm trying avoid having to set the library path for every new FLA I'm making.
I'm doing a bigger aplication in flash (as2).Image, there is a main "home" flash with several menu buttons.Clicking these buttons, I load external swf into an empty container in this "home" flash.[code]clicking buttons in this second level, will load external movies into an empty container in this SECOND LEVEL swf.This works fine, but now, coming to the THIRD LEVEL (don't think there will be more in the future) problems come up, some scripts won't work.Now (I'm a as2-beginner) I think, loading external swf ALLWAYS into containers in the first "Home" flash should solve the problem.But I don't know, how to load an swf from the third level into a container in the first "home" level.In the "home" level, I have a "close" button, that will unload the container content.I need to go to a certain scene "content_2" in the home swf, too.
View 7 Repliesi have game im doing, and i want it to jump to level 2 upon completing the first level, but the problem is, the level 2 is a seperate swf, i've tried to use
Code:
on (release) {
loadMovie("level2.swf",2)
}
I'm designing a platformer game, in which the code is all held within the character MC. I want to pause the game using something like 'delete this.onEnterFrame' as a start point to terminate code. The code layout within the character is like so:
onClipEvent (enterFrame) {
...
this.onEnterFrame = function(){ //within clip event
...
if(btnon == 1){ // when button pressed(on stage)) global value of 1 is true
delete this.onEnterFrame;
}...}}
Due to the fact its within a clip event structure, it doesn't pause it, instead it slows everything down. Would I have to construct all my code in a frame layer or can I still use an MC to terminate this?
I have called main.swf into a container in index.swf.
myMCL.loadClip("main.swf","container"); is an action on my Index.fla timeline.
I have my navigation on index. (i wanted it to go on main, but the nature of the animation meant it had to go on index)
I need to call "home.swf" into "main.swf" from the navigation button in Index.swf.
When I had the navigation on "main.swf" this was my code to call "home.swf" into the page.
on (release) {
Preloader_mc.gotoAndStop("home");
}
("home") is the label name where the preloader is for home.swf
how to call the preloader for home into main.swf from "INDEX.SWF INSTEAD OF MAIN.SWF"
I have a file1.swf which loads file2.swf into it. Within file2.swf i have a button that when clicked needs to remove file2.swf and load file3.swf into its place.
View 2 RepliesIs there a way to link to one level below the current level? Instead of saying _root.level1.level2.level3, something like: ../level3 ?
View 4 RepliesI'm trying to test a custom Flex 4 skinnable component, using the FlexUnit UIImpersonator class. If I run my tests from a FlashBuilder Spark only project everything works fine. If I try to test from a project with the mx component set on the classpath I get a "getElementIndex not available in non Flex 4 projects" error.Can I unit test spark components in FlexUnits visual test environment while still having the mx component set on the classpath?
UIImpersonator delegates it's method calls to a "testEnvironment".The implementation used for this "testEnvironment" is decided by the VisualTest EnvironmentBuilder class and the FlexEnvironmentBuilder class. If the FlexEnvironmentBuilder class can find the "mx.core.Container" on the classpath it returns a MX environment, else a Spark environment. Only the spark environment has valid implementations for Flex 4 relevant method calls on the UIImpersonator - like the addElement method.
My buttons only work when I click on them on the stage while having the "enable simple buttons" option on. They do not work if I try to "test movie," "test scene" and publish it to a SWF. Nothing responds whenever I am in these modes. I am using Adobe Flash Professional CS5 Actionscript 2.0.
This is the code that I put in for the buttons:
[Code].....
i have a movie that has worked fine in past during Html test but ive been doing some dubugging using the flash test latly and it runs fine here but when i go back and try to test in Html mode no errors come just the movie never fully starts (starts up about as much as if there was an error).
View 5 RepliesI have two scenes in my flash file and in scene 1, first button takes you to frame 2 where movie clip is -works
on (release) {
gotoAndStop("scene1",2);
}
second button takes you to frame 3
but on scene 2 that performs same function as scene 1, the first button
on(press){
gotoAndStop("scene2",2);
}
instead of going to frame 2 goes to frame 3. and the second button goes correctly to frame 3.that happens when i test scene! when i test movie all buttons work properly.
In FlexUnit 1 it is possible to access the name of the currently-running test using the TestCase.getName() method because all tests subclass TestCase. In FlexUnit 4, however, there's no base class for tests; the tests are identified by annotations. So, how can I replicate the getName() functionality in FlexUnit 4?
View 2 RepliesSituation:
- We have a Flash application located on a SAP EP (let's say ep.x.com)
- We have a SAP ABAP Application (Webservices) on a SAP WebAS
server (abap.x.com)
- Clarification: This is not about Flash islands / but a normal Flash application communicating with WebAS ABAP via WebServices
Problem: Due to the changed security policy in Flash 10 this scenario does no longer work.
- A crossdomain policy file on root level cannot be deployed on root level
- The WebServices http/s headers cannot be modified, since the WebServices are generated by the WebAS IDE.
Comment: Technically there is a way to patch a WebAS ABAP,but this is not a practical / acceptable way in a normal SAP WebAS infrastructure.
Conclusion:- The above scenario (Flash from EP content / WebAS ABAP as backend) is a quite normal scenario in the SAP world.
- SAP / Adobe always features the close relationship between their technologies.
Question:- What could we do?
- How does the Visual Composer works around that problem?
I have a movie that's 500x400 px in level 0 and has lots of thumbnails with pictures that I want to open. the thumbnails open a 500x400 px movie above the other but on level 1. the problem is that when the new movie loads on level 1, the thumbnails on level 0 (that are now hidden by the new movie) are still active, and if i click anywere in the movie on level 1, it trigger an action from level 0. Is it possible to load a movie to level 1 that deactivates the movie in level 0 without unloading it?
View 1 RepliesIn CS5 I get the above message. I need to debug so it's very important. Anything I need to do?
View 2 RepliesI have got a flex app that communicates with a Scorm-API.When i run a javascript function from flex with "adl.nav.request" , i have to make a terminate function to make it happen which unloads the whole system,becouse this function updateds an "imsmanifest.xml" file. This xml is updated this time. This xml contains all the items that are connected to the index.hml which runs the flex app. That is why its refreshes. But i don't want my flex application to restart too.
View 2 RepliesDoes any one have a idea about how to do a packet loss test like in ping test from flash technologies (Flash or Flex)?
View 1 RepliesSo I'm not that familiar with using conditional statements yet, and I'm trying to get my head around it. I know what I need it to do, I'm just not sure of the correct syntax.I basically want a statement that says:
if( movieClip1 == frame 10)
{
then play movieClip2
[code].....