Flex 3: How do I get URL - apache-flex

I'm setting up a twitter button on my Flex 3 site. I've got it working, but the URL info it uses is static--- www.mysite.com, for example. I want to make it so that twitter button interacts with whatever "page" the user is looking at. But, I don't know how to grab the current URL. So, for example, if the user is looking at: http://www.mysite.com/#view=2 how do I get that information. Or if they're looking at http://www.mysite.com/#view=44, how do I get that the URL?
Thank you.
-Laxmidi

This should work.
var browserUrl:String = ExternalInterface.call('window.location.href.toString');

You'll want to use JavaScript to obtain the location object.
Look into the AS3 class ExternalInterface.

Related

How to implement Ionic Deeplink when link has multiple parameters

I need someone to explain to me how can I use ionic-deeplinking in my project.
The scenario is this I have a link https://dev-testing-app.web.app/auth-handler?mode=action&oobCode=code, and I want to redirect the user when they clicked the link to a certain page. The problem is I don't know what endpoint should I place in line 23 since the link has multiple query parameter which are mode and code. Is there a way to implement this?

Kibana/iframe for dashboard: disable modifications

Hellow everyone,
I know I can export my dashboard thanks to the iframe link and to add to my web page. However, it is still possible through my web page to modify my dashboard. I would like to know if there is a parameter inside the url or something else that disables this feature. It would be great for me !!
Thank your for your attention and your help.
Joe
OK,
Go to kibana/src/ui/public/filter_bar/query_filter.js
search for queryFilter.addFilters function,
mark all function content as comment,
build and restart kibana
Use the link in following way
http://localhost:5601/app/kibana#/dashboard/My-Dashboard?embed=true&_g=(filters:!()
Basically embed=true in your URL will make it read only and remove all extra features.

Need to change value of checkbox if depending on link in Drupal 7

I have a webpage with two links, for example example.com/link1 and example.com/link2. Both links must to link to the same webpage, only for first link (example.com/link1) the form on the linked page should have checked checkboxes, but for other unchecked.
Maybe somebody can just advise on how to do that, just the idea hoe to do that using Drupal.
I'm looking for something slightly similar and remembered the "Flag" module. I'm not sure if you can get to it via a URL, but it seems like it might be possible.
http://drupal.org/project/flag
Add a query to your link (ex: example.com/linked?checked=1 - see the $options argument for l()) and test for this using $_REQUEST['checked'] in your form.

How to give a link from php page to another URL with a flex state?

If I want to navigate directly to the second state of some flex app, for which the link has to be given from another php page. How to do it? If I give the normal URL it will anyway land me to the first state.But I want it to directly go to the second.
Pass in the state via flashvars. Then use whatever is passed in to define the state.
The best way to do this would be to use deep-linking. It takes a little more work but has other benefits in your applicaiton anyway.
http://livedocs.adobe.com/flex/3/html/help.html?content=deep_linking_1.html
basically you would just give the url and put extra information on the end, something like:
http://myurl.com/myapplication.html#state=second
The other way to do it would be to pass in the state via flashvars like Zack said, and then just change your state on creationComplete.

How do I login in with facebook connect in a flex application

I've been checking out facebook connect stuff from the new actionscript 3 library from Adobe. I have been trying to figure out how to use the facebook connect button inside of a flex app.
In an html page you would us the fbml and it would automatically put the facebook connect button on your page and when the user clicks on it it pops up the face div and lets the user login. Well you can't use that in flex. So I could put it on the page containing the swf but, that's why I'm using flex and not html. I've seen it done by the guys at Universal Mind so I know it's possible. I just need a little direction.
I know the function to use in the facebook connect api to cause that login dialog to come up I just can't figure the correct combination.
Chcek out the Create your first Facebook application with Flex tutorial and in particular the section on Add Facebook login.
This should be applicable to Flex. This would be done using the ExternalInterface calls from within Flash.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/external/ExternalInterface.html
In Adobe facebook-actionscript-api there is a class LoginWindow which you can use.
When you need it this window will open like small flash popup window and it will display facebook login page and enable user to login. All needed events will be raised and you should be connected after that. I didn't tested it but from the code looks like what you need.
this developer created this js/flash bridge you are talking about using the ExternalInterface classes. you can download all source files as well. i found it very useful.
http://www.wellconsidered.be/blog/2009/01/04/facebook-connect-to-actionscript-3/
There is also a very clean and elegant solution/tutorial at:
http://www.stevenvh.be/blog/?p=57
Use this API:
http://code.google.com/p/facebook-actionscript-api/
Look at ConnectDemo.
The sample kind of sucks... it forces you to connect before showing the Flex app.
You need to tweek the example to get it to do what you want.
Also, FB depreciated some of the methods, so you have to look up new methods that aren't depreciated.
I'd love to update the sample, but I don't have the time to dedicated to another project.

Resources