ActionScript 3.0 :: Force Flash Player To Lose Focus (probably By A Hack) Without Using ExternalInterface?
May 21, 2010
I need to be able to make the flash player lose focus to the browser by actionscript alone (when the user clicks a button) or whatever, but from within the flash player, not from the user actually clicking outside of the flash player.These are embedded flash files with allowScriptAccess="never", so I can not use ExternalInterface at all to call browser js to window.focus or whatever.
Without AutoHotkey and Firefox -unfocus since it's involved in operating another program and it doesn't work on linux and without Restore Window Focus After Flash addon since doesn't give you control over flash tabs.implementing this gBrowser.selectedTab.unfocus(); method and bind it to a keystroke in Firefox v3.6 ?I've also tried (based on the addon above)
if (document.getElementsByTagName("EMBED").length == 0) { return; } if (document.activeElement.tagName == "EMBED") {
I want my flash movie to go to a specific frame when the user moves the cursor away from the actual swf file (rollout) in the html page. I tried different things, for instance having a big transparent movieclip in the background and use hitTest:
//this code is in the root level this.createEmptyMovieClip('penCheck', 100000); this.penCheck.ref = this; this.penCheck.onEnterFrame = function() {
[code].....
This doesn't work until the user clicks outside the flash (flash loses focus).
Very strange. I'm using the following function to pass characters to 2 text input components, but sometimes (and much more often with the "Password" field), after I click a button, the button loses focus and I have to move the mouse to regain the rollover state and be able to click the button again. When I've lost focus, if I click the mouse, it just changes the button to the rollover state but doesn't pass the value...
Here's the code: var Focus:String = ""; function KeyPadButtonClick(_id:Number) { // default the focus to the UserID if (this.Focus == "") { this.Focus = "UserID"; [Code] .....
After a user clicks a button the getURL passes some variables to a js function that displays an html lightbox type effect. After closing the lightbox and returning to the page underneath all of the buttons are now no longer clickable
I'm using a scrollpane component. Within it I have textfields with html text links. All works OK, but I have to click a link twice in order for it to work - the first click seems to "focus" the scrollpane component and then every click afterwards works OK. What's weird is other mouseevents - i.e. rollover/rollout - are working OK without clicking.Is there anyway to force focus to the component so I don't have to click twice?
Suppose I have a component and want to change it's focus color at runtime. Here's an example for you (I've excluded any buttons and such to prevent component from losing it's focus, cause in that case it changes it's color perfectly):
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()"> <mx:Script><![CDATA[ private function init():void {
[Code].....
What do I want: How to make this focus to be redrawn without magic (I've tried all the methods, starting with "validate", I've tried calling updateDisplayList() on entire application, I've tried to call styleChanged .
We build a flash application in ActionScrip 3 which provides JS external interface calls. We load another swf on our swf. If we don't enable external swf, any JS calls through external interface works fine. However, if external swf is active, at some points when there is any JS calls through external interface, Flash player plugin crashes which also bring down the whole browser, I see that on IE and FF.
what may cause external interface call to crash Flash plugin?
I'm trying to create an overlay containing a flash player that is shown when a user clicks on a link. The div containing the player starts with display:none in CSS. Upon clicking, the div will be shown, and JS will use ExternalInterface to configure and start the player. The JS configures the player when it catches a "flash ready" event, which is fired by Flash on ADDED_TO_STAGE.All this works, except that the ExternalInterface callbacks are never created. The JS and AS3 work fine if the player is shown upon page load, or is hidden with visibility:hidden instead of display:none. I am aware that Flash will not be initialized with display:none, and this works as expected: when the Flash is unhidden, it fires its events and correctly initializes everything else (eg. GUI, other internal stuff). The only thing that doesn't happen as expected is that my ExternalInterface callbacks are not added.
ExternalInterface.available is true. It's not a timing problem, because even after several minutes the callbacks are still not present. The strangest bit is that the flash is able to call JS, fires JS events fine, and the code to fire the events comes after the code to add the callbacks. There are no errors thrown by any of the AS3 code. I'm seeing this problem in both Chrome and Firefox.
I'm trying to force the Flash player to play video files without showing screens. I did try to set vidDisplay.visible to false. But it seemed not working at all.I was doing was try to build a generic media player. Whatever the source is(audio or video), the control panel always the same, namely, a mp3 player panel is always displayed:However, when I stream in a video file, it would end up overriding mp3 panel with a partial video screen. I don't have enough reputation to upload images...
This is definitely a huge BUG in flash player 9.Here is some info if someone had run into similar problem?If I try to align flash to: StageAlign.BOTTOMorStageAlign.BOTTOM_RIGHTr StageAlign.BOTTOM _LEFT and then if I try to resize my flash using externalinterface which will call outside JS that resize div around it, you`ll get flicker effect on your flash.However, if I align Flash to: StageAlign.TOPorStageAlign.TOP_RIGHTorStageAlign.TOP_LEFTand then use external script for resize, everything works fine.
I'm trying to control a Flash video player with external Javascript commands using 'ExternalInterface.addCallback' but I'm not having any success. Here is the HTML code:
I have a problem in the communication between as3 and javascript: simply I want to use a flash movie in the same page where I included an wmv object player. When I try to invoke a function on JS (from as3) I note that all the normal playstate and commands to handle the wmv player are inverted. (for example the movie is playing the variable document.Player.playstate is set to 2-paused and so on). Even further I figured out I have big problems in fullscreen/set volume commands. Does anyone face this problem too? Where can I find useful links?
i have an mp3 player thats xml and i want to have a button the when clicked it downloads the current song playing. how to achieve this. I already have a lyrics button i think it would be something kinda similar but with download settings. the lyrics button jsut links you to another page. here's the code for it though
I have this simple actionscript 2.0 code for a password field.. you have to enter "hello" to get the string "yes" otherwise you get the string "no" returned.. I was wondering if there were any flash terms you could enter into the input text field to still get access other than "hello" i.e. entering passwordstring would make the if statement say (read the code at the bottom first)...if(passwordstring == passwordstring)but that doesn't work..here is my code:
Just to be clear, in order for System.setClipboard() to work, it has to be executed within a function that receives either a Keyboard or Mouse Event. Now, in my specific case, I need to hack this so that when I press 'enter', I get my string that I want to paste into the clipboard from the internet, and when Flash gets it, THEN it pastes it in.Here's an example on how I thought I could do that (unfortunately I didn't work).
Code: stage.addEventListener(KeyboardEvent.KEY_DOWN, keyboardHandler); function keyboardHandler(e:KeyboardEvent):void {
I want to know about hacking a flash game...like in a flash game how to hack to increase your votes or score ... As there are flash games in Facebook,how to hack them
I made a 'whiteboard' app. Originally it was for Flash Player 7 then I changed the Publish Settings to point to Flash Player 8. Worked fine for me, but caused problems with my customer, so I changed Publish Settings back to Player 7. When the customer opened up the .swf which I'd emailed him, it opened in Flash Player 6, even though he had the latest player installed. When he deleted the old V6 player the problem was fixed. So my question is, why did my .swf open Flash Player 6 - and therefore lose some of it's functionality - when the customer had a later player installed?
I'm finding that certain browsers for Mac (and perhaps PC) force my custom flv player to load the entire external file before playback begins.
The basics of my code:
Code: var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc);
[Code].....
How do I stipulate instant playback in browsers that try to perform a full preload? By the way ... "vP" is already on the stage and is the video player.
I've created several buttons and each contains a movie clip. I then placed each button on the main scene. Everything works well except the movie restarts every time the button over event is fired. I added a mouse over listener to each button so I can reposition the button. However, the movie restarts even if I don't reposition the button. (i.e. Button 1 is active and the mouse leaves the player and returns to Button 1.) How do I keep the movie that is embedded in the button from restarting?
basically, what am doing is that am running a flash file (playing music) in the background of the app using webview, and when I want to stop the music , I just load "about:blank".I want to keep the flash file running (music) when my app gets paused (which works fine so far) the problem is when the app resumes, pressing on pause button launches a new webview instead of changing the link in the previous one and the sound doesn't stop.the only solution I found was to kill the process and restart the app, but that's not practical, any idea of how to still be able to use the same webview when resuming the app ?
Update: guess I wasn't clear enough, I have a webview widget stated as "gone" , I only need the audio form the flash file I'm running in the webview so the "play" button loads a URL that contains the flash file (so the user only hears music, and doesn't notice that I'm using a webview), when I press the back/home button the music doesn't stop (I like it that way) but when I go back and press on play again it loads another url in a new page, you get double music
I cut up parts of a web page background to do some menu animating in Fireworks on the left side, and the right side to have a slideshow on top of a transparent PNG background. Then I bring both together in a Dreamweaver file, within a DIV so it looks seamless. This has worked fine before, and it exports okay, but I noticed that putting the two "parts" back together side by side that the SWF background is somewhat faded compoared to the Fireworks HTML. I've tried changing the Publish Settings and I've tried changing the PNG file property in the library to both "enable smoothing" and "Lossless Compression", but nothing seems to fix it. My next option is to make the PNG the background image of the page when I bring it all in to Dreamweaver, but I'd like to know if this can be fixed for future reference.
In my SWF, I have a function that automatically runs at a certain time.The user must not run that function or change a timer variable, so is he able to do it with some work ?
Does anyone know the file upload hack for Flex, which will allow files to be uploaded to authenticated web services via multipart form post? In this bug report from the Adobe site, a user reports: Flash isn't cross-browser compatible if this feature only works via Javascript hacks. So far, I've been unable to craft such a hack. I'm unsure what to do next. Here's what I've tried so far (all have been unsuccessful or impossible). Set cookies on url Pass cookies to Flex URLRequest Create hidden html form in javascript to post file
I apologize in advance if my question is not clear, because I don't know how to put this. What I am trying to do is to reduce few lines of repeated code by implementing various OOP methods/concepts.
The problem I have few set of of classes which has initialization process. So, I am implementing an init() method in all those classes. From the calling class (main), these objects will be instantiated and init() method of each object is called in the the order and call some other process after all of them are initialized. Something like this