Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




How To Generate A Keboard Event?



I need to make my application more accessible to keyboard only users. This requires me to add an eventlistener for keyboard activity and filter the TAB key. I wish to issue a keyboard event for the ENTER key when the TAB key is pressed by the user. How can I generate the ENTER key please?



Adobe > Flash General Discussion
Posted on: 05/26/2007 11:53:00 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Generate An Event
Hey all,

Does anybody know if there is any way to generate an event, say for a movie clip. An example would be to make a movie clip believe it's been dragged over.

I want to do this because I want my movie clip to do the same thing onRollOut and onDragOut.

I understand that I can just put the same code in, no problem, I dont have to bother with any of this generating an event stuff, but I'm at the final stages of a project and we're trying to cut back on the size of the file. Every little bit counts, so I'm seeing if there is a way to generated this event and cut back on a lot of coding that would otherwise be compiled and add to the file size.

Thanks!
feigner

Generate An Event
Hi all,
I have a class that has a function that takes time to perform.
This function reads data from a text file into an array.
I need to notify the caller when the data is actually read so he may use another class member function to get them.
Please give me a general guideline on what should I use (I am new to flash).

Adding Multiple Event Listeners To The ENTER_FRAME Event, Calling Different Functions
Is this going to slow my program down, or do all the references to these functions get added to a master ENTER_FRAME. I am trying to efficiently do this

MovieClipLoader OnLoadInit Event AND Loader Component Complete Event
What´s the difference beetwen the Loader complete event and MovieClipLoader onLoadInit. The manual says onLoadInit is called after the code on the first frame of the loaded clip gets executed, so, it´s better to use onLoadInit if you want to manipulate the loaded asset via code.

So, if anyone could clarify the following points to me, I would be grateful!

- Does the complete event of the Loader component have the same behaviour?
- How does MovieClipLoader knows that the code on the first frame of the loaded assets got executed?

Thanks,

Marcelo.

Custom Event Handlers - Triggering Event Listeners On Other Objects
I'm trying to update an object whenever something happens in another object. At the moment, I have the second object explicitly calling an update function on the first object, but this seems a little sloppy and it strikes me that this is the sort of scenario where I should be using custom event handlers.

I'm not quite sure how they work though. My first assumption is that if I built two objects, one like this which fires off an event:


Code:
public class eventFirer extends Sprite
{

public function eventFirer():void
{
dispatchEvent(new Event("customEvent"));
}
}
...and one like this which updates whenever the custom event happens:


Code:
public class eventListener extends Sprite
{

public function eventListener():void
{
trace ("main");
addEventListener("customEvent", eventFired);
}

private function eventFired(e:Event):void
{
trace ("ok");
}
}
...then eventListener.eventFired would automatically be set off whenever a new eventFirer is created. This seems not to be the case though.

Can anybody enlighten me as to how custom events bubble between otherwise unrelated objects?

Setting Up An Event Listener To Listen For An Event Inside Of Another Movieclip.
I'm trying to set up an event listener on the stage that will listen for a mouseEvent.CLICK on a certain button inside a movieclip on the stage, but i cant seem to figure out how to target that specific button. Any help would be greatly appreciated.

Generate Swf With Asp
Do have ASP a module that generate swf in execution time like PHP?
Someone knows a tutorial?

SWF Generate SWF
hi, can some one guide me how to use a SWF_A Generator to generate another SWF_B?

E.g
SWF_A(generator) can put in picture, description and press GENERATE, then SWF_B is jz the image player, where pressing button inside can view picture file record "added" from SWF_A

Thanks

Can Anyone Generate This?
I am trying to make a encryption program and am new with action script..

I need a input box were the user will enter their name and then a dynamic output box to display it in a encrypted form by doing the following claculations on it?

After user enteres their name i need it do do the following:

1) generate two large prime numbers p and q

2) let n=pq

3) let m= (p-1)*(q-1)

4) choose a small number e, to coprime or mod to m

5)find d, such that de%m

6)publish e and n as the public key, and also publish d and n (so i guess i will need 2 output boxes?

I would appreciate any help as i dont know where to start?
thanks

Generate A Pdf From An Swf
I need to create an swf for a website where the user can manipulate the contents (the easy part) then be able to save the visual state of the swf as a vector pdf on their own computer. Is that second part possible?

SWF Generate
Hi,

Can any one tell, How can we generate swf. Which technology is useful for generate(export) swfs. Plz help me on this.


Thanks in advance..

Passing Parameters From Event Listener To Event Handler
Hi Chaps,

First of all, apologies as I know this question has been asked before, but I have spent the last twenty minutes reading this thread and still can't seem to figure out how to apply it to my situation - probably because I'm thick!

I have a number of objects which need to be rotated according to different parameters. I have a function which takes those parameters, then uses the tween class to handle the rotation. I'm then using the tweenEvent class to check for when the motion is complete. Then, I need access to those same parameters in the complete handler to do further operations. The problem I have is that the tween event class doesn't allow me to pass the parameters along to the cpmpleteHandler, so I'm stuck getting my parameters from the first function to the second function:


Code:
function rotate(parameters){

rotationTween = new Tween(object,parameter1,parameter2,........);

rotationTween.addEventListener(TweenEvent.MOTION_FINISH,completeHandler);

}

function completeHandler(e:TweenEvent){

//need access to the paremeters passed into the first function here!!

}
From reading the thread mentioned above, I have a feeling I may need a custom class to do this - please don't laugh but I've never written (or had the need to) write my own class before, so I really wouldn't know what to do. Any help greatly appreciated, but an actual code snippet which demonstrates this would be even better!

Ric.

Event Listener Mouse Event Click - Obstructions
This is an oversimplification of my problem.

I have an event listener on a sprite.
I then have portions of this sprite covered with other sprites or moveclips.

If I click a movieclip, it blocks my eventlistener on the sprite underneath it.

Is it possible to listen to the even click 'through' a movieclip. I dont want interaction with them, but I dont want them as bitmap data onto the base sprite either...

I Don't Understand The Keywords: This, Event.target, Event.currentTarget
I am almost a complete beginner to Actionscript 3.0.
I've been looking at tutorials and I now understand most of the basic principles and methods of this programing language (creating basic functions ect..).

However I do not understand the following keywords.

1. this
2. event.target
3. event.currentTarget

What do these words refer to?
How are they different from each-other?
When must i use them?

Event Propagation Vs. Event Blocking -- Confused, Even After Moock
I thought I understood the AS3 event scheme: capture, target, bubbling. That events (e.g. MouseEvents) travel from stage to the object clicked on and then back again, and all objects in the display chain receive and can check that event. But it's also true, it seems, that Interactive Objects in front of others will block and "absorb" events, and those beneath will never hear of the event (unless mouseEnabled for the blocking object is set to false). I don't understand this (seeming) contradiction.

On the Kirupa forums:

Along with event propagation in ActionScript 3 comes different phases of events with display objects. With propagation, you have events being propagated from display objects to other display objects, such as mouse click events being propagated from children to their parents. This lets clicks within children objects to be recognized by parents (since children make up the contents of their parents, its only natural for the parent to also have those same events). The phases of such an event represent the progression of the event as it makes its way through the parent and child objects.

Events actually start with parent objects (phase 1: capturing), starting with the top most parent (stage) and making its way down to the child where the event originated (phase 2: at target). Then after reaching the child it makes its way back up through all the parents again (phase 3: bubbling).

But also:

Though ActionScript 3 now supports event propagation (capturing, bubbling, etc). Events like mouse events still only occur for one specific target for each individual event. In other words, when you click the mouse button over some objects in a Flash movie, only one of those objects is going to recieve the event even though the mouse is physically over other objects as well.…One important thing to keep in mind is that, in ActionScript 3, mouseEnabled is true by default. This means, without any event handlers or listeners used in a movie, every InteractiveObject instance will capture mouse events and prevent them from reaching any other objects beneath them.

Any clarification much appreciated…

Help Generate Menu
Hi there,

Is there anyone on this board who has some code or some input/information to create a menu in actionscript?

The menu we have created at http://neutral.mrmedia.nl is not automated...

Is there anyone who can give me some tutoring?

Regards,

Jurgen

How To Generate A Delay
How can i generate a delay inside my action script
Something like this :

There is a script attached to some frame:

If (....)
{
Here delay have to appear
}

else gotoAndPlay(...);



Thank you

Eldar52

How To Generate A Doubleclick
I need a doubleklick for an swf(flash 5).
Is here anyone who know how to generate it?
May be: do you have a script?

thanx for help!

Generate Swf From Swf? Cms Style
generate swf from swf? cms style
I created a slideshow, and what I want is CMS functionality, so user can select say frames 1,5,34,56 (tick box on frame), and then they can make a new swf with only those frames.(from a button generate swf)

Is this possible?

Cheers

Maria
generate swf from swf? cms style

Generate Swf From Swf? Cms Style
Generate swf from swf? cms style

I created a slideshow, and what I want is CMS functionality, so user can select say frames 1,5,34,56 (tick box on frame), and then they can make a new swf with only those frames.(from a button generate swf)

Is this possible?

Cheers

Maria

Swf Generate Jpeg
Is there a way to make a server side swf file render a jpeg.
I want to create a dynamic jpeg from a swf movie?

Any ideas?

Thanks

Generate Swf Dynamically....? Help
Hi,

Let's say I have a swf-file and 4 jpegs. The 4 jpegs are loaded into the swf with a loadmovie-command.

Each day the 4 jpeg change. So everyday different images will be displayed in the flash.

So far so good, but..... This doesn't work if somebody has a flash5 player installed.

Is there some possibility to dynamically generate the swf-file with the 4 jpeg in the movie so I don't have to load them externally?

I thought this could be done with Generator, but it doesn't really excist anymore, does it?

Is there another way to solve this problem??

Thanks in advance!

Ranomly Generate +/-
Anyone know a way to randomly generate positve and negative numbers?

This works ... but its so cumbersome!

PM_Array = [0,-1, 1];
PM = _root.PM_Array[(Math.round(Math.random()+1))];

... then the var PM becomes my "+/- wild card" that I use to turn numbers + or -

at the very least is there a better way to do this:
(Math.round(Math.random()+1)) just to get a random whole number. Its so much longer than the old style random(2)

Can We Generate Log Files?
Hi,

Can we generate log files by using through flash.

Thanx.

Can We Generate Log Files?
Hi,

Can we generate log files by using through flash.

Thanx.

How Can I Generate A .txt File?
i need to create a text file from a flash site, can anyone help me out please!!

How To Generate A Shadow
Hello,

I want to create a ball that drops and hits a flat surface, and was wondering if anyone knew of some good tutorials to show an animating shadow that reflects the movement and positioning of the ball as it drops.

Thanks!

I Want To Generate A Jpeg With A Swf
I've seen a swf where you build a graphic out of separate elements, and then when you're done, it generates a jpeg of your graphic and displays it in a separate browser window. I know an external php file is required to do this.

Does anybody know where I might find a tutorial on how to do this?

Thanks for any info!

-Glenn-

Generate Flash From Xml
hi ...

need a small help..i want to know how to gather input from a flash and save a all new flash fil at run time ( dynamically)

am doing a courseware for students..whereby the xml with xourse contents and the basic flash template are kept at the server side.

when the user access the flash file to view the course content, a new flash file with all the xml contents embeeded gets downloaded to the client side.....

is this possible do let me know

Generate Img Files From My Swf
hi,
i wonder if is it possible to generate a img file (like jpg) from my swf movie. like a print screen image... but that is generated by a button and an action script code in the swf.

what i want is that i make a draw in swf (like a mchine draw) and then i make a jpg or another swf file from the finished draw.

can you understand what i want?

thaks

How Do I Generate A Random Num From 1 - 5?
hi all,

i have a simple problem that i cant work out.

how do i generate a random number from 1 to 5?

cos the way i do it i always get a 0 (zero) in the result.

thanks

Generate Unique Id
i am trying to create some user
colour background preferences in a flash file,
and store them on a server.
so everytime they come back to the flash site
on their initial set up,
flash reads the settings from the server and
sets the flash colour background according to
the preferences.
quite like a cookie in html.

so somehow i need to create a unique id on every set up.
the easiest would be to get people to register and send
them an id back from php.
but i don't want them to have to register.

so i wondered, is there a way to create a unique id
from whithin flash, based on the system id, os or similar?

i had a lood at 'System.capabilities.version' etc,
but none of those options seem to return a unique id.

anyone any ideas?

Generate JPEG From A SWF?
I have a simple Flash application where the users are to customize a screen and instead of printing, we need it to generate a JPEG image of the screen.

Is this possible with Flash alone? If not what sort of middleware would we use to do this?

Thanks in advance!

How To Generate A .SWF File
Hi guys.
I need some help with flash as i am a beginner in flash-zone.
I just started working for a new 'project' .Some guys have programmed a Java Editor to create simple Animations.
The editor (animation builder ) generates a simple script file (.lwb file a simple text file) The animation player reads this script (.lwb) and shows the animation
Now... What i want to do is to generate a .SWF file with the same animation .
So .. reading and parsing the (.lwb) script (and maybe using java programming , the only one know ), i want to generate a correspondent .SWF file

Do you think it's possible ? Where do i have to start from ?

Someone told me to do a kind of 'FLASH plug-in' that can read the .lwb scripts and export the .swf file
What about this ?

have a look at the player , builder and some sample .lwb scripts

i hope somebody has a cool idea, and help me . Thank you

Generate Random Key
I'm trying to generate a random key string

something like this

adfkj4462AJFdkjad44yjJ

it can only have a-z, A-Z, 0-9

i want it to work like this...


ActionScript Code:
myKey = generateAlphaNumKey(10);

and it might print out something like this
dj576JSjk6

the number inside the () is for how many chars will be in the string...

i don't know where to start though...

please help!

C++ API To Generate SWF Files
I have C++ application which should generate presentation in Flash. It should allows me to embed video data and play it as well. I know about libming and sswf libraries but they don't look very functional. Any comments?

Best Way To Generate Swf Files
I am looking for an automated/command line means of generating .swf files for the media files I have in my application. At any given time there could be hundreds of videos in the directory and the application lets users upload media to the server.

I know how to create .fla, .as files etc for one file using CS3, but I am hope there is an easier way to generate these swf files.

I am looking at Flex SDK (specifically mxmlc) to write a cron job, but I wanted to see if people use other methods.

Thanks in advance

Using Php To Generate Xml Links.....
Hi all,

Has anyone built the system on flash that uses php and rss to automatically generate news flash links on flash? I need some good advice.

How Do You Generate Random.....
How do you generate random battles for rpgs? I don't have the slightest idea where to begin? Would it be easier with tiles, or without?

Please let me know. Again, I don't have a clue where to begin.

Thank you

Generate PDF From Flash
Hello!

I have an SWF file that collects a bunch of variables (e.g. users' name, age, sex, phone number, etcetera).

Is there a way for me to generate a PDF with the data collected? I cannot use any web programming language such as PHP or ColdFusion because the computer that will run the SWF is not connected to the web and I can't install a server in it.

Alternatively, the data collected is saved in an Access database, so there's the option to generate the PDF from that database. Can that be done if it is impossible to generate the PDF from Flash?

Thank you very much for the help,

Joao

Using ASP To Generate A List..
Okay, so I have a basic search function, using an asp page but it returns the first matching result and that's it. What I ideally want is for the search to bring up a box with all matching results, and ideally to be able to click on the desired one to show the details.

Any ideas?

How To Generate A List.
hey i have a question about auto generating a list (loops?)

what i did was i created 3 questions, and according to the answers they created some variables, example: (not AS)

question1 = 3
question2 = 2
question3 = 2

the idea of these questions is to filter out a list of 100 results based on the answers.
let's say i've converted ALL the 100 results into a movie clip EACH

and each of the movie clip will have a AS like this:

list1.onEnterFrame = function(){
if(question1 !=3 && question2 !=2){
this.show = false
} else {
this.show = true
}

all the way to:

list100.onEnterFrame = function(){
if(question2 !=3 && question3 !=2){
this.show = false
} else {
this.show = true
}
}

note that the var after the "if" statement differs, hope you guys get the idea.

so finally the question , let's say after the 3 questions only 10 in the list will remain "this.show = true",
how do i make them come out as a list, meaning their position will be auto generated without leaving any space?

i really hope you guys get what i'm trying to express here, thanks///

Generate Multiple Mc's
hi haven't been busy with flash for a while, so i
thought i give it a go again.

i have a simple problem that i can't figure out,
i'm probably not seeing the whole picture...

here goes : i want to generate multiple mc's so
i use a for loop


ActionScript Code:
for (i = 1; i <= 10; i++){
    _root.createEmptyMovieClip(["mcPos_" + i], 1);
    _root["mcPos_" + i].attachMovie("mc1", ["mcGen_" + i], 1);
    _root["mcPos_" + i]._y = 20*i;
    _root["mcPos_" + i]._x = 20*i;
}


but i only see one mc? how come... if i look at
the objects i see that it generated mcPos_10,
but that's the only one i see.

thanks in advance

Generate JPG From My SWF Screen Using PHP
Hi,

I'm trying to build a flash avatar system which users can click and design their customized avatar and then by clicking a export button, a JPG screen shot of the generated file will be generated.

I have no clue what the PHP code should be! can anyone help or at least give me a link where I can read more about this?

I don't know the best way to code the flash part also. Maybe we can have an ID for each item used in the avator! OR maybe we can have it coded someway so that everything avaiable under a specefic area will be used for the generated file. I don't know if something like this is possible or not!

Any help is highly appriciated.

Regards,
Hadi

The Best Way To Trigger An Event After A Previous Event Has Played.
What would be the best way to trigger an event via button in one movie clip after another event in has played in a different movie clip.

1. Click button in scene 1 on main stage.
2. The background movie (movie2) should scroll the the designated posistion and stop.
3. Then the foreground layer (movie1) should side in over it after the background has scrolled and stop to display information.

Now if you click another button I would like the clip to do this:

1. The foreground layer (movie1) slides back out opposite as it came in.
2. And the the background (movie2) rotates to it's new posistion and stops.
3. The foreground layer slides in same as (movie1) only some other tab and stops.

I'm completely stumped how to do this any help would be greatly appreaciated.

I posted the file here:

http://www.jbowen.com/jbcspage.swf
and
http://www.jbowen.com/jbcspage.fla

If some one could help me out thanks maybe even take a look a the code in the fla document and repost it or explain.

Thanks.

Using An Event Listeners Function At Will - Event Dispatching?
Hi,

I have a event listener that turns a camera on and off according to how much motion there is:


ActionScript Code:
camera1 = Camera.getCamera(""+Number(aCameraComboBoxes[selComboBoxNum].selectedIndex-1));
aCameras[selComboBoxNum].addEventListener(ActivityEvent.ACTIVITY, activityHandler, false, 0, true);

private function activityHandler(event:ActivityEvent):void {
if(event.activating){
//camera is turning on
}else if (!event.activating){
//camera is turning off
}
}

All of this works but I need a way to rerun the addlistener's function without the camera actual turning on or off. Is there a way for me to use this function, and send it the variable it is looking for?

Thanks

Custom Event Handler For A Timer Event?
I understand how to create custom events in order to pass parameters to a function being called by an event listener. I can get this to work fine if the event is being dispatched within my own code. However, I don't get how to do this if the event is a built-in event being dispatched by a Flash object.

Specifically, I need to call a function and pass it parameters when a timer ends. I don't know how to change the information being sent by the Timer because it is a native Flash class rather than something I'm writing. Can someone please clarify how to do this?

Mouse Event, Event.target Vs Movieclip Name
Hi -

Can anyone help me with a mouse event issue, i'm truly baffled. There's a timer event that loads 4 movieclips (named 'serviceType'), each containing an instance of 2 objects (named 'btn' and 'thumbs'). When clicking on the MC (servicetype) it triggers a mouse event. I'm trying to reference child 'thumbs' of the serviceType MC but in the mouse event function, event.target traces no children, but serviceType traces the 2 children. BUT serviceType only refers to the last instance of serviceType that was loaded in the timer event. Why wouldn't event.target work??

Here's the code, and thanks for the help!!

ActionScript Code:
function loadServices(event:TimerEvent):void {
     count = event.target.currentCount -1;
     serviceType = new MovieClip;
     addChild(serviceType);
     btn = new Btn(serviceList, count);
     thumbs = new ThumbContainer(count);
     serviceType.addChild(btn);
     serviceType.addChild(thumbs);
     serviceType.addEventListener(MouseEvent.CLICK,loadThumbs);
}
           
function loadThumbs (event:MouseEvent):void {
     trace(serviceType.numChildren); /// Displays 2 (but refers to the last instance loaded)
     trace(event.target.numChildren);// Displays 0, why??
}

AS 3 Convert Button Event To Key Enter Event
I'm learning how to use regular expressions in ActionScript 3, and can get an input to be tested by regular expressions, and an answer delivered, if a button is clicked after text is entered.

But darn if I can figure how to code it so they just click the enter key after typing what they like. In the following code punk is a button, and there are two text fields, buzzo the input, and tester the answer to the input. The array questo contains the regular expressions, the array anso contains the responses.


I need code to replace the bottom line with a line that relates to key enter being typed. Thanks for any ideas.



Sally










Attach Code

function makeSense(event:MouseEvent):void
{
tester.text="";
var buzz:String = buzzo.text;
buzzo.text="";
for(i=0;i<questo.length;i++){
if(buzz.search(questo[i])!=-1){
tester.text=anso[i];
}
}
}

punk.addEventListener(MouseEvent.CLICK, makeSense);

Copyright © 2005-08 www.BigResource.com, All rights reserved