ActionScript3 :: Get Real Url Of Page In Which Swf Is Placed?
Nov 27, 2010
So I tried
var url:String = String(this.loaderInfo.url);
var request:URLRequest = new URLRequest(url);
try {
[Code]....
but thay bouth return me to [URL] while I had url [URL] I use flash builder. So what shall I do to recive real full link - not swf link?
View 1 Replies
Similar Posts:
Jan 19, 2005
im just wondering if theres a way to get the real x and y positions of an object in the real movie ( the root screen) that is locted in another movie
i have an object which is within 2 movie clips, first one and then another , and then my object, now i want to know what the real x and y positions of it is, not the locations realtive to the movieclip it is inside.
View 5 Replies
Jan 26, 2009
i'm trying to build a flash site and ran into a problem... i have a gallery page with a bunch of page numbers at the top. when you click on one, a movieclip loads of some images coming in.so the problem i'm having is that i made a little animation for when you roll the mouse over the page number (they scale up when the mouse is over, scale back when the cursor moves away)... what it's doing is when you roll over, it goes to a certain frame in the timeline and plays that animation.that's all working cool, but i need it to not do that once it's clicked on. so basically when you actually click on a page number, the over script should stop until you go to another page... here's the code i've written,
function over(event:MouseEvent):void {
this.gotoAndPlay(30);}
function out(event:MouseEvent):void {[code].....
View 0 Replies
Apr 28, 2010
I am trying to create a SWC library for use in my Flash AIR project. I have created a seperate FLA called SceneLibrary and followed the steps defined here:[URL]..to create a new SWC component. I saved the created SWC into a lib folder within my Flash Dev project, I then right click on the SWC item in my project window and choose "Add to Library" This all seems to go fine.
In my code i then go import FirstScene (this is auto completed by Flash Dev) It seems a bit weird to me that the path to this class would simply be
[Code]...
View 1 Replies
Jun 28, 2011
I am trying to implement sorting function in c# (I wan to sort the array)
card_codes.sort(function() { return 2 * Math.floor(Math.random()) ? -1 : 1 } );
This is how ActionScript sorts array of integers in script and every time after first sort it starts with 301 but When I try to sort same array in c# it always starts with 101. here is how I sort it in c#
Array.Sort(PlayngCardCodes, (f1, f2) => 0.CompareTo(2 * (int)Math.Floor(rng.NextDouble()) == 0 ? -1 : 1));
how to exactly rewrite actionscript sort to get the same result?
View 2 Replies
Jan 23, 2012
I made a simple project which you paste XML into a TextField and and uses this. It works great however it doesn't keep the original structure which wasn't much of a problem until i recently noticed if i load or copy and paste XML which contain comments like:
<min>0.0</min>
<max>255.0</max>
In the TextField it turns to this:
<min>0.0</min>
//
<max>255.0</max>
Which creates problems as from what i can tell it would then run lines of code it should not. I would prefer if it kept the same text structure as the loading/copy and paste method seems to adjust it for some reason.can you keep the exact same XML text structure with working comments? when the XML is in the TextField it removes this part:
<?xml version="1.0" encoding="UTF-8"?>
why does it remove that rather than keeping the text exactly the same? and can i make it keep that or would i have to manually append that text again?
View 1 Replies
Dec 28, 2010
<note>
<to>ahmad</to>
<from>jhon
[code]....
View 2 Replies
Dec 22, 2009
There are dashes in attributes of an xml, and I don't know how to filter them: Here you can see a simple example of the xml:
<posts>
<post>
<photo-url max-width="1280">http://blabla.tumblr.com/photo/98</photo-url>
</post>
</posts>
Because also the photo-url-tag has a dash, I needed to parse it with ...child("photo-url"). This worked fine, but if I want to filter these tags(photo-url), in order to receive all photo-url's with the same attribute: "max-widht='1280'", I couldn't manage to do so. I tried this approach:
var photoUrl:XMLList = xml.posts.post.child("photo-url").(@max-width==1280);
I get this error:
ReferenceError: Error #1065: Variable @max is not defined.
View 2 Replies
Mar 11, 2010
I have written a Flex Library project - a .swc file - which is supposed to read default configuration from a XML file inside .swc. This .swc file would be used by other modules to perform some operation. I am unable to make the URLLoader to load the XML inside the .swc file.When i run this as a normal Flex project, things work fine without any issue. With swc, it looks bin-debug folder for the XML and not inside .swc. I want the URLLoader to look inside .swc for the config file. How do i achieve this?
myLoader.load(new URLRequest("config.xml"));
For the above code i get the following error:
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL:
[code].....
View 1 Replies
Aug 23, 2010
I have a situation where I use loadvars to load an xml file, which has the address of 2 swf's on the server. I can trace the xml items so know they are loading. So I'm trying to load the swf's but am running into problems. First problem, the swf always gives an error when I publish from flash, "TypeError: Error #2007: Parameter url must be non-null." as it can't find the mention of the xml file, as it's just being published. I'm not sure this affects the next issue which is the swf not loading when I try to load it like this:
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest(loadswf1); // where I know loadswf1 = "myswf.swf"
loader.load(defaultSWF);
[code]......
View 1 Replies
Sep 4, 2010
what's the difference between MXML and Actionscript3 when we need to use MXML ??
View 2 Replies
Dec 16, 2010
Having some problems adding the default spark.components.VScrollBar scrollbar. All I'm doing is creating a new VScrollBar, setting it's coordinates, a width and height and doing an addChild but it's not showing up. I'm adding other components too that do show up in the same code so that shouldn't not be the problem.What might I be missing?
var a:VScrollBar = new VScrollBar();
a.x = 100;
a.y = 100;[code].....
View 1 Replies
Feb 25, 2011
I m developing an app that pulls android device IMEI and matches it against the database Is there a way to retrieve android device IMEI using actions script?
View 1 Replies
May 24, 2011
i want to have the music always playing and the ability to mute different parts. It is for a project where you click on different people and they come to life to play music. a stop and play would not have them in snyc. I have not been using action script long
var my_sound:Sound = new Sound();
my_sound.load(new URLRequest("triumphant.mp3" ) );
function setMute(vol){
var sTransform:SoundTransform = new SoundTransform(0);
[code]....
View 1 Replies
Jun 21, 2011
How can I get to know that the device is iphone or ipad using actionscript3.0?
View 1 Replies
Oct 19, 2011
Im trying to make a simple interactive flash animation so when you roll over a invisible button a sound plays from the library, then when you roll out the sound stops.
So far i have this
import flash.events.Event;
import flash.media.SoundChannel;
stop();
[Code]....
Is there a way to stop the sound playing with ROLL_OUT or stop the current sound when a new one starts?
View 2 Replies
Dec 18, 2011
how to move the stage within the actual .fla file by modifying this.x and this.y variables in the layer 1 actionscript.
But within the document class- public class Starlight extends MovieClip, it does not seem to work no matter what i try and my research lead me to this use code instead:
for( i = 0; i < stage.numChildren; i ++){
stage.getChildAt(i).x -= player.speedx * player.bounceSpeed;
stage.getChildAt(i).y -= player.speedy * player.bounceSpeed;
}
I do realize that its hacky and slower as compared to actually moving the stage itself. And i'm not sure what's going to happen if another object that moves comes into the stage because technically this code is unnaturally altering the x,y of everything in the stage.
[Code]....
View 1 Replies
Dec 20, 2011
I am new to AS3, and I am trying to make an XML music player. For reasons unknown, the music player that I have coded (GUI was made an placed on the stage, so coding for those are not included.) will not display text or play the music. The code I have so far is:
var my_songs:XMLList;
var my_total:Number;
var my_sound:Sound;[code]....
View 1 Replies
Feb 27, 2012
In ActionScript3 i wanted to get the text between 2 quotes from some HTML using a input index value where i would simply increase the 2nd quote characters value by 1. This would be very simple however i have now noticed using indexOf does not seem to work correctly with quotes and other special characters.[code]...
View 1 Replies
Jun 5, 2010
MyMovie.addEventListener(MouseEvent.CLICK, goClick)
function goClick(e:MouseEvent):void
{
trace("Trololo");
}
It's work. Why don't work?
[Code]...
View 1 Replies
Aug 30, 2010
In 90% of the example projects I see for ActionScript / Flex I notice the following two coding conventions: 1) private member variables with getters/setters start with an underscore as in "_credentials" and 2) interfaces start with the letter "I" as in "ISessionInfo" Coming from the Java world, I find both of these conventions unnecessary and annoying. I am about to start a new Flex project and was planning on NOT following these conventions unless they are truly are widespread, standard conventions in the Actionscript/Flex world.
View 1 Replies
Mar 29, 2011
For example if I was given the string "01/01/1980". How could I then get the current date, then figure out how old someone is, and then just return how many years old they are?
I saw a topic on this in C++ but i'm not to familiar with it, anyone know how this would be done in AS3?
edit: I think what i'm having the hardest time with is how I would break down the original brithday string i'm starting with into month, day, year vars
View 4 Replies
Jul 4, 2011
How to import json file in action script and then get random element from json array/object?
View 2 Replies
Aug 13, 2011
I've been trying to write a function to create a simple circle in Box2DFlash . but it keeps telling me that the object is null and I can't access it's properties here's the code:
public var f1:b2Body;
public var f2:b2Body;
public function addACrate(fallingCrate:b2Body,
[Code]....
and when I try to access the "y" property of my "f1" object it tells me that it's null .
View 2 Replies
Sep 3, 2011
I'm developing a flash app by using free Flex SDK and text editor and compiling in command line.
I want to use VGroup or HGroup in my actionscript to manage positions of DisplayObjects.[code]...
View 1 Replies
Sep 6, 2011
Padding left can be done by TextFormat.leftMargin. And padding right can be done by TextFormat.rightMargin.
But there is no topMargin or bottomMargin property in TextField or TextFormat.
How can I do padding top and bottom?
Example code of left and right padding(margin) of TextField:
var format:TextFormat = new TextFormat
format.leftMargin = 40
format.rightMargin = 40
[Code].....
View 4 Replies
Sep 28, 2011
In C#, it's possible implementing interface methods without making implementing method as public. For example,
void ITest.SomeMethod()
{
// ...
}
Is there equivalent for ActionScript3?
View 2 Replies
Nov 27, 2011
I have a piece of XML that goes out and grabs data. That data is being updated every so often. I want the user to be able to see the updated data by creating a way to reload it every x amount of time.
How do I use the timer to do this in Actionscript 3?
View 1 Replies
Dec 6, 2011
I design a TextInput by using components in Flash, height=240 width=400. While I'm typing a long text, half of the text is cut out.
View 3 Replies
Jan 16, 2012
I have a video streaming app, and it uses Flash AS3. It keeps getting a NetStatusEvent of "NetConnection.Connection.Failed", when i try to use it in my Windows Testing environment. I need to make it work in my testing environments before i can launch this product.How do i diagnose this problem?
View 1 Replies