Flash :: Short Hand Methods Available?
Jun 8, 2009I'm used to using the if else shorthand:
var = (if statement) ? 'something' : 'something else';
Are there any other short hand methods available?
I'm used to using the if else shorthand:
var = (if statement) ? 'something' : 'something else';
Are there any other short hand methods available?
This is what Have done but will take up a lot of lines
Code:
check.onRollOver = function(){
_root.check.gotoAndStop(2);
};
check2.onRollOver = function(){
[code]....
wratts here gang , im doing a short flash movie and have run into a slight snag . i want to create the effect of a chase through space at high speed ( starfeild ). so far my efforts have left me scratching my head .
perhaps one of you know some Action script that can help me out .
Simply put, is there short circuit evaluation in flash. If not, is there a way to do something like it and still retain the elegance of short circuit evaluation?
View 5 RepliesI remember when I was a boy, say in Flash MX or something. I got the entire clip to resize and it would make the content in my html page resize. And it was bad. Now that I am a man with Flash CS3, and using Actionscript 2, I would like to resize my flash movie intentionally, letting the user choose how many rows they would like displayed. This would shift the content on the html page downward with each click, expanding the swf.
View 1 RepliesI've often seen on various websites headings that were created from Flash-based text. A good example of what I'm referring to is on vancouver2010.com , most notably on pages other than the homepage. I was wondering if anyone knows if there's a way to do this automatically with a text generator perhaps, or if I need to manually create each SWF file by hand in Flash if I wanted to do this. I've also seen headers created that appear to have come from a generator of sorts that are just images.
View 2 RepliesMy goal is to simply have the cursor swap to be a hand (pointer) when I roll over a MovieClip. Obviously I could use SimpleButton, but the situation is that I have some enemies that are obviously MovieClips, and when I select an ability to use I want the mouse to show as a pointer when I roll over them.
I assumed this would work:
var mc:MovieClip = new MovieClip();
mc.graphics.beginFill(0);
mc.graphics.drawRect(0,0,50,50);
[Code].....
There are workarounds such as adding a button into the enemy MovieClip and then removing it. Just seems there's an inbuilt way I'm missing.
Im trying to figure out a way in which i could replicate hand writting in Flash as2? I basically have a form in flash and i want it to be completed in handwritting, one box in the form at a time. I want to the pre-defined text to 'written' letter by letter?
This would look sooo much better than just having the text box to just appear.
I'm using the fl.controls.Slider class and I can't get it to show a hand cursor when hovering over it. Here's my code.
import fl.controls.Slider;
var slider : Slider = new Slider();
slider.x = 100;
slider.y = 100;
I need to know how to set the mouse cursor to be a hand when it is over a mouse clip. I'm using Flash with Action Script 3.
View 3 RepliesI am creating a loader for .swf , everything is fine, but I am unable to show the hand cursor. I get an error message :
Scene 1, Layer 'action', Frame 1, Line 26 1119: Access of possibly undefined property buttonMode through a reference with static type flash.display:SimpleButton.
Here is the code i use everything works except I am unable to show the hand cursor (I have disable it for now ):
var swf1:MovieClip;
var loader1:Loader = new Loader();
var defaultSWF1:URLRequest = new URLRequest("1.swf");
loader1.load(defaultSWF1);
addChild(loader1);
[Code] .....
my customer wants a custom handcursor in a flash application. however, we use a lot of textfields with hrefs inside, in which case the custom cursor should not be displayed, but the normal hand pointer. any way i can find out if the cursor is above a href formatted text?
View 1 RepliesI have a cursor class and i wanna make it so the cursor change to state 'over' whenever the hand cursor is there. I dont want to add an event listener for every roll over in my page.
something like :
if(handCursorIsUsed)
{
[code].....
I would like to know if it is possible to consume a AMF Service using .NET. I would like to consume a AMF service written in PHP using my ASP.NET Application, that is possible?
View 1 Repliescould I use another array to say 'milk', 'baby', 'yes', 'ball', 'bird' as the words appear using short one word mp3s?
PHP Code:
var words:Array = ['milk', 'baby', 'yes', 'ball', 'bird'];
var step:int = 0;
var readTime:Timer = new Timer(500, 1);
[Code].....
I've recently started using Flash in CS4 and finished up a short cycle and exported it as a .mov to find it had clipped the last two frames, Does anyon know why? Or how to stop it from clipping my work?
View 1 RepliesWhile working on a project involving a mask layer and artwork layer the tutorial that explained the procedure said to press F6 to add a new keyframe to the timeline. While on the current frame, the tutor was hitting F6 and a new frame with a keyframe was produced. I need to click on the next frame then hit F6 to make the keyframe. The project is to make a vine look like it is growing and involves making lots of subsequent keyframes in this manner. The tutor breezed through making one keyframe after another - I have to physically advance to the next keyframe THEN hit F6.This really slows things down.
View 3 RepliesIm working on a small drag and drop project and for the life of me I cant seem to work out how to get my movie to delay before it goes to the next frame.
Basically when a clip is dropped onto the target I need a short delay of about 5 seconds before going to frame 2.
I know that I need to set a variable but cant work out how to utilise it [code]...
Smug video by Adobe, hand the enemy more ammo against Flash?
View 2 RepliesMy movie targets flash player 10, and I compile it with FlexSDK v 4.51. It compiles and plays with no errors. But if I view the swf in Flash Player 10, some sprites that are set to buttonmode do not show a hand cursor or dispatch MouseEvents. In fact, if I play it in the Flash Player 10 debug player, I get an error:
"VerifyError: Error #1053: Illegal override of z in mx.core.BitmapAsset."
So to fix this, I can switch to using an older SDK, version 4.1. Now the error message is gone, but the mouseover problem persists - now for Flash Player version 10 and 11.
There are no flash 11 specific features used. It should be targetable using flash player 10.
I have determined that the mouse event and the override error are not related. The mouse event error seems to being caused by using filters. and I have found a workaround, by applying the filter to a child object, instead of the parent.
The error thrown above, is getting caused by an embedded bitmap. And it seems like a fix to that is to use flex SDK 4.1. Any reason not to just use the 4.1 SDK? Any way to make 4.5 sdk compatible with Flash player 10?
I inherited a flash project from someone and if I add a simple movie clip to the stage at position 0,0 it actually ends up in the middle of the screen!
What I can see is that when I open the stage in the library, in it's properties
X=350 and Y=262,05 all the subsequent movie clips which are added to the screen as by magic are added at position X=-350 and Y=-262.05
I would really like to return to a situation where 0,0 is top left corner. Does anyone have any idea what's going on here?
I'm trying to take into account the Garbage Collector (GC), so I decide to optimize this code:[code]For instance, is it useful to put "xmlOne = null" in every iteration? I'm checking with the Flashdevelop's profiler, but I don't see the difference.maybe, I can also reuse the item object rather than creating it every time, right?
View 1 RepliesI'm quite new to flash but have experience in other adobe programs, I'm trying to create banner with imbedded short video no more than 5-6 sec.I was desperately trying to find some tutorials or any help on this subject without success.
View 2 RepliesSo I'm making my own networking protocol for a online game, to save space each message (sent over TCP) is given a ID which is a short, 2 bytes, all messages sent from the server to the client and vice versa are strings, how can I convert a short to a string in java in just 2 bytes (characters)? I want to be able to convert a short int into 2 characters, so that I can send the short over the network in a string format in just 2 bytes and decode it back into a short on the other side (in actionscript 3). A character can hold 256 possible values right? So 256*256=65,536 which is the size of a unsigned short int!
Here's what I've got so far:
public static String toCode(int c){
if(c <= 255 ){
return Character.toString((char)c);
}else{
return null;
}}
public static int fromCode(String c){
return ((int)c.charAt(0));//Return the character code of the send string, 1 char only
}
This can turn a int into a single character which can be sent over the network, now I just need to have it use 2 characters and it can do up to a short.
how to create a short video to play before the user clicks on a video to watch. Kinda like a short advertisement (for our department) when the viewer wants to watch one of our football games.
With the help of another user here, I was able to get a video player to work using an xml list containing all of the video file names, once the title is clicked in the .swf file the player plays that video file.
xml file
Code:
<root>
<video>
<filename>UA029_Fb_1929_WA.flv</filename>
<title> WSU VS UW 1929</title>
<description></description>
[Code]....
so what I am trying to achieve is to have a short clip play every time a person wants to watch a video.
Also, Is there a way to create some type of text box in the swf player that will display all the metadata (game, year, score etc.) in that box?
in making this code short
ActionScript Code:
function addlist() {
var dataload = new LoadVars();
[code].....
convert a short as2 script (20 lines) to as3 for me... ?
View 0 RepliesI want to create a simple clip that will have a button to preload and play an mp3, possibly with a really simple preload bar, but I'd really like the mp3 to play while it's loading,
View 2 RepliesAnybody knows a short way to add a bunch of points to a Vector.<Point> variable.[code]
View 4 RepliesI'm researching a potential project involving flash based augmented reality, and I've already looked at FlarToolkit and FlarManager which seem pretty straight forward to execute marker detection. What I cannot find are any sites or assistance with how to detect hand position, etc. To allow the subject to 'press' buttons. An example of what I mean can be found here: [URL] where the model presses virtual buttons to take action.
View 2 Replies