ActionScript 3.0 :: Creating A Dynamic URL?
Apr 6, 2009
I am having trouble using the name of given button to determine my loader URL. If my button is called yerBasicButton_bt ... I would like it to utilize a reuseable function to dynamically determine and load a URL named yerBasicButton.swf. In this manner yerBasicButton2_bt would then load a movie named yerBasicButton2.swf, and so on. So the function looks at the instance name of the calling button to determine it's URL.
stop();
unit133bd3ba_bt.addEventListener(MouseEvent.CLICK, getUnitSWF);
function getUnitSWF (e:MouseEvent):void { var swfLoader:Loader = new Loader(); swfLoader.x = 25; swfLoader.y = 368; var swfURL:String = e.currentTarget-"_bt"+".swf" var swfURLReq:URLRequest = new URLRequest(swfURL); swfLoader.load(swfURLReq); this.addChildAt(swfLoader, 0);}
View 11 Replies
Similar Posts:
Dec 16, 2005
Im using this xml "data.xml":
HTML Code:
<XML>
<salesreps>[code]...
I want to generate a mc for each rep with 6 text fields containg the 6 values for eash rep.So for this xml there would be 3 mc's with 6 text fields in each. This is one of my first times really diving in to xml parsing in Flash.
View 3 Replies
Feb 5, 2010
Create a flash application which will be displayed on a web page which will read from a list of text inside an XML file and display them randomly with fade-in fade-out effects and also at random positions.My current approach to the problem is using a Dynamic Text Area which will read from the xml file, however I only got to the stage where the swf will read the xml file. Trying to get the fade effect and the positioning effect is proving very difficult for me.The sample XML I am working with:
<tag>
<tagline>Global Jobs Pact</tagline>
<tagline>Green Jobs</tagline>
<tagline>Decent Work</tagline>[code]......
View 1 Replies
Jan 13, 2010
I have the following code:
var page1:Branch = new Branch();
page1.y = 124;
addChild(page1);
I want to have the value "page1" to be dynamic, along with "Branch". Since there's a number of templates (up to 20), Branch is one of the templates. So it would be nice to use one instance creator. Also, I'm not sure how to get "page1" to be a dynamic value.
The closest to this that I've been able to find is:
star1sp.addChild(this["star"+star1Num]);
except that it doesn't fully address what I want to do. I tried adding in a bunch of "this[load_page]" and "this["page"+curpage]" to my code but had no success. I'm still on the prowl for the answer but wanted to put this out there. It's something I've tried to figure out for some time.
View 11 Replies
Mar 24, 2011
I would like to create a simple 2D interactive grid. The user should be able to increase and decrease the number of axis (both X and Y simultaneously) that compose the grid, and also the scale of the grid itself (Zoom in and Out).
If this goes well enough, I would like to be able to plot graphical content on the grid that visually changes as the grid itself changes. They should, in some way, be linked to one another and correspondingly affected by the same two parameters. This, however, would be a second step. I am more concerned with the base grid model at this point.
View 1 Replies
Mar 26, 2011
I would like to create a simple 2D interactive grid. The user should be able to increase and decrease the number of axis (both X and Y simultaneously) that compose the grid, and also the scale of the grid itself (Zoom in and Out).
If this goes well enough, I would like to be able to plot graphical content on the grid that visually changes as the grid itself changes. They should, in some way, be linked to one another and correspondingly affected by the same two parameters. This, however, would be a second step. I am more concerned with the base grid model at this point.
View 1 Replies
Jan 8, 2010
I got the first part to work. The only problem is when I click any buttons it produces errorTypeError: Error #1009: Cannot access a property or method of a null object reference.at resume_fla::MainTimeline/frame1()not sure what I have to do. All it's supposed to do is when you click a button the target movie clip plays frames 2 - 10 and the previous movie clip plays frame 11 - 20. Not sure what's the problem here.
ActionScript Code:
//variables
var curMC;
[code]......
View 1 Replies
Jul 22, 2010
I know the Post Title is not much explicative but I didn't know how to summarize my problem. Here it is in full version: I'm making a card game, and I have all the vectorial graphics for the cards. I have a class named Deck and one named Card. When I create a new Deck I have this constructor
[Code]...
View 9 Replies
Aug 16, 2010
find the attached files which populatea datagrid dynamically in FLEX 3ename the txt file to mxml
View 1 Replies
May 30, 2011
After a click event I want to dynamically create 2 movieclips with the sequential number in their name, e.g. mc_001 & mv_001 so that I can 'link' them together later on.How can I create a movieclip with a dynamic name?I am trying to use this at the moment:Code:var movieclip["name"+dynamicNumber]:MovieClip = new MovieClip();I can't use an array unless someone can tell me how to access it across multiple classes...
View 6 Replies
Apr 3, 2004
this is a wierd problem I am facing in flash I need to create a dynamic global variable where the variable's name is stored in another variable. say I need to create a global variable , _global.fam , but "fam" is stored in a variable temp="fam";
now how can I declare the global variable 'fam' using the variable temp.
But the loophole here is that after creating the global variable I should be able to access the variable as
View 1 Replies
Aug 24, 2007
im trying to dynamically create buttons...here's an example scenario -> off stage is a movie clip called "originalButton_mc"I want to use a loop to duplicate this movie clip 25 times, and each one should be able to perform a unique onRelease function ex.
Code:
for (i = 0; i<25; i++) {
var newButton_mc = originalButton_mc.duplicateMovieClip("button"+i, i+1);
newButton_mc._y = i*22;
newButton_mc._x = 10;
[code]....
the problem with the above code is that when I click my new buttons it always traces 25...because, clearly - my code is wrong, and the onRelease is getting rewritten for each button - hence its left with the last i ... 25.
View 6 Replies
May 28, 2009
trying to create a menu with submenus (after) but I can't multiply and load the array content in each one item..Just check out my code:
Code:
var links:Array = ["Link1", "Link2", "Link3", "Link4"];
var bt:MovieClip = new button();// from Library
[code]....
View 1 Replies
Sep 7, 2009
I'm about to create a Flash XML web site template.The site functionality should allow the site editor (the person)
-to add and remove new sub pages
-to edit pages contents
-to add and remove auto-scalable site multilevel menu items
What is the best way to do this? Where I can find guidance (tutorials or something like that) on building a full-scale, dynamic xml site?
View 1 Replies
Dec 2, 2009
I have a xmlfile with some node. I need to create an object of my class for each node. I knoz how to parse xml and get value, no problem here, but I can' create dynamic object with dynamic name...
Here's my class code:
public class Simple_Forum_MV extends MovieClip{
public function Simple_Forum_MV(MV_name:??,title_forum:String,description_forum:String) {
MV_name:MovieClip = new MovieClip();
MV_name.width = 500;
MV_name.height = 50;
View 1 Replies
Jun 22, 2010
Is there a way to make dynamic var names? Cant remember how to do this.
Something like:
NameCount = 1;
Obj.eval("Item" + NameCount)) = "hello world";
Obj.Item1 // trace "hello world"
View 3 Replies
Jan 7, 2004
I'm creating a dynamic menu with XML, and this is part of my code. I've written in the code what the problem is:
[AS]
menuXml = new XML();
menuXml.ignoreWhite = true;
menuXml.onLoad = function(success) {
[Code]....
View 2 Replies
Oct 5, 2010
I would like to know if its possible to create a background flash that is dynamic while keeping the bars static?for an example checkI would like someone to build a home page for me to be exactly like the samsung site above except using my images. Is this possible?
View 1 Replies
Oct 5, 2010
I have several clips in the library:
MCA1
MCA2
MCA3
....
MCA100
Each with "export for actionscript" checked, and mathcing classnames.
I want to create an instance of each - and add to the current stage. I need to do this:
PHP Code:
var clipA1:MCA1 = new MCA1();
var clipA2:MCA2 = new MCA2();
var clipA3:MCA3 = new MCA3();
[Code].....
View 1 Replies
Apr 6, 2009
the error I recieve i:Instantiation attempted on a non-constructor.
Relevent Code:
private var hoverText:MovieClip;
private function createTexts():void{ for (var i:Number=0;
[code].....
View 4 Replies
Sep 10, 2009
I need to create 5 buttons which looks the same, and each one of them has a picture on it.
I created a button symbol, named it and created linkage to AS. I also created a MovieClip that holds the picture I want to put on top of the button and created a linkage.
Then in the code I create two instances and display them
[Code].....
View 2 Replies
Jan 22, 2011
I need to create flash interactive animation for one one of my regular clients, which should look and work similar to example in Nike store Customize:LinkThis is how my clients product (shirt) should look like and what sections should be editable: [URL]Basically it should work this way:1. End user chooses some element of shirt which he would like to edit (for example collar)2. When he clicks on that element, popup windows shows offering two main options: to change color and graphic (texture or pattern), same as on nike store customize example3. After user changes one section (collar) he goes to other section (lets say sleeve) and so on4.
User should be able to zoom in or zoom out that shirt and also if it is possible to rotate it in 4-5 positions5. At the end it should be able to save that work (and load it if he wants to later ) and be able to print it.I have made many animations, games, banners and similar using Macromedia Flash MX and Adobe Flash so I am not a flash newbie but this is a first time I am dealing with this type of work. I know that there is no step by step tutorial for this kind of custom interactive animation but I need some help and and advice how to create these three first steps (1. 2. 3). Regarding steps (4.) and (5.) I think I could realize it (zoom in, zoom out, rotate movieclip, save in database and print screen), because I ahd some previous experince regarding this part.
View 22 Replies
Jan 19, 2011
I'm having problems creating dynamic tabs here's my code:
[Code]...
View 1 Replies
May 14, 2010
I'm loading a set of images and text from an XML file.I have the images loading into empty MovieClips created dynamically using 'createEmptyMovieClip', and I can get the text into dynamic textboxes that already exist on the timeline, but this isn't exactly what I want.
What I wan't to do, is to pull the text from the XML directly into dynamic textboxes at runtime, in the same way as the images.I've read today about 'createEmptyTextField', but I can't get it to work.
View 3 Replies
May 20, 2010
I want to create an event handler dynamically, which will use certain parameters passed at the time of function creation as well as the event parameter passed at the time of the event firing.For example, the function would be created something like this:
ActionScript Code:
function createDataInput (ref:String, label:String):DataInput
{
[code]........
View 5 Replies
Jun 11, 2005
I refer to this tutorial: [URL]
i'm creating a calculator similar to the one Kirupa creates on the first page. I think I've just about got my head around calling functions, but I want the calculation output text box (text_answer) to change dynamically, as you change the values in the variable text boxes. i.e. I don't want to have to hit the submit button each time the values are changed.
how would I go about making a change to the code to do this? I've tried lots of methods but seem to be going round in circles on something that must surely be pretty simple..
View 6 Replies
Aug 21, 2006
I am working on a navigation for a page that consists of an image container, a text block, and a navigation. I have all the content in an xml file that is loaded and parsed placing each part of the site in its respectable spot. My question is I need to have the data for this site change when a button in the nav is pressed, so that the image and desc content is passed that corresponds to its button. this is in flash 8, as 2.0.
[Code]...
View 1 Replies
Jan 15, 2008
I have done some (like 2 hours worth) research and have come up short, so while I browse the forums for a bit more help Basically what I'm trying to do is create a number of variables, depending on how many items are in an xml document.For example, I am running a for(){} loop to pull all the data I need out, and I would like to store it in the format:photo1.filename = whatever; photo1.value2 = whatever;
and so on. All the object property names (filename, value2 in the example) would be the same (obviously the values would be different), but I need the number of objects (photo1 in the example) to depend on how many nodes are in the xml document.
View 7 Replies
Feb 5, 2009
how to create the same effect?I mean: how to resize and rearrange the bubbles so that they do not overlap?In this application only the sizes and colors are dynamic from XML and the bubbles are placed an a relativ x and y when the application starts. How do they rearrange so they don't overlap?
View 14 Replies
Aug 13, 2009
I'm working on a particle emitter, and I want to be able to pass in custom sprites (one for smoke, one for fire, et cetera). They are instanced on in the library as separate classes, but I want to be able to call a function like, "ParticleEmitter.SetSprite(Smoke)", then have it start creating instances of the smoke class.
The problem is, I don't know how to pass in a class name as an argument or how to use it to create copies. Is there any way to do this, or would it be best if I just put all my different particles inside a MovieClip and set the frame for each one it created?
View 6 Replies