ActionScript 1/2 :: Flash Player 8 & Selection Class (overall Not Working Via Code)
Jun 21, 2011
I have a simple input box with an on-screen keyboard. When I type into the box using the on-screen keyboard (adding characters to the box programatically) the Selection class overall isn't letting me control the input.I'm assuming this is a scope issue of some sort. The input belongs to one class while the onscreen keyboard belongs to another.Is the Selection glass global or is it class-scoped? Even when I pass a reference from one class to another and request Selection.getCaratIndex() from the class that generated the input it continually returns -1 which is not correct.The kicker is I can make a new AS2 document, put an input box on the screen, add text to it (all programmatically), Selection.setFocus() the input, run Selection.setSelection() to the last index of the input and Selection.getCaratIndex() returns the valid number. So there's something funky going on when classes are involved.
The only way the Selection class is working is if I use a real keyboard or mouse click, then it works fine. This isn't very useful in an on-screen keyboard context however.Are there any mines I should avoid when using the Selection class in an application where multiple other classes are involved? Is Selection really global or should I worry about scope with it?
View 3 Replies
Similar Posts:
Mar 16, 2009
I would like to know how the following ActionScript, that only works in Flash Player 6, can be updated to work in a Flash Player 10 file.[URL]As it says, "On Publish Settings set Flash Player version on Flash Player 6, or this movie will not work."It works fine published as FP6 but not as FP10 as I need it to be. This AS is added to a movie symbol that contains a button for a rotating menu effect.
onClipEvent (load) {
hx = 300/2;
hy = 400/2;
r = 100;
[code]....
View 3 Replies
Nov 15, 2010
I've been really frustrated with the code hinting in CS5. It doesn't seem to work like it should. It appears to work fine if I am placing the code on the timeline, but if I create a class file I lose the class code hinting even for simple types like Boolean. The other thing I noticed is after the class file has been created even if I go back to the code on the timeline it has now lost code hinting. The only way to get them back is to close the fla I was working and close flash itself.how to resolve this or is this a legitimate bug? If others have seen this happen please post so that we can get some attention brought to this. It seems to work fine if you create flex components and then edit them in Flash Builder.
View 5 Replies
Apr 29, 2010
I have a slight problem when publishing to Flash Player 7 but works perfectly in Flash Player 6, below is the code:[code]In short this creates a list where the values are kept in SharedObject.I need to use a WebService so I require Flash Player 7, as I said this works as expected in Flash Player 6, so maybe someone may know a pitfall or two when migrating code form 6 to 7?
View 1 Replies
Jul 1, 2007
I'm pretty new to Action script and I have a problem here that I can't seem to figure out.
I have this Action Script Code which is attached to a simple movieclip, and it all works IF the general settings are set for Flash Player 6.
It does not work for Flash Player 7 or above, which is probably because this is Actions Script 1 Code...
I attached the .fla file and also here's the code:
[Code]...
View 2 Replies
Oct 14, 2010
I have developed a player in AS3. It is working if i provide the IP of the website. But, it is not working when i provide the full domain name. Even, i provide the crossdomain.xml for global access.
View 1 Replies
Mar 27, 2011
Got to the point where the hole in my AS3 knowledge is getting large!Realising I have confusion about the relationship of:Body of code on first frame of AS3 file.(Which I have so far used to create instances of library objects using addchild and make calls to class code).Is this code called the document code? What do people call it?Numerous classes linked together by extending each other etc.Library objects (usually graphical objects)Should it be done differently? have the following problems due to lack of understanding:Addchild complicated from a class but straight forward in main body code.Cant call functions on the main body code from classes, because class code does not know the main body code exists?
View 1 Replies
May 8, 2011
I am trying to put together a simple game and have been doing really well until I decided I am going to have to create a new class to handle enemies.What I have so far is a player walking around on random terrains and I am up to the point where I have placed x amount of enemies on stage at appropriate times. I have written their class which will hopefully eventually handle their behavior and it outputs simple trace("BOO!").
Where I face the problem is that I obviously would like to make these enemies follow the player to attack. But when I try to access the .x or .y attributes of the player, it throws an error: 'call to a possibly undefined property with static type Class'?I have tried accessing the .x using the following ways (where badger is my player instance and Main is my class definition within the properties of the FLA):
Main.badger.x
Main(root).badger.x
Stage.badger.x
I have also tried to access other vars and still nope..My class code is this:
Code:
package
{
import flash.display.MovieClip
import flash.display.Stage
[code]....
View 1 Replies
Jul 22, 2006
So this is a bit of an unusual problem. I am building an XML based MP3 player. I'm fairly inexperienced with Actionscript, so I copied the code from a friends music player. The code works great - but the player I am making also has 'highlightable' buttons for each song. It is easy enough to get these buttons to highlight when clicked. However, when first opening the player, it opens a song randomly but obviously the song's button is not highlighted. Is there a way to have the player highlight the corresponding button when opening? The cop-out solution would be to just have it open the first song every time. But the random selection could really make returning to the site a new experience.
[Code]....
View 3 Replies
Jan 29, 2009
I've looked this up online under all kinds of criteria, and I can't seem to get any examples to work.I'm trying to get Flash (AS2) to select all of the text in a dynamic text field once the user focuses on that text field. Below is an example of the code:
ActionScript Code:
import mx.utils.Delegate;
class Embed extends MovieClip
[code]....
View 1 Replies
Jan 6, 2011
Here is code for drag. i want to change as3 class to normal code as3
View 6 Replies
Nov 26, 2011
so here is the problem that I have so far. I tried to simplify my code so I can attempt to figure this out, but I have had absolutely no luck. I have a viewstack that contains 1 dropdown per stack. They share the same data provider. What I want to do is to select the item contents from the first one. Once I do that, when I click a button to the next stack I have a function that searches from index 0 to the dataprovider length and if the item from the first stack matches the second one, I want to have the second dropdown pick that item up and display it. I have it matching, and I try to select it, but when I run the application it shows up like nothing is selected. Here is what I have:
edit: I got it to work for a simple example, but when I attempt to use it in my more complicated example, on that button click it for some reason resets the value of selectedIndex to -1. How do I prevent this from happening? This is working code for the simple example
[Code]...
View 1 Replies
Dec 27, 2010
Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?
View 7 Replies
Oct 14, 2011
I have an Actionscript coded flash file which run perfectly without any error. I am not getting why it shows an error after i do insert a scene before or a frame before the current frames;
[Code]...
View 1 Replies
May 27, 2009
Is it possible to paste a video player's code from a website in flash?
View 7 Replies
Feb 29, 2012
Every time I run this code my flash player (projector) is crashing.
function ftwoB(event:MouseEvent) {
navigateToURL(new URLRequest("lessons/lesson2/reading"));
}
[code]....
View 9 Replies
Jun 21, 2010
im trying to make a tile map. is there a code for Flash Player 10 to Duplicate an DisplayObject?
View 4 Replies
Jul 7, 2005
I am trying to get my mc to move up and have copies of that same mc follow about every 40 pixels. Basically a scroll with my "8ball" mc. Showing the mc every 30 pixels in the y-direction. I am using this code in the mc and I get a message saying that the script is causing Flash Player to run slowly.[code]
View 1 Replies
Jun 22, 2011
I have an ancient project that has thousands of lines of AS2 code spread out in class files. I started to try to make an on-screen keyboard and I noticed an issue with FP8 and the Selection class. I need to use FP8 because it's a MDM Zinc extended project and Zinc does not allow me to export to FP9 or FP10 if I use AS2.0. Of course this issue doesn't happen in FP9 or FP10.I have a reproducible example here that's highly simplified and stripped down. It has 3 class files, a Main, ExampleKeyboard and ExampleOutput. Main just instantiates the other 2 classes. The keyboard is all of 3 buttons (again very simplified to stick to the point). The output just generates an input TextField. This issue seems to be isolated to using the Selection class when your project has other classes. For mine, the keyboard is in one class and the TextField is drawn in another. I did a single frame no-class example and this problem does not exist so it's specific to the Selection methods using FP8 when a project contains classes. URL...After you run it you MUST press the red button to Selection.setFocus() the input field. The other 2 gray buttons simply send the letters 'a' and 'b' to the input text field. In FP9 and FP10 this all works just fine. The Selection. getCaratIndex() reports the cursors proper position (which I set every time you press a button). In FP8 you will see that Selection.getCaratIndex() ALWAYS returns -1. Has anyone had these Selection class issues in a project that used multiple classes and FP8?
View 1 Replies
Jul 28, 2010
I made a flash website, which is aflash movie. How can i add an html code to this movie or websiteinside flash adobe cs3 in the fla file?????
View 1 Replies
Feb 17, 2011
I actually have two websites on the same domain. say, for example[URL]..flashsite contain the website that is fully flash based while the other is an html based with no flash. what i want is that, if somebody visits my url on [URL]..the javascript should first detect if the plugin is installed in his browser. if yes, then it should take me directly to the "flashsite" folder, and if not, then it should, by default, load the html website.
View 2 Replies
Nov 16, 2009
I've put together this interactive swf file which contains this code
var myMic:Microphone = Microphone.getMicrophone();
myMic = Microphone.getMicrophone();
Security.showSettings();[code]....
however, the Adobe Flash Player Settings box keeps appearing when I export the file to view the movie. When you try closing it however the movie doesn't react to sound. I've tried taking out pieces of code to see which is calling the box up but it wither stays up or the movie doesn't function properly.
View 5 Replies
Mar 7, 2012
I am working on a game. All behavior was as expected, and I got no crashes when testing on my machine using FlashDevelop and the Flash Player. But if I open the .swf in Chrome directly or through the Kongregate test area, the game crashes 100% of the time that that function is called.
[Code]...
The selectDebater function is not new, and has never had a problem.
View 6 Replies
Aug 27, 2009
I have this code creates a function at runtime (yes, this IS needed):
PHP Code:
var createdFunction = function():void {
trace("Function Created");
}
createdFunction();
Putting in in to the actions panel in Flash CS4 and compiling works fine, tracing the message "Function Created"...However, the Flex compiler gives me this
Quote:
Error: Call to a possibly undefined method createdFunction.
createdFunction();
Build halted with errors (fcsh).
View 2 Replies
Oct 17, 2010
code hinting doesn't seem to work for my Flash CS5. I already tried increasing the code hint cache size, but it still doesn't do anything.
View 3 Replies
Apr 6, 2011
Flash player not working in firefox (centos 5.5 x64) that run with selenium under XVFB. I'm getting just black screen in place where flash should be visible.
Tried both 32 and 64 versions.
View 1 Replies
Jan 18, 2011
We run surf camera streams on our website, which are played via the latest version (5.4) of JWPlayer on our pages. Recently we switched over to another streaming service, and H.264 streams, as we are planning on streaming out to iOS devices in the very near future, however this introduced a bug on the client side where users to not receive vision (they only see a black screen where the video is normally seen).
We have discovered that disabling the Hardware Acceleration (which was introduced in Flash Player 10.1+) fixes this issue, and given the spectrum of environments where this issues is happening I would wager that this is related to specific graphics cards, their drivers, and how they handle the vision decoding etc.
The documentation we have found relating to disabling Hardware Acceleration only indicate that this can be done via the wmode param, i.e. by setting it to wmode="opaque" or wmode="transparent" however this doesn't seem to work in all cases (for the most part the issue is no longer there) however we are still seeing 30% of our users getting this issue.
We can ask the users to disable hardware acceleration themselves, and we have provided details on how to do this, however to me that is only a temporary fix, and I was curious as to whether or not there was something more permanent we can put in until Adobe fix up this issue?
View 1 Replies
Aug 2, 2010
My Flash Cs5 I was Update..update say : version 11.0.1 but i view About flash : 11.0.0.485 and when I write some code : Code hint not working??
View 2 Replies
Nov 3, 2011
I am trying to embed a facebook video on my website but it gives "Video Unavailable. this video has either has been removed from facebook or is not visible".video is public to everyone, is not deleted and I can watch it on facebook via other browsers that I am not logged in. I tried both below embed codes, neither is worked.
<object width="500" height="300">
<param name="movie" value="http://www.facebook.com/v/VIDEO_ID"></param>
<param name="allowFullScreen" value="true"></param>[code].....
View 1 Replies
May 3, 2009
I have an Apple iSight webcam and it's not working with Flash.I go into the Flash player settings and select my camera, I can see my image and camera working inside the little box in the Flash playser settings panel.But when I close the settings and "allow" the site to access my webcam it doesn't work.My camera just shuts off.It's been a while but my camera use to work with Flash, and my iSight camera works with other apps such as Skype.URL...
View 6 Replies