ActionScript 2.0 :: Using String Parameter In Function For Mc Path

Dec 17, 2004

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.

View 7 Replies


Similar Posts:


ActionScript 3.0 :: Converting A String Function Parameter Into A Movie Clip?

Nov 16, 2009

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.

[Code]...

View 9 Replies

ActionScript 2.0 :: String To _level (path) - Hide A MC Depending On The Path Variable?

Nov 24, 2004

Here's what i'm trying to do: Hide a MC depending on the path variable as:

[Code]...

Well that doesn't work, for some reason, i can't use a string as a multiple level path..

View 5 Replies

ActionScript 3.0 :: Pass A XML Element Path In As A Parameter Of A Class?

Dec 28, 2010

I am creating a class to handle some audio in an app I am building. This class will need to accept the XML element path as a passed parameter and or a getter.

examples of some XML elements I would like to pass to the the audio handler class to access them.

Dialog.introScreen.text

or

Dialog.secondScreen.main.text

ect.

I pretty sure this is not a string data type and thus cannot be passed as a string (I could be wrong though), if not, what data type would I pass it as?

View 7 Replies

Media Server :: Deliver SWF's To IOS - Send A Path To SFW Like Parameter To Player

Sep 22, 2011

i have a mission to deliver some SWF compiled in a third party application to iOS system. i install FMS 4 streaming edition and now try to send a path to my SFW like parameter to my player. but it doesn't want to play it.

View 2 Replies

Actionscript 3 :: Override Base Path Parameter Inside Flex Application?

Jan 19, 2010

When using as3 and embed my swf via swf object JS, one of the parameters that being transferred to the embed JS function is "base=http://www.mydomain.com" which needed in order to load external widget into application.

Now, am also loading external assets like Styles.swf that placed locally on client side, and when I'm trying to load these assets I get error that they don't found in [URL]

For example: StyleManager.loadStyleDeclarations("Styles.swf");

Error: can't load [URL]

Is it possible somehow to load Styles.swf as local assets??? I've tried use

StyleManager.loadStyleDeclarations("../Styles.swf");
StyleManager.loadStyleDeclarations("./Styles.swf");
StyleManager.loadStyleDeclarations("/Styles.swf");

View 1 Replies

ActionScript 3.0 :: Parameter In Filerequest That Gives The Full Path Of The Object Selected In The Browser?

Mar 11, 2011

Whats the parameter in Filerequest that gives the full path of the object selected in the browser?

I want to display the image selected in a loader.

View 2 Replies

Call A Function With Event Parameter When Have No Event Parameter To Pass?

Aug 14, 2009

Forgive me for this stupid noob question but I want to call a function (loadList) that originally gets triggered after a mouseevent from another function (addToXML) that does not have an event.

The loadList function takes info from a XML var, sticks it into an array which then gets loaded into a tile list and that is working fine.

The addToXML function when called adds elements to the XML var after which I want to call the first function with the event parameter so it refreshes the items in the tile list.

I know it can do this by creating a new array and loading that into the tile list in the addToXML function, but it be much simpler to just recall the function.

I have tried things like

Code:
addToXML.addEventListener(Event.COMPLETE, loadList);

but all the event constants I have tried give me error messges like "1061: Call to a possibly undefined method addEventListener through a reference with static type Function."

View 3 Replies

Flex :: Require A Function Parameter To Be A Static Constant Of The Function's Class?

May 22, 2009

Let's say I have a Custom Event Class, and it has several Event types stored in static Constant:

[Code]...

Is there an easy way to validate that the type passed to the Constructor is one of the Static Constants of the Class, without having to check it against each value?

View 5 Replies

ActionScript 2.0 :: Add A Space In The String Parameter?

Feb 29, 2004

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.

View 1 Replies

ActionScript 2.0 :: Flash 8: Getting A Parameter Into A String?

May 10, 2007

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.

View 1 Replies

ActionScript 1/2 :: Pass Parameters Along With A Function That Is A Parameter To Another Function?

Sep 3, 2010

I'm having some trouble passing parameters with a function that is itself being passed as a parameter.In my application code I'm instancing that class five times:they are buttons in a menu.In that class, I've got an onRelease handler that does a number of things when a button is released, one of which is to invoke a function that is defined in the application level of the code.My problem is that I don't know how to send the function parameters.In my StandardButton class I have:

class StandardButton extends MovieClip
{
/* define properties */[code]..........

The function is successfully being "sent" to the StandardButton class, but without any parameters.How can I send parameters to the class instance with the way I've got this architected.

View 7 Replies

Actionscript 3 :: Default Function Parameter As An Empty Function?

Dec 23, 2009

i have a function that receives a function as a parameter. example:

function foo(bar:Function):void() {};

how can i set a default value for the function to be an empty function so the user will not have to paste a function as a parameter ?

View 1 Replies

ActionScript 3.0 :: Retrieve Parameter Value From URL Query String

Sep 24, 2009

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?

View 8 Replies

ExternalInterface Breaks When I Pass Parameter With JSON Like String?

Mar 1, 2011

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]...

View 2 Replies

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");

View 2 Replies

Actionscript 3 :: Creating A Button To Update String Parameter For RSS Reader?

Apr 9, 2012

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?

View 1 Replies

ActionScript 2.0 :: Search + Return A New String Containing Parameter Along With A Couple Of Words

Oct 8, 2006

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).

View 2 Replies

ActionScript 3.0 :: String To MovieClip Path, Scope?

Nov 11, 2010

I'm trying pause a video netstream within a MovieClip with a button (ppBtn). This works when I hardcode the movieclip path (like: etc. media2.ns.togglePause() ), but when I use a string in the path to access the MC's netstream it doesn't work. I've tried serveral ways to cast the string to a movieclip.name but I always trace a "null" or "undefined" of the mcpathI've tried to cast the string as a MC in different ways without any luck:

this[myString]
MovieClip(myString)
mySting as MovieClip()

[code].....

View 5 Replies

Regex :: How To Parse String (Similar To Path)

Mar 4, 2010

I have a string that is similar to a path, but I have tried some regex patterns that are supposed to parse paths and they don't quite work.

Here's the string
f|MyApparel/Templates/Events/
I need the "name parts" between the slashes.
I tried (w+) but the array came back [0] = "f" and [1] = "f".
I tested the pattern on [URL] and it seems to work correctly.

Here's the AS code:
var pattern : RegExp = /(w+)/g;
var hierarchy : Array = pattern.exec(params.category_id);
params.name = hierarchy.pop() as String;

View 2 Replies

ActionScript 3.0 :: Casting A String To Be A Resource Path?

Mar 18, 2011

I have a situation where I am trying to build a path to an xml node like this:

Code:
var personName:Object = ["xmLoader.xmlData.profilepage.p"]+num+[".p1name"];

Where "num" is a number passed into to the function. What is happenning is when I trace out personName after this code I get:

"xmLoader.xmlData.profilepage.p2.p1name"

instead of the value that resides at that node name (I can trace out p1name which is John from my processed xml earlier in the code).

View 5 Replies

ActionScript 2.0 :: Convert String To Array Path?

Jun 26, 2008

is it possible to do this? And if so how? the xml is converted to an Object using XLEFF; there are five nodes en the specified path: var path:String = "mCb.mXMLloaderObj.dm.lang[0].menu[0].node.length"; trace(path) this will offcourse output just the path as a string. But I want to trace something like: trace(Object(path)); and hopefully get the number 5, which represents how many nodes there are in the specified path in the Object. Is this possibly? Because I can't find anyway to do this

View 6 Replies

ActionScript 3.0 :: Drawing Animation On Path Out Of String

Aug 19, 2010

We need to make kind of a path animation out of a string (curved lines) drawing. The designer provided me with this: [URL]. We need a revealing (growing) type of animation that generates from the right, follows every corner and ends up in the left with that giant piece of "mop". Is there a way to do this professionally? Tried the old frame by frame masking, but it looks odd. Shouldn't be some AS3 libraries that just work with paths or that draw paths?

View 3 Replies

ActionScript 3.0 :: Library Bitmaps - Pass String To The Class Which Expects A Bitmap As A Parameter?

Nov 15, 2009

i have a bitmap in the library with export name Dots

1. how do i take this and pass it to the class which expects a Bitmap as a parameter? if i load it externally i could say:

[Code]...

View 5 Replies

ActionScript 2.0 :: Evaluate An Item Path From A String With Brackets []?

May 31, 2009

I have an SWF that has a var that is a string called fullpath. Now, if fullpath was "game.item1", How would I evaluate it as _level0.game.item1 in brackets [] rather than _level0.game.item1.Basically, how would I evaluate an item path from a string with brackets []? This is AS 2

View 5 Replies

Actionscript 3 :: Evaluate A Path String Which Contains A Nested Movieclip

Jun 6, 2011

This should be fairly simple but I understand why it doesn't work. I am hoping there is a clever way to do the following: I have a string 'movieclip1.movieclip2' I have a container movieclip - Container. Now to evaluate the string normally I would look something like: this.container['movieclip']['movieclip2']

Because clip2 is a child of movieclip. But I would like to parse or evaluate the string with the dot syntax to read the string as a internal path. this.container[evaluatedpath]; // which is - this.container.movieclip.movieclip2 Is there a function or technique to be able to evaluate that string into an internal path?

View 1 Replies

Flash :: Adobe Flex Page Doesn't Refresh When New Query String / MVC Parameter Entered

Oct 26, 2011

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?

View 1 Replies

Flex :: Convert And String(path Of Image) To A Bitmap Object?

Jan 6, 2011

The solution should be straight forward but I cannot find it, my problem it's that I'm reading a xml, and one of the properties inside the xml it's a Bitmap path(string), when I`m reading this xml I would like to convert this string to a Bitmap Obj so I can use through my MXMLs.

View 4 Replies

ActionScript 3.0 :: Passing Flashvars Into Public Class And Assign This String As Path To XML?

May 29, 2010

I am trying to pass FlashVars into public class EventDispatcher to set the path to data.xml. I need it because the name and path of the xml file will be dynamically created. I need to use Flashvar in order to access the correct path.I was able to pass Flashvar from html page on timeline this way:

Actionscript Code:
var Flashvars:String = LoaderInfo(stage.loaderInfo).parameters.xmlfile;

Then, I was able to use it with new UrlRequest;

Actionscript Code:
var request:URLRequest = new URLRequest(Flashvars);

This method works really good, but this solution only works on timeline.I need to implement this technique in the class. Before I setup a static var for with the path to xml file. I'd like to be able to get FlashVar withing this class and assign this string to 'public static var DATA_XML_URL:String' I have there. This way I can pass Flashwar to the project I already have.

Actionscript Code:
import flash.events.Event;  import flash.events.EventDispatcher;  import flash.display.Sprite;  import flash.display.LoaderInfo;  import flash.display.MovieClip; import flash.display.Stage;public class ConfigManager extends EventDispatcher {

[code]....

View 3 Replies

ActionScript 3.0 :: Pass FlashVars Into Public Class / Assign String As Path To XML?

May 29, 2010

I am trying to pass FlashVars into public class EventDispatcher to set the path to data.xml. I need it because the name and path of the xml file will be dynamically created. I need to use Flashvar in order to access the correct path. I was able to pass Flashvar from html page on timeline this way:

PHP Code:
var Flashvars:String = LoaderInfo(stage.loaderInfo).parameters.xmlfile;
Then, I was able to use it for new UrlRequest;
PHP Code:
var request:URLRequest = new URLRequest(Flashvars);

This method works really good, but this solution only works on timeline. I need to implement this technique in the class. Before I setup a static var for with the path to xml file. I'd like to be able to get FlashVar withing this class and assign this string to 'public static var DATA_XML_URL:String' I have there. This way I can pass Flashvar to the project I already have.

Below is the class where I can implement it:
PHP Code:
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.display.Sprite;
import flash.display.LoaderInfo;
import flash.display.MovieClip;
[Code] ......

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved