ActionScript 3.0 :: SWFAddress Events Not Working?
Sep 28, 2009
I'm doing a little website and using swfaddress for deep linking. Everything seems to be setup as it should, swfaddress is working fine when i'm setting values, like the page title or url and stuff.On the other hand, SWFAddress.onChange event is not responding at all. Has anyone got an idea or had this "bug" before ?
Is there any way to differentiate between the origin of onChange events?
I understand that both come from the browser (or more specifically, the javascript side of things), I think, but my app specifically requires me to separate the two, as not all app change events will fire a new title/url (but still need to be processed in the same way as the ones that DO fire new title/url changes).
This goes against Rostislav's suggestion [URL], but I just don't see any way around it.
I'd basically only like to process the onChange events that come as a result of entering a URL directly, OR using the back/forward/history entries....and keep all other navigation happening in Flash separate.
I have spent several days now trying to make SWFAddress 2.4 work. I followed very closely Lee's video, but I can't make it work. I get the site working, but I cannot make the deep linking nor the title change to work. I am using CS3 with AS 3.0 and SWFAddress 2.4. My PC has Vista Home Premium and I tested this on several browsers (IE, Safari, Opera, and Firefox).
Here is my html code:
Code: Select all<!DOCTYPE html PUBLIC "//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml-transitional.dtd"> <html> <head>
[Code].....
The FLA file is constructed the same way as in the video with 3 MC's which visibility I toggle based on which button is pressed. The trace() call in onChange displays correctly the value I am setting in each one of the button event listeners, however the url never changes and the back and forward buttons are never enabled.
I have used SWFAddress before on a timeline driven site but now I am trying to do all actionscript and it suddenly doesnt want to work.I am trying to use SWFAddress 2.4 and even got as desperate as to try using all my older files (old .as files, and .js files and even switch my AC Object to the swfobject.js) and it refuses to work.Below is a broken down quick version of what I am trying to do
I'm trying to get SWFAddress working in a project. When I open my page in Firefox Firebug gives me and error: asual is not defined _util = asual.util, swfaddress.js (line 230)
The Flash end seems to be working as I get the the swfaddressEvent. The JS side refuses to put the name in the title of the browser.
I'm using SWFAddress 2.4. I'm also using SWFObject v2.2, which I have imported first, as per suggestions.
I tried the older version of SWFAddress following along with the Tutorial at GotoAndLearn.com. But, this also did not work.
I had a somewhat weird setup for a site here, which goes as follows: Server A holds a SWF Server B holds a HTML document with the SWF Embedded, along with SwfAddress.js I can't seem to get any Flash-to-javascript to work here through External Interface calls. SwfAddress fails and I see this error in Firebugs Console: "Error calling method on NPObject!" This also occurs with another JS function I'm trying to call with the MouseWheel. I've set up my crossdomains and deployed all Security.allowDomain("")'s where applicable. Has anyone embedded an external SWF and had issues with AS-JS communication before??
The timeline swf itself (the core of the site) is being loaded into a wrapper swf, as one of the requirements is that this timeline can be used elsewhere, in other projects. This wrapper, however, will have some additional visuals that pertain to a stand-alone version of this timeline. As a result of never knowing exactly where this is going to be used (either a subchapter in another flash website, or as a stand-alone site by itself), I've decided to dump all of the swfAddress code into the wrapper, in a child class of it. To handle the navigation changes, I'm dispatching custom events (from the timeline) with parameters that describe the nav changes, which gets picked up by the parent wrapper, which then calls a function in the swfAddress child class for handling.
Also done in this swfAddress class is the parsing of the URL onChange event (when a browser back button button or history changes the nav, rather than a Flash button). This, too, dispatches an event with info about the parsed URL, which the wrapper is picking up and then calling a function in the timeline's API to make the necessary changes.
I have SWFAddress going for the most part, but the browser's back and forward buttons aren't working properly. When I use the back and forward buttons, it successfully changes the URL but it seems the SWFAddressEvent.Change is not being fired in Flash. Everything I click within the .swf relies on this event and works great, but the browser buttons still won't.
how to use SWFAddress within MCs? All the tutorials I find seem to use the maintimeline, but I need to know how to make it work within multilevel mc's, dynamicly loaded in. Ive got a working code but this one is static. Everything is working, even when i copy and paste the URL of Testpage 5 for example in the browser. how to create a dynamic way than using the switch statement.
I'm having a problem with the flash publish method and swfaddres.I've included the javascript of the flash pubblication in a new javascript file with the swfaddress in the same page.If i use swfobject for including my flash file in the swf, swfaddress works ok...if i include the swf with the flash method swfaddress doesn't work.Here the link: http:[url]......
i have written the code for copy(ctrl+c) in flash action script2.0. it is working fine in mozilla, but the same copy key event is not working in Internet explorer.
I have an instance of FLVPlayback on my stage called amplayer. I also have buttons next to it that stop the player and change the source. Some of the buttons not only change the source, but seek to a cue point as well. I'm trying to create the function that seeks to the desired cue point once the new video source is loaded and the player is ready, but it is giving a cryptic error at compile time.Here is my code:
import fl.video.*; //Button click handling code goes here function readyhandler(event:VideoEvent):void {
Yet only sometimes when I press keys does it actually invoke. I have no clue why, I thought maybe something else has focus. Well I cannot add key listeners to NativeWindow or NativeApplication, and I would assume if it is on the WindowedApplication which is the root element, that as long as my application has focus the key presses should invoke the listener.
Can anyone help with this, I've been working on it for hours straight and I'm still having major issues.
Sometimes it works great, sliding each new status update down as it should. Most of the time it seems to have completely random positions set. I am completely at a loss. [URL]..
I think it's an event issue, specifically with line 127 trying to loop through the children and dispatch a custom event to all children. I'm not sure how to best do that.
I have a button that I want to have trigger a rollover effect when rolled over, and when clicked trigger something. I am changing the background image of the whole Flash movie. On Rollover I want it to give you a preview, and on click, I want it to goto a frame in a movieClip where that image is. Here is a pic of my timeline:For instance. I want my first button, "button1" (which is outside of this movieClip on the main timeline) to do the following:When rolled over, it needs to go to the "btn_over" frame label When Rolled out to go to the "btn_out" frame label.And when Clicked to go to frame 2.Currently My button is a movieClip symbol, because I will be doing some simple animations to it. Here is the code I have on my first button: This makes the click work. (and it does work, just not when paired with the second function for the rollover)[code]Does anyone know why the second function is overpowering the first? Or a way I can get the effect I am looking for.
I'm using Flash Pro 8 and I'm attempting to incorporate events into some of my classes and I'm having nothing but problems. After looking at lots of examples, this all seems okay, but doesn't work. First is the class code and secondly is the code on the timeline.
ActionScript Code: import mx.events.EventDispatcher; class iaicu.mycampus.ClassSchedule {[code].....
Keep in mind that these classes are more elaborate, so events are intended to be more useful.
I have a SWF file that uses Mouse and Keyboard Events. When I test the SWF file in the flash IDE the events work fine. When I run the SWF file stand-alone with the Flash Player, the events work fine as well. But, when I open the SWF in a browser, neither mouse clicks or key presses register. Even if I puslish the SWF as a HTML, it doesn't work either.
Just wanted to ask if there is any advantage for either using mouse click event or touch tap events, when writing apps for mobiles or tablets (for the iphone especially)?
I know that both of them should work fine, but in term of performance, is anyone better? Are there any things I should be aware of when choosing either?
By the way am using actionscript3 to implement the app.
I have an animation that I want to start when clicking on the flash window. However, I've also have some buttons on the stage. If I add an event listener for MouseEvent.CLICK on the stage, then it 'eats up' the events and the buttons don't work.
I've tried some tricks, by adding some invisible buttons on top of the real ones, and use the MOUSE_OVER event to selectively enable/disable the mouseEnabled flag for the stage, but didn't work because it complains that the property or method doesn't exist (which I find odd).
For some really dumb reasons, I must support IE6 in the project I'm currently working on (think multi-paged microsite). I have SWFaddress, now, worked into my navigation system, and it is working as expected in chrome and FF.
When I get into IE6 I am having the following problem:
The "browser URL Update" phase of the SWFAddress.setValue -> SWFaddressEvent.Change
cycle fails to function, except when the mouse cursor leaves the SWF frame. When the mouse leaves the frame, SWFaddress history gets updated as expected and the browser navigation buttons function as expected.
But if the mouse cursor stays within the swf, none of this happens, and any stateChanges are skipped by the browser buttons.
Hello all. Having a hard time getting info on SWFADDRESS so I thought I'd try here as Kirupa has saved my butt in the past. So my question is this. I am trying to attach a variable to the end of my SWFADDRESS url but can't get it to register. I can get it working fine using SWFOBJECT like so
http://website.com?Var=1&Var2=2
but once I add the deeplinking I can't get any results.
http://website.com/#/Home/?Var=1&Var2=2 or http://website.com/#/Home?Var=1&Var2=2
My code in the html is :
Code: <script type="text/javascript"> // <![CDATA[ var so = new SWFObject('Example', 'website', '800px', '600px', '8'); so.useExpressInstall('swfobject/expressinstall.swf'); so.addVariable("Var", getQueryParamValue("Var")); so.addVariable("Var2", getQueryParamValue("Var2")); so.addParam("wmode","transparent"); so.write("flashcontent");
// ]]> </script> Anyone have a way around this or a good source for SWFADDRESS help? Would really help me out! Cheers
how to use SWFAddress within MCs? All the tutorials I find seem to use the maintimeline, but I need to know how to make it work within multilevel mc's, dynamicly loaded in.Ive got a working code but this one is static. Everything is working, even when i copy and paste the URL of Testpage 5 for example in the browser. how to create a dynamic way than using the switch statement.
Am successfully using swfaddress and love it. For the first time though I'm trying to implement it on a site that has a load bar. The issue is if I use the browser's back button I'll eventually get to a page that just shows the full loadbar and stops. It is the the page that I have labeled "$/". If I don't put that label on the first frame then other worse problems occur. [URL]...
I have created a menu with XML data. I have created a movieclip navigationMc this is placed on the first frame of the stage. Inside navigationMc I have another movieclip and named it as menuitems where I am calling the XML. I am calling a button from the library through linkage property called menuitem. I have another movieclip on the stage called pageContainerMC for loading external swfs. Now the script on the main stage - Frame 1 is:
The swf address shows on clicking the button but it doesn't load movie once you click back and forward button on the browser also it doesn't change the name of the title.
i have been trying SEO to get it noticed. I came across Swfaddress and statemanager and decided to implement them. I have examined the sample files for both methords and decided i want to use SWFaddress (it works well with google analytics).My problem is that the examples of swfaddress use a frame based navigation and my site uses buttons which load the pages into a loader component via a preloader. Do you think it would be possible to use SWFaddress with my site?
I am using swfaddress for the moment but I am using it on the timeline which is not as dynamic as I would like it to be. How to combine xml and swfaddress? I would like swfadress to get the adress from an xml file and than do whatever its supposed to do.
ive been trying to get swfaddress working. And everything works fine ( the getValue function shows the right content, setTitle does its job etc ) except for setValue. When i set it to for instance setValue("news"), the url in the browser is updated to index.html?#news
that question mark shouldn't be there i guess... it also reloads my page every time. I have no idea where to start looking as i dont know what's causing it. anyone else had this issue before ?
- Does anybody knows If an XML menu works with the SWFaddress concept?I can only find tutorials about the classic buttons menu (with timeline based transitions)