ActionScript 3.0 :: Action Be Initiated Through Pressing A Key Combination?

Sep 11, 2008

Can an action be initiated through pressing a key combination? Here's a snippet instructing a MovieClip to move right when SHIFT+Z are pressed...

Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, testFn);
function testFn(event:KeyboardEvent){
if(event.keyCode == 16 && 90){
dot.x += 5;
}
}

Only the first key is recognized, i.e. the dot moves when SHIFT only or SHIFT+Z together are pressed; the swf's ignoring the second key.

View 4 Replies


Similar Posts:


ActionScript 2.0 :: When Pressing On The Button The Action Is Executed Just Once?

Sep 3, 2009

I have this project and I wanna when pressing on the button the action is executed just once

coz the action is Executed by the number of times you've pressed on .

here is my project :

[URL]

View 8 Replies

Actionscript 3 - User Initiated Pop-up Window Within Flash Ad?

Sep 3, 2010

I am currently working on a flash ad for a local bank. One of the frames of the animation requires that the disclaimer text be displayed. I am attempting to create a tab within the ad that if clicked will allow a small window to slide up (roughly half the height of the medium rectangle), display the disclaimer and then close. This would occur while the main animation is still progressint. The problem is I'm not sure how to go about it.

I've seen this technique in an Insurance ad on one of the major ad networks but have not been able to determine how to do it.

I am using Flash CS4. I am marginally proficient in AS3.

View 2 Replies

ActionScript 3.0 :: Where Is The Current Custom Class Initiated From?

Oct 16, 2009

A Custom Class can be initiated from an FLA or from another Custom Class. Is there a way to find at run-time, where is the current class initiated from?We can't use parent class before it has been added with addChild(thisClass), neither we can use root class to identify its originator. I believe, there should be a way to find it.

View 3 Replies

ActionScript 3.0 :: Looping Slideshow/Frames Initiated By FWD/REV Buttons?

Dec 4, 2010

How do I code the logic to create a slideshow that plays nextFrame() or prevFrame() using eventListeners for FWD and REW/REV buttons?

[Code]...

View 11 Replies

ActionScript 3.0 :: Mouse Move Initiated Scrolling Math

Jun 30, 2010

I'm really not great with the math. I'm pretty close with the formula but my movement is still wonky and doesn't stop where it should. (Top and bottom of the stage, rather than scrolling into infinity). For example, I need it to work like the menu at this link: [URL].

Code:
import com.greensock.*;
import com.greensock.easing.*;
stage.addEventListener(MouseEvent.MOUSE_MOVE, Move);
function Move(event:Event){
var distance:Number = mouseY - (stage.stageHeight)/2;
var percentage:Number = distance / stage.stageHeight;
var targetY:Number = -(content.height * percentage) + content.y;
TweenMax.to(content, 5 , { y: Math.round(targetY), ease:Expo.easeOut } );
}

Test of my code is here: [URL]. My fla is also posted as an attachment.

View 1 Replies

ActionScript 3.0 :: When Loader.load Is Initiated The Rest Of The Code Does Nothing

Nov 23, 2011

I made a simple animation for a preloader and when the animation is finished a boolean is set to true.At the same time an external swf is being loaded and also sets a boolean to true.If both booleans are true the externally loaded swf is displayed.

The loading works, the booleans work, everything works just fine except the animation when loader.load(content) is initiated. When I comment this line the animation works and offcourse nothing is loaded. When this line uncommented the animation won't work (visibly) but the swf gets loaded and displayed...

View 11 Replies

C# :: Show Progress Messages In Flex From Initiated Batch Process?

Sep 29, 2009

I have Flex call a C# dll which starts a long batch process (10 minutes). This process is actually a PERL program which periodically outputs progress messages. I want to be able to stream these messages back to a text area in Flex.

View 1 Replies

Flash :: System.setClipboard In Event Initiated By User Click

Apr 9, 2011

I unserstand security restrictions about working with clipboard. The user must do an action then clipboard may be written.

But what if on mouseclick i have to load some text from server using URLRequest and copy obtained data to clipboard?

Like this:

protected function clickHandler(e:MouseEvent):void
{
this.fileReference = new FileReference();
this.fileReference.addEventListener(Event.SELECT, this.fileSelectHandler);

[Code]....

View 2 Replies

ActionScript 3.0 :: Date And Time - Play On The First Day The Screen Saver Is Initiated

Mar 20, 2009

I have 5 movieclips:

day1_mc
day2_mc
day3_mc
day4_mc
day5_mc

I'm creating a screen saver where day1_mc will play on the first day the screen saver is initiated , then day2_mc will play at 12:00am on the 2nd day, then day3_mc will play on the start of the next day at 12:00 am and so forth until the 5 day cycle is up, it will loop back to day1_mc.

View 3 Replies

ActionScript 3.0 :: Use ALT Key Combination (ex: ALT + A ...) ?

Jul 24, 2009

I have used a trick which has worked fine so far in our company's project.here how it works:
 
NOTE:
 
If you want to use AS1, ignore my soloution and just use isDown("18") with combination of othjer keys.

if you want to use AS2, you can not use isDown("18") in AS2.

if you want to use AS3 read the following:
 
1) Trap Alt keys using .isDown("18") in a SWF published as ActionScript 1.0;

3) In a SWF (AS 1.0) defined your keys like (All the letters you need, ex: A,B,...) with combination with Alt

4) Create a SWF published as Action Script 3.0.

5) Create an instance of the  Local Connection Class available in SWF(AS 3.0)

6) Create an instance of the  Local Connection Class available in SWF (AS1.0)

7) Talk between AS1 and AS3 using the local connection 
 
 NOTE: In order for your key combination to happen only once but not continusly, you need to do a trick like the following: THIS IS Action Script 1.0 SWF

stop();
 
var lastKey            = 0; var keyListener      = new Object(); var sending_lc       = new LocalConnection(); var resetFromAS3  = new LocalConnection();[code].........

View 3 Replies

Video And Slideshow Combination?

Oct 5, 2009

I need to create a flash file with video but at specific frames/times in the video I need an image to appear next to the video. This is the result of a research conference where the speakers were filmed as they talked through their presentation. The flash file needs to show this video alongside the slides from the speakers powerpoint presentation.

I already have the video converted using the media encoder and the slides from powerpoint converted to jpegs.I just need to know how I select a time/frame in the video and presumable generate some actionscript code to load an image at that playback time in the flash file.
 
A rather clunky version of what I am trying to di can be found at: http:[url]....

View 2 Replies

ActionScript 2.0 :: Player XML Combination?

Dec 15, 2011

Attached is a fla and it requires one xml file to load but the same has been missing. The name o the xml is playlist.xml. how the xml file to be write so that the player easily load the data from xml and will display

View 5 Replies

Professional :: Random Name Combination Generator?

Feb 19, 2010

I am currently putting together a simple game where people have to pass my tests to join a club. At the end I would like them to be given a unique name. I imagine this could be done if I make 3 lists of 50 words, and right a piece of code that randomly selects one word from each list to create a unique combination almost every time. I am using actionscript 2 because I am fairly novice and this is about as complicated as my code is going to be, but is this to bigger job for action script 2?

View 4 Replies

Flash :: Professional - Rhinoceros 4.0 In Combination

Oct 18, 2011

I would like to build a website in flash and use 3D models that I have made in Rhinoceros 4.0. Is it possible somehow to import Rhino 3D models into flash?

View 2 Replies

ActionScript 2.0 :: Key Combination Using Class From MichaelxxOA - ALT Key

Mar 22, 2007

I was using the class from Michael there nice class btw I was wondering is it possible to use the ALT key in flash for trigger events? I tried using the class from Michael but didnt work for me or maybe I was doing something wrong. When I tried when this class it open the menu on top of the flash player or html page.

View 2 Replies

ActionScript 3.0 :: Why Doesn't The Keyboard Combination Work

Feb 4, 2009

Im in the very start of trying to make a little game. he problem is when you hold down the up arrow(speed) + left arrow(left turn) + space bar(brake). But the same combination, just changing the left turn with a right turn(right arrow), that works. he code is boat badly written and partly in Norwegian, sorry, but here it is:

Code:
package {
import flash.display.*;

[code].....

View 5 Replies

ActionScript 3.0 :: Boolean Tests Combination Of Values

Nov 12, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations. Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 5 Replies

ActionScript 2.0 :: Detect When Keys Are Pressed In Combination?

Aug 15, 2006

I've followed the thread there: [URL]

I understand that this class allow the script to detect when keys are pressed in combination.

But what is exactly the implementation when a key is used both in single and combination states. Let's say that you've the "q" key used alone and "shift-q"...how would one proceed to achieve this detection?

View 2 Replies

ActionScript 3.0 :: Boolean That Tests Combination Of Values?

Nov 11, 2011

The objective is when user clicks on any combination of 2 buttons you would then gotoAndPlay a new page based onthe two specific buttons you have selected? Ideally user would be able to intermix the button combinations.

I've attached a simple diagram that visually explains objective of actionscript.

Code below only works for two specific buttons, but doesn't allow to intermix button clicks.

[Code]...

View 4 Replies

Flex 3 - Key Press Combination To Trigger An Event/function?

Jun 1, 2011

Within a specific canvas, I would like a user to be able to press a combination of keys which will trigger an event.(a bit like a cheat in an old megadrive game). Not sure where to start though. Anyone know if it is possible and if so could you give me a clue with how to start?

View 2 Replies

ActionScript 3.0 :: Capturing Keyboard Input For Specific Key Combination's?

Jun 15, 2010

capturing any of the keyboard combinations below in the Flash Player. I am building this as a stand alone .swf file, so there won't be any conflicts with a internet browser, though my concern is reserved operating system shortcut keys.

F3
Press
Alt + X
Alt + X + .

[code]....

View 1 Replies

ActionScript 2.0 :: Determining If Data Is A Number Or Word Combination?

Aug 4, 2002

I am running an if statement to determing whether the data entered by a user is a number or a combination of letters and/or numbers. How could I determine whether the data is just numbers? Like:

PHP Code:

if (textbox == notanumber) {
do something


I have tried using NaN and "undefined" without much success.

View 7 Replies

ActionScript 2.0 :: Call A Functionname That Is A Combination Of A Variable And Set Text?

Aug 13, 2007

I have a variable in the _root called section.Now I want to call hemmaAnimation(); within a the global function (see below).So I set the section variable to hemma & tried these:

_global.sectionAnimation = function(){
this[section+"Animation"]();
};

[code]...

but no luck.

View 1 Replies

ActionScript 3.0 :: Flash BitmapData In Combination With AddChild Animation

Mar 29, 2011

I've created a fly in of 40 boxes which will form a block of 800x500 with a picture in it. On my site [URL] I've actually done the background image with 40 actual 100x100 pictures cut out of the original image. Then (on these forums) I learned how to cut up an image using bitmapData. To have dynamic backgrounds I would like to figure out how to combine these two.

Code:
//Import of greensock TweenLite
import com.greensock.*;
import com.greensock.easing.*;

[Code]....

View 7 Replies

ActionScript 2.0 :: Combination - Copy/Drag&Drop/Delete And MC Count?

Jun 21, 2003

I have a movie clip = circle

When the user clicks the circle I want the user to be able to drag and drop a new instance ie circle1.This whole process needs to be repeatable.......ie next time user clicks the original circle ie circle the code must know the last instance number ie circle1 exists and when the user clicks circle that circle2 is created dragged and dropped.....so on and so on.

This is easy you may say - duplicatemovie and startdrag etc........the problem is that when the user clicks on the original circle the mouse focus is on the original circle and not the new instance just created ie circle1 which then needs to be dragged and dropped.Just to complicate things the user needs to be able to delete a circle at any time by using the keyboard 'del' key.

View 14 Replies

ActionScript 2.0 :: Change An Action From A Button Click To A Frame-based Action

Oct 2, 2006

Code:
_root.navigationMC.onPress = function() {
startPreload("blue.swf");
}

If I wanted to change an action from a button click to a frame-based action, what do I use instead of onPress? The hints from the AS editor are all click-based.

View 1 Replies

ActionScript 2.0 :: Incorporate A Stop Action, After A GotoandPlay Action On My Button?

May 8, 2009

I have a slideshow that is looped ... it contains 5 slides.I am using a gotoandPlay action to control the slide show.

on (release) {
this._parent.gotoAndPlay("98");
}

There is a fade transition between slides.When a button is released ... I want to gotoandPlay (frame 98) ... and then have it stop 10 frames later on (frame 108). Frame 98 includes the transition ... if I just gotoandStop on frame 108 ... I loose the transition.Is there any way to incorporate a stop action, after a gotoandPlay action on my button ... without naming instances etc.I.E.

on (release) {
this._parent.gotoAndPlay("98");
STOP ON FRAME 108 INTEGRATED HERE
}

Everything I have attempted is not working.

View 1 Replies

Click On The Button Action And It Animates But No Action Event In The Trace?

May 23, 2009

I just want to make a simple button action using actionscript 2 but I can't get it to work! I'm sorry for even asking but I've been at this for too long now for it to not work I'm using Adobe Flash CS4 and I do the following --

File -> New Flash File (ActionScript 2.0)
Insert -> New Symbol
Name - test
Type - button
Export for ActionScript
Identifier - test

And then draw it in using the keyframes and add the code to 'Actions - Button' for my button

Code:
on(release) {
trace("trace");
}

I click on the button and it animates but no action event in the trace?

View 3 Replies

Flex :: Fill A List With A Combination Of Database Entries And Meta-values?

Aug 31, 2009

I am acquiring the contents of a table to fill a dropdown box in a Flex 3 application:

<mx:ComboBox dataSource="{myList}" />

The list is populated by the contents of a database table of persons:

Public, John Q
Doe, Jane
...

The combo box, however, also needs to have some other meta-entries in it that do not come from the database:

ALL
ALL MEN
ALL WOMEN
Public, John Q
Doe, Jane
...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved