ActionScript 3.0 :: URLRequest String Parameter : How To Point It To Parent Directory With URL
Mar 3, 2009
I just have a simple question how do i point to the parent directory from where i curently am in URLRequest string parameter?in other words my folder structure:
my_site/flash/button.swf
How must string look to tell flash to locate solarij.html that is in my_site folder one folder up(parent) from current swf position.?
ActionScript Code:
var link:URLRequest = new URLRequest(""); navigateToURL(link, "_self");
I am making a site, this site is in a folder, inside of this folder I have the index.html file and a load of other html files. I then have a folder, flashheader. with a flash header that has 5 tabs on it. When I click a button, I want to navigate to another URL, this URL being in the parent.
PHP Code: tab1.addEventListener(MouseEvent.CLICK, myBtnClicked1); function myBtnClicked1(e1:MouseEvent):void { var url:String = "../index.html"; var request:URLRequest = new URLRequest(url); try { navigateToURL(request, '_self'); } catch (e1:Error) { trace("Error occurred!"); }}
There is my code, it listened for the tab to be clicked, and when it is, it loads the URL.
I am doing some testing with various methods of deep linking in a flash site and have created a test site with the following structure: /index.html /simple.swf /two/index.html three/index.html
The index.html file located at the root of the site loads the simple.swf file using an absolute reference to the file (view the source of [URL]). The index.html file located in directories "two" and "three" are exactly the same as the index.html file in the root directory with the exception that I have added a defined a "base" parameter pointing to "../". [Right now, I am passing the same "flashvars" parameter in each of these files, however, once I resolve this issue, I will change the flashvars value.]
For some reason, the simple.swf file loads in the root level index.html file but not in the index.html file located in directories "two" or "three". I am confused why this is not working since I am using an absolute reference to the file. The only possible meaningful difference I can see is that the simple.swf file is only located in the root directory.
Like the subject says, I'm passing in a url string through swjobject, and then using that variable to make a url request upon an event. Here is the code. If I remove the loaderInfo and just declare my url in the actionscript itself, it works fine.
I can't seem to figure out how to access a cue point's parameters via AS3I have an FLV with an embedded Event cue point. The cue point has several parameters:
Parameter Name = Parameter Value myFrame = "Hello" myNumber = 45
It just doesn't seem to return the correct width and height of the string parameter. Documentation states that the function returns 6 properties; width, height, textFieldHeight, textFieldWidth, ascent, descent. textFieldWidth and textFieldHeight are supposed to return the exact height and width in pixels that is required to show the textfield obj. Problem is the text will still appear cropped. Of course the workaround is just to add a space in the string parameter, but this a quick and dirty fix.
I have a movie clip which has a function on it that loads some xml (actually xml that is created on the fly by php). The problem is that I have several different parameters - 3 in total which have to be tagged on to the URL so that the xml can display correctly.
I have no problem getting the first 2 parameters into the URL, but I cannot get the final one. On the _root I can trace it fine via another function however I can't get the parameter from the function that lies on the _root, into the URL that sits in another movie clip.
This is what I have for the code that sits in the movie clip:
//load vars for product info var sendProduct_lv:LoadVars = new LoadVars(); var prodID:Number;
[code]....
What I am trying to do is get the URL that is declared in the first function after xmlData.load to have page=2 or 3 or whatever page I hppen to be on when the function floadPopup is invoked.
draw a shape on the stage, make it into a movieclip, registration point wherever, tl is fine, name it mc, and put his code:
trace(mc.getChildAt(0).y);
now get inside a movieclip and move that shape around (away from registration point) for example above registration point, or wherever and output will always be 0.
this seems like it should be simple but for some reason i can't figure out how to get the value of a variable out of a URL query string. if this is in my location bar: [URL] and i just want the value of "chosenCLIP" to use in my loaded SWF file, how do i do it in AS3?
I've got a problem with a function i'm using to dynamically move movieclips around - its like this at the mo:
function wjump(number) { _root.content.aboutus.webwizard.targetY = startPos[number]; }
where startPos is an array with numbers.
I want it to be like this:
function jump(target, number) { target.targetY = startPos[number]; }
so any clip can be moved as long as it has a targetY variable. But it won't work for some reason. Is there some sort of special syntax i should use like [] brackets? I tried this around the target in function body but it did not work.
I am working with Flash with Java. I need to call Java servlet which is deployed in Tomcat server in my local system from Flash.
For this, I have added following code in my Flash application to call a servlet:
var xmlurl:String = "http://localhost/webapps/ROOT/servlet/xmlServlet"; var xmlrequest:URLRequest = new URLRequest(xmlurl); xmlLoader.dataFormat = URLLoaderDataFormat.TEXT; xmlLoader.addEventListener(Event.COMPLETE,
I have a very odd problem with Flash 10 and ExternalInterface. I am currently using a homemade bridge to use RTMFP with Javascript and whenever I try to pass data that contains JSON, I get a wierd Javascript error that comes from Flash[code]...
When I have a class linked to a MovieClip in my library and that class takes an argument in its constructor method. That class will compile properly ONLY when it's located in my top-level directory (same dir as the .fla and Document.as files). If I move that class to a deeper directory, say com.place, and update the package statement and symbol link appropriately, the compiler will generate error "1136: Incorrect number of arguments. Expected 0."Create flash project and put a rectangle on the stage. Covert it to symbol and assign it to class TestPanel - or whatever you choose. Also configure the fla so that is uses a Document (Main) class.Create Main.as and TestPanel.as in the same folder. In the Main class, instantiate a instance of TestPanel and add it to the stage. Flash will, predictably, add the rectangle symbol and everything is fine.Now modify TestPanel so that its constructor method takes a Number and have Main.as pass some number to TestPanel.[code]You now get the error: 1136: Incorrect number of arguments.Expected 0.When I move the TestPanel.as into a deeper directory, Flash somehow is looking elsewhere for the base class for Symbol, even though I'm mapping that Symbol to com.place.TestPanel.
I just recently been using a lot of prototype javascript stuff, and was wondering there was anything like the "bind" method, for use in AS3. It's proved quite useful to be able to look both at the event.target as well as the class object the handler function might be associated with.
I want to create a few buttons which users can choose from to change the XML file for my RSS Reader in Air for Android. This is what the button will need to update:
var rssURL: URLRequest = new URLRequest("http://newsrss.bbc.co.uk/rss/newsonline_world_edition/front_page/rss.xml");
The above XML is the default one I have chosen. What code would I need for them to do this?
This has been bugging me for a couple days now and I can't seem to figure it out. I'm passing a string variable as a parameter in a function and want to convert that variable to a movieclip. I thought I had the proper syntax but the trace keeps returning null. I've dumbbed down the function for simplicity's sake.
i'm trying to write a function but with no luck. seems my brain capacity's limited the function will take two parameters: a term to search for, and a string to be searched. what i want the function to return is a new string containing the term (the parameter) along with a couple of words before and after it (as found in the search string).
In my movie i have a link button with following, simple, function creating a link:
[Code]...
lately i've associated a class file (.as) to my movie and immediately after, when publishing the movie i got the following error message: 1046: Type was not found or was not a compile-time constant: URLRequest. as well as a couple of other related error messages: 1180: Call to a possibly undefined method URLRequest. 1180: Call to a possibly undefined method navigateToURL. when i remove the link to the class file, the problem goes away. also, i have checked the class file for mentioning of "URLRequest" and nothing is there.
I am working on adding functionality to where the URL takes in a parameter as defined by an MVC style looking way.eg. (URL... )where 12345 is the corresponding Id number that I want to get.I have this functionality working.I am using Internet Explorer 7.My issue is that when a user attempts to enter a new query string id into the URL, the page doesn't refresh when the user hits enter or the refresh button. (The user can navigate to the url/#/Id/12345 only when opening a new window/tab)Does anyone know if this is a feature that doesn't work in Flex or if there is some code or configuration needed to allow this?
I have a Main class that has a public var "foo" which is a string. my subClass is a movi clip that has a text field called txt. I want to access the document variable from the sub class but get error 1119: Access of possibly undefined property foo through a reference with static type flash.displayisplayObjectContainer.[code]...
I am converting a number to string var myResult : Number = 12.6789345 var myString : String ; myString = String (myResult); I am trying to search . (decimal point) if ( myString.search("."){ } But I am unable to get Result or unable to find " DOT ".
Parent loads Child, and wants to pass text string to Child. How can Parent pass a string to Child swf?
PARENT.SWF //LOAD CHILD 'has a symbol on stage called LDR that CHILD loads into' var loadCHILD:Loader = new Loader(); LDR.addChild(loadCHILD); var bgURLTxt:URLRequest = new URLRequest("CHILD.swf"); [Code] ..... CHILD.SWF 'has DynamicTextfield called txtBuddy'
[code]All clips are squared.Ok, on the PlayerPlane, there are little soldiers, which have hotkeys. The effect I'm trying to create is I want to position the GameStage so that the currently selected soldier appears in the center of the GameClicker clip.The GameStage is movable by the player (to scan other areas of the map)by holding the CTRL key, so it's easy to kinda lose track of where your players are.I have tried using localTo Global and globalToLocal techniques, but I think I'm lost on the actual math of getting the GameStage to move the correct distance so that the selected soldier is centered to the GameClicker.[code]