Dynamic URL
How do you assign a dynamic url to a button so it will load the URL from an external UTF8 txt file?
I would like to be able to change the link in my text file without having to edit the fla file (button that open a new window).
FlashKit > Flash Help > Flash MX
Posted on: 11-10-2002, 04:46 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
- Free Flash Source For Dynamic Slideshow With Automatic Thumnbails And Dynamic Text?
- Dynamic Window Shopping Using Tween Class : Unable To Load Dynamic Data
- Dynamic Vars, Dynamic Paths Using Variables And External Text Files
- Mouseless, Autoscrolling, Dynamic Tweening, Dynamic Text...
- Dynamic JPGS, Dynamic Images, Load Image
- Creating Dynamic Links Inside Of Dynamic Menus
- Dynamic Aligning Input And Dynamic Text Box (flash 5 / 6)
- Dynamic Mask For Dynamic Text Won't Working Any Body Pls Help
- Dynamic Text : Dynamic Height (depending On Content)
- Dynamic Text Within Dynamic Movie Clip Loops
- Accessing Dynamic Text Within Dynamic Added Movieclip.
- Dynamic Text Field Receiving Dynamic Variables...
- Dynamic Multiple Choice Quiz - How To Make It Dynamic
- XML Loading, Dynamic Buttons, Dynamic Text Fields...
- Dynamic Video Playlist And Dynamic Text Articles
- [Flash 8] Dynamic Movieclips With Dynamic Movie Clips : Help
- Dynamic Length Of Dynamic Of Text Field?
- Problem With Dynamic Links Attached To Dynamic MC's
- Making Dynamic Text Field Var, More Dynamic?
- Dynamic Text Fields In A Dynamic Menu
- Dynamic Text Field - Dynamic Size
- Dynamic Textbox _y Per Dynamic Line Breaks
- Looping Over Dynamic Variables And Creating Dynamic Mcs
- How To Load Dynamic Text According To Dynamic Image?
- Arrrrrrg Dynamic Objec With Dynamic Variable
- Dynamic Text; Dynamic Gradient Fill
- Dynamic Buttons For A Dynamic Menu - Flash_8
- [F8] Dynamic Drawing And Dynamic Mask Problems
- Creating Dynamic Buttons With Dynamic Behaviours...
- Edit Dynamic Text To Dynamic Textfield
- Dynamic X_ Propert For Dynamic Text Fields
- Setting Dynamic Text With Dynamic Path's
- Calling Dynamic Content From Another Dynamic Field
- Dynamic Text In Dynamic Movie Clip
- Dynamic Text Under Dynamic Mask W/ MS+ Scroller.......
- Dynamic Button With Is Dynamic Code(links)
- Dynamic Link Inside Of Dynamic Menu
- Placing A Dynamic Text Box Just After The First Dynamic Txtbox
- Dynamic Text Feild With Dynamic Scroll Bar
- Creating Dynamic Text Fields Within Dynamic Mc
- Creating Dynamic Tooltip For Dynamic Text
- Dynamic Calling Of Functions With Dynamic Parameters.
- Banner, Dynamic Text, Dynamic Images.
- Flash Dynamic Menu W/ Dynamic Content
- Dynamic Text In The Dynamic Sense
- Dynamic Text With Dynamic Size
- Dynamic Text And Dynamic Image
- The Height Of A Dynamic TextField Dynamic?
- Dynamic Sizing Of Dynamic Text Box
- Dynamic Reference To Dynamic Text?
Dynamic Window Shopping Using Tween Class : Unable To Load Dynamic Data
hi guys, i am a newbie here and in flash too. I've learnt ActionScript basics from this forum and i hope i get a solution for my problem.I am doing this window shopping gallery for my company but iam stuck in the middle of nowhere.I am attaching the files so that u can have a look at it. the gallery is xml driven.
when a user hovers to the left side of the gallery tween starts and the stores move in a perspective angle. i am placing the code here for xml loading which is in 1st frame
ActionScript Code:
stop();
var tracker:Number = 0;
var total:Number;
var totProd:Number;
var storeId:Array = [];
var storeName:Array = [];
var storeLogo:Array = [];
var storeDesc:Array = [];
var pcode:Array = [];
var price:Array =[];
var pdesc:Array =[];
function loadXML(loaded) {
if (loaded) {
rootNode = xmlData.firstChild;
total = rootNode.childNodes.length;
//trace("total "+total+" stores");
//trace("-------------------------Description---------------------");
for (i=0; i<total; i++) {
storeId[i] = rootNode.childNodes[i].attributes.sid;
storeName[i] = rootNode.childNodes[i].attributes.sname;
storeLogo[i] = rootNode.childNodes[i].attributes.slogo;
storeDesc[i] = rootNode.childNodes[i].attributes.sdesc;
totprod = rootNode.childNodes[i].childNodes.length;
//trace("Store ID : "+storeId[i]);
//trace("Store Name : "+storeName[i]);
//trace("Store Logo : "+storeLogo[i]);
//trace("Store Desc : "+storeDesc[i]);
//trace("Products in Store : "+totprod);
for (j=0; j<totprod; j++) {
pcode[j] = rootNode.childNodes[i].childNodes[j].attributes.pcode;
price[j] = rootNode.childNodes[i].childNodes[j].attributes.price;
pdesc[j] = rootNode.childNodes[i].childNodes[j].attributes.pdesc;
//trace("Product Code : "+pcode[j]);
//trace("Price : "+price[j]);
//trace("Product Desc : "+pdesc[j]);
}
//trace("______________________________________________________");
//trace("------------------------------------------------------");
}
} else {
trace("unable to load XML file");
}
}
_root.prloadr_mc.onLoad = function() {
total = getBytesTotal();
};
_root.prloadr_mc.onEnterFrame = function() {
loaded = getBytesLoaded();
if (loaded>=total) {
_root.gotoAndStop(2);
}
};
var xmlData:XML = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("windowshopping.xml");
and in the second frame the code is as follows:
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
_root.store1_mc.dyn_txt.text = tracker;
_root.store2_mc.dyn_txt.text = tracker+1;
_root.store3_mc.dyn_txt.text = tracker+2;
_root.store4_mc.dyn_txt.text = tracker+3;
var initial:Boolean = true;
_root.enter_mc._visible = false;
_root.backward_btn.useHandCursor = false;
var t1:Tween = new Tween(_root.store1_mc, "_x", None.easeNone, 645.7, 1394.1, 1.5, true);
t1.stop();
var t2:Tween = new Tween(_root.store1_mc, "_y", None.easeNone, 363.9, 335.7, 1.5, true);
t2.stop();
var t3:Tween = new Tween(_root.store1_mc, "_width", None.easeNone, 548, 1009.2, 1.5, true);
t3.stop();
var t4:Tween = new Tween(_root.store1_mc, "_height", None.easeNone, 644.4, 1186.5, 1.5, true);
t4.stop();
var t5:Tween = new Tween(_root.store2_mc, "_x", None.easeNone, 240.9, 645.7, 1.5, true);
t5.stop();
var t6:Tween = new Tween(_root.store2_mc, "_y", None.easeNone, 379.8, 363.9, 1.5, true);
t6.stop();
var t7:Tween = new Tween(_root.store2_mc, "_width", None.easeNone, 298.4, 548, 1.5, true);
t7.stop();
var t8:Tween = new Tween(_root.store2_mc, "_height", None.easeNone, 350.8, 644.4, 1.5, true);
t8.stop();
var t9:Tween = new Tween(_root.store3_mc, "_x", None.easeNone, 15.7, 240.9, 1.5, true);
t9.stop();
var t10:Tween = new Tween(_root.store3_mc, "_y", None.easeNone, 390.1, 379.8, 1.5, true);
t10.stop();
var t11:Tween = new Tween(_root.store3_mc, "_width", None.easeNone, 174.3, 298.4, 1.5, true);
t11.stop();
var t12:Tween = new Tween(_root.store3_mc, "_height", None.easeNone, 188.8, 350.8, 1.5, true);
t12.stop();
var t13:Tween = new Tween(_root.store4_mc, "_x", None.easeNone, -113.7, 15.7, 1.5, true);
t13.stop();
var t14:Tween = new Tween(_root.store4_mc, "_y", None.easeNone, 394.9, 390.1, 1.5, true);
t14.stop();
var t15:Tween = new Tween(_root.store4_mc, "_width", None.easeNone, 95.9, 174.3, 1.5, true);
t15.stop();
var t16:Tween = new Tween(_root.store4_mc, "_height", None.easeNone, 103.8, 188.8, 1.5, true);
t16.stop();
function myTween() {
t1.start();
t2.start();
t3.start();
t4.start();
t5.start();
t6.start();
t7.start();
t8.start();
t9.start();
t10.start();
t11.start();
t12.start();
t13.start();
t14.start();
t15.start();
t16.start();
}
function myTweenRepeat() {
_root.store1_mc.dyn_txt.text = tracker;
_root.store2_mc.dyn_txt.text = tracker+1;
_root.store3_mc.dyn_txt.text = tracker+2;
_root.store4_mc.dyn_txt.text = tracker+3;
t1.start();
t2.start();
t3.start();
t4.start();
t5.start();
t6.start();
t7.start();
t8.start();
t9.start();
t10.start();
t11.start();
t12.start();
t13.start();
t14.start();
t15.start();
t16.start();
}
function myTweenStop() {
trace("Stopped");
t1.stop();
t2.stop();
t3.stop();
t4.stop();
t5.stop();
t6.stop();
t7.stop();
t8.stop();
t9.stop();
t10.stop();
t11.stop();
t12.stop();
t13.stop();
t14.stop();
t15.stop();
t16.stop();
}
function myTweenResume() {
trace("Resumed");
t1.resume();
t2.resume();
t3.resume();
t4.resume();
t5.resume();
t6.resume();
t7.resume();
t8.resume();
t9.resume();
t10.resume();
t11.resume();
t12.resume();
t13.resume();
t14.resume();
t15.resume();
t16.resume();
}
_root.forward_btn.onRollOver = function() {
if (initial) {
trace("Initial");
myTween();
} else {
trace("Resuming...............");
myTweenResume();
}
t1.onMotionFinished = function() {
tracker++;
trace("Repeat");
myTweenRepeat();
};
_root.forward_btn.useHandCursor = false;
_root.leftarrow_mc._visible = false;
_root.enter_mc._visible = true;
_root.enter_mc.gotoAndPlay("s2");
_root.tooltip_mc.gotoAndPlay("s1");
initial = false;
};
_root.forward_btn.onRollOut = function() {
myTweenStop();
_root.leftarrow_mc._visible = true;
_root.tooltip_mc.gotoAndPlay("s2");
_root.enter_mc.gotoAndPlay("s1");
};
the problem is, I cant change content in store dynamically.
please anyone help me out from this situation. i will be waiting for replies.
Thanks in advance.
Dynamic Vars, Dynamic Paths Using Variables And External Text Files
Hi there,
first off, apologies for the long post, but its a tricky problem to explain... and on my first post too! (sorry )
Im have a bit of bother with flash calling variables from a text file, and using them to make paths to other variables, and to control the amount of time a duplicate clip occurs. The first of these 2 problems is this:
Im loading a text file "content.txt" into _root. (this works fine)
it contains the variables:
webclipcount=2
&webhenry=hello hello
&webbutton01=henry
on the main timeline I have this button
on(press){
sectiontitle="web"
clipcount=webclipcount
}
there is a text box on the main timeline with variable name of bodycopy.
on a clip on the main timeline I have this;
onClipEvent (enterFrame) {
if (num< _parent.clipcount) {
duplicateMovieClip(thebutton, "button"+depth, depth);
this["button"+depth].name = _parent[_parent.sectiontitle+"button"+num];
this gives button01 the name henry- this works.
on the duplicated clip I have these actions:
on(mouseDown){
_parent._parent.bodycopy=_parent._parent[_parent._parent.sectiontitle+this.name]
}
so we end up with a path like:
_parent._parent.bodycopy=_parent._parent.webhenry
and it in turn should make the textbox on the main timeline contain "hello hello"
but it doesnt.
also for the duplicating clip, unless i use:
onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>
it wont work either. it seems neither can be dynamic/ pulled from the text file. (well, i can get them to work!)
If I use direct paths like:
on(mouseDown){
_parent._parent.bodycopy="bloody hell it works!"
}
and
onClipEvent (enterFrame) {
if (num< 2) {.....
<snip>
it works, but not if they are dynamicly set from the txt file...
Anyone care to shed some light onto this? its doing my head in!
thanks in advance or the help.
cheers,
chris
Mouseless, Autoscrolling, Dynamic Tweening, Dynamic Text...
I am having the darndest time finding help on this even though it seems like a common task (ok done venting)
What I need is this:
A dynamic text field (from txt file) that will autoscroll vertically. I know that I can do this by motion tweening a movie clip containing my dynamic text, but heres the thing: this source txt file will be updated daily (daily events). Some days it will be a few lines of txt (no scrolling necessary). Some days it may be 500 or more lines of text. So simply motion tweening my movie clip a fixed speed and distance will not work. I need the scroll speed, text box size, and scroll distance to be dynamic.
Please help us. The hack that made our kiosk made it almost impossible to open, so it takes me forever to open it and i don't want to do that every day... oh, you didn't need to know that, sorry.
An .fla or a tutorial would be a huge help as I am not action script savy, yet.
Thanks in advance!
Dynamic JPGS, Dynamic Images, Load Image
Just a little not for those who have problems using dynamic loaded jpgs.
If you want to dynamically load some jpgs here is some code I picked up off the forum
Code:
//Step1
createEmptyMovieClip("img",0);
img._visible=false;
//Step2
img.loadMovie("test.jpg");
//Step3
this.onEnterFrame=function(){
BLoaded=img.getBytesLoaded();
BTotal=img.getBytesTotal();
percent=BLoaded/BTotal*100;
//Step4
if(BLoaded == BTotal && BLoaded>0){
img._width=726;
img._height=641;
img._visible=true;
delete this.onEnterFrame;
img._x=0;
img._y=0;
}
}
When you save your JPG in photoshop it gives you a few options for saving your jpg.
1) BASELINE (STANDARD)
2)BASELINE (OPTIMIZED)
3)PROGRESSIVE
It has to be a baseline image, for whatever reason. No clue!
Creating Dynamic Links Inside Of Dynamic Menus
hello, I am having a problem adding links dynamically inside of a menu that was created dynamically. Look here to see the movie. All of the menus are created dynamically with a for loop iterating through an array. As each menu is created I want the links to be created also. For this i have used nested for loops. My problem is labeling the link text. Here is all of my code.
code:
stop();
function default_location(){
topX = 10;
topY = 5;
bottomX = 10;
bottomY = 590;
bar._x = topX;
bar._y = topY;
}
default_location();
//number of menus
var numMenus = 6;
var menuTop = new Array();
var locationY = 5;
var locationX = 10;
//define the menu headings
var top0 = "New Home Buyer Program";
var top1 = "Franchise Opportunities";
var top2 = "Broker/Realtor Program";
var top3 = "Mortgage Broker Program";
var top4 = "Home Builder Program";
var top5 = "Company Info";
var menu0 = new Array();
//New Home Buyer Program Menu Items
menu0[0] = ["Get the Home of Your Choice Now", "www.nhba.com"];
menu0[1] = ["The NHBA Application Process", "www.nhba.com"];
menu0[2] = ["Find an Office", "www.nhba.com"];
menu0[3] = ["Complete an Application", "www.nhba.com"];
menu0[4] = ["Check the Status of Your Application", "www.nhba.com"];
menu0[5] = ["Available Property Specials", "www.nhba.com"];
//Franchise Opportunity Menu Items
var menu1 = new Array();
menu1[0] = ["The NHBA Franchise Experience", "www.nhba.com"];
menu1[1] = ["NHBA for the Franchisee", "www.nhba.com"];
menu1[2] = ["Exclusive Tools and Technology", "www.nhba.com"];
menu1[3] = ["FAQ's/Resources", "www.nhba.com"];
menu1[4] = ["Franchise Facts", "www.nhba.com"];
menu1[5] = ["Discovery Days Registration", "www.nhba.com"];
menu1[6] = ["Franchise Testamonials", "www.nhba.com"];
menu1[7] = ["Apply to be a Franchsie", "www.nhba.com"];
//Broker/Realtor Program Menu Items
var menu2 = new Array();
menu2[0] = ["What Brokers & Realtors Need to Know", "www.nhba.com"];
menu2[1] = ["NHBA for the Realtor", "www.nhba.com"];
menu2[2] = ["Request Information", "www.nhba.com"];
//Mortgage Broker Program Menu Items
var menu3 = new Array();
menu3[0] = ["What Mortgage Brokers Need to Know", "www.nhba.com"];
menu3[1] = ["NHBA for the Mortgage Broker", "www.nhba.com"];
menu3[2] = ["Request Information", "www.nhba.com"];
//Home Builder Program Menu Items
var menu4 = new Array();
menu4[0] = ["What Homebuilders Need to Know", "www.nhba.com"];
menu4[1] = ["How Lease-to-Own Works for You", "www.nhba.com"];
menu4[2] = ["Request Information", "www.nhba.com"];
//NHBA Company Info Menu Items
var menu5 = new Array();
menu5[0] = ["Company Overview", "www.nhba.com"];
menu5[1] = ["Contact Us", "www.nhba.com"];
menu5[2] = ["Management Team", "www.nhba.com"];
menu5[3] = ["Corporate Media Kit", "www.nhba.com"];
menu5[4] = ["What People are Saying", "www.nhba.com"];
menu5[5] = ["Pride in Partnership", "www.nhba.com"];
menu5[6] = ["Privacy & Security Policies", "www.nhba.com"];
menu5[7] = ["Site Map", "www.nhba.com"];
var numMenusLeft = numMenus;
//Create the Menus
for(i=0; i < numMenus; i++){
bar.duplicateMovieClip("bar"+(i), i+1);
_root["bar"+(i)]._y = locationY; //sets the initial location
locationBottom = bottomY - (28*numMenusLeft);//sets the bottom location
menuTop[i] = [locationY,locationBottom,_root["top"+(i)]];//assigns the menuTop array with the instance info
_root["bar"+(i)].menuName_txt = menuTop[i][2];
_root["bar"+(i)].name = "bar"+(i);
_root["bar"+(i)].id = i; //assigned id as array index (id = 0, 1, 2....)
_root["bar"+(i)].up = true;
locationY += 28; //increment locations for next menu
numMenusLeft-=1;
var len = _root["menu"+(i)].length;
//trace(len);
var linkY = 45;
var obj = new Array();
x = i;
for (j=0; j<len; j++){
//THIS IS THE PART THAT IS NOT WORKING
obj[j] = _root["bar"+(i)].link.duplicateMovieClip("link"+(j), j);
//_root["bar"+(i)].createEmptyMovieClip("mc"+j, j);
//["mc"+(j)].createTextField("txt", j, 0, linkY, 130, 40);
trace(obj[j]);
//IT DOESNT ASSIGN THE TEXT TO THE LINK
obj[j].link_button.link_text.text = _root["menu"+(i)][j][0];
obj[j]._y = linkY;
linkY += 30;
}
_root["bar"+(i)].link._visible = false;
//trace(obj.length);
for (k=0; k<obj.length; k++){
trace("Link:"+k+obj[k]);
}
}
_root.bar._visible = false;
function moveMenus(button_id){ //button id is coming in as the array index (0,1,2...)
//loop through all of the menus
for (i=0;i<=(menuTop.length - 1); i++){
if(i<button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if(i == button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if (i>button_id){
if (_root["bar"+(i)].up == true){
easeDown(i)}
}
}
}
/*This is how to use the MX easing tween:
var tabUp = new mx.transitions.Tween(movieClip, "_y", mx.transitions.easing.Bounce.easeOut, beginCordinate, endCordinate, time);
*/
function easeUp(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][1], menuTop[menu][0], 12);
_root["bar"+(menu)].up = true;
}
function easeDown(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][0], menuTop[menu][1], 24);
_root["bar"+(menu)].up = false;
}
Any help would be MUCH appreciated.
Dynamic Mask For Dynamic Text Won't Working Any Body Pls Help
Im' supposed to make a scrollable gridlike simulation with using MC. Inside that MC there are dynamic text area as cell in which its text will be updated dynamically.
Now i have a strange prob that when i use setMask to mask that grid MC it won't working
I have the MC name 'grid'
above that another MC name 'msk'
code is like tha
grid.setMask("msk");
it only shows the full grid instead of masking area.
Dynamic Text : Dynamic Height (depending On Content)
Hi people.
Im working on a website, and in some part there is a dynamic text space that sets its width depending on the resolution.
But well, I want the text to be sitting downside of my webpage. For this (I guess) I need to set the height of the space to its contents, so that I can use the textspace height as a unit, for putting it to the ground
(myTextSpace.y=stage.StageHeight - myTestSpace.height)
But well, I do not know, if there is any way to set the textspace height to its contents.
I hope I'm clear, thank you.
Dynamic Text Within Dynamic Movie Clip Loops
Ok my predicament. I am trying to create thumbnails, but instead of using pictures as the thumbnails I would like to have text, formatted blah blah for people to select. Now the code I am trying to adapt is fine and dandy to get working with pictures, so I know the part of this code that creates the movie clip is fine. However I cannot seem to dynamically create the text boxes within the movie clips. I need to have them within the movie clips so the opacity will change when they are hovered over.
Code:
currentName = "t"+k
thumbnail_mc.createEmptyMovieClip(currentName, thumbnail_mc.getNextHighestDepth());
thumbnail_mc.currentName.createTextField("text"+cu rrentName, thumbnail_mc.currentName.getNextHighestDepth(), 0, 0, 244, 28)
thumbnail_mc.currentName.text="test"
k will be changing anyway for each time through taht a movie clip is made hence why they will need different names.
Any help...hope this can be understood.
Accessing Dynamic Text Within Dynamic Added Movieclip.
Hi there.
I'm trying to access and change a dynamic text field within a dynamically added movieclip.
This is how I'm trying to accomplish that;
ActionScript Code:
uButton = attachMovie("_button",arr_videos[i][1], ++uDepth);
uButton._x = uButtonStartX;
uButton._y = uButtonStartY + uButtonDistance * uDepth uButton.btn_name.text = "button name";
btn_name is the name of the dyn. textfield.
But this does nothing.. What am I doing wrong?
Thanks for your help
Samuel
Dynamic Text Field Receiving Dynamic Variables...
or something like that . . .
This is my problem: I'm generating _global variables via XML. Each variable represents different types of copy, of varying lengths. For Example:
_global.introduction = xmlDoc_xml.firstChild.firstChild.nodeValue;
_global.body = xmlDoc_xml.firstChild.firstChild.firstChild.nodeVa lue;
_global.summary = xmlDoc_xml.firstChild.firstChild.firstChild.firstC hild.nodeValue;
I want to create ONE text field, with scrolling, that will act as a template to house all types of content. I've assigned a variable that equals "content" to this text field. . . My problem is, I can't get the text field variable (content) to dynamically swap for the global variable (_global.introduction) in order to display the proper content.
This seems simple, but something's not working for me. Any thoughts? . . . BIG thanks in advance!
Dynamic Multiple Choice Quiz - How To Make It Dynamic
Hi all,
I'm a programming-in-Flash-other-than-basic-stuff-newbie and would appreciate any help on a project I need done this week. I've been using the multiple choice quiz template. It's for an online pop trivia game using covers. Here's the basics:
You see three pictures and pick one of them. You are taken to a question about the cover. You answer it and your right or wrong choice tally starts. You are then taken to the "choose a cover from the 3 pics" screen again. Only this time the picture you have chosen is replaced by another picture so that there are the two pics that were up already that you didn't choose and 1 new one. You choose one of the 3 and answer it. The process continues for around 10 questions.
I'm thinking of a data pool of about 20 pics with each pic attached to one question which I can use the multiple choice componant for.
Any suggestions?
Please look here: http://www.sircuss.com/test/otcquiztest.swf
sircuss
XML Loading, Dynamic Buttons, Dynamic Text Fields...
My last thread kind of died, I guess, so here's another one that I hope will get me some help; it has an updated FLA attached and what I think to be some better descriptions of my problems... I know I'm totally indebted to whomever will help, but this is an emergency and I need some timely advice.
so here's the FLA, XML, and some sample images: kirupaTest2.zip
1. I pretty much have the enlarged pictures loading I guess, which was my major problem before, but it doesn't matter because I can't get the code to "know" which of the dynamic thumbnails has been clicked (by "know", I mean return an index value, say 0 through 7 if there are 8 projects, that I can use to access that particular project in the array of 8 projects in the rest of the code)... So if the third movieclip thumbnail were clicked, I'd like "2" to come up somehow... I've tried this code, which is kind of lame, I know, based off of the idea of each of the thumbnail movieclips' names ending in their index number:
ActionScript Code:
//"this" is the button that was pressed; would return a string ending in//thumberMC_<number of whichever movieclip thumb was clicked>var: testString:String = this; //storing how many characters are in the string above...var: stringNumb:Number = testString.length;//using that value to take off the last string (hopefully the number)var: finalString = testString.charAt(stringNumb);
And that didn't work. (The code above was entered around line 71 in the layer "actions"; it's gone now)
2. An even bigger problem is I have some containers being drawn dynamically from height and width values pulled from an XML file. When I test the code that creates the objects using hard-coded values, it works fine; say if I put 481 in for the width and 375 for the height. But if I try to do it (sort of) dynamically like:
ActionScript Code:
var picHeight:Number = projects[5].bigPics[0].picHeightvar picWidth:Number = projects[5].bigPics[0].picWidth
it gets all screwed up; please try it for yourself in the supplied FLA. It's hard to describe what goes wrong; some things are drawn, and others aren't. I think it's because the objects are trying to draw before they have the data to draw with. This can be seen at lines 129 and 130.
3. Lastly, there's a dynamic textfield I'm trying to create that never shows up for some reason. Again, you could see in the FLA (in the "createDrawer" function around line 424).
If I can clarify, please let me know.
Dynamic Video Playlist And Dynamic Text Articles
Hi all, hope you can help me..?
I have the task of creating a Dynamic Video Playlist to be incorporated in a FLASH 8/HTML site. The site owner should then be able to upload their recorded videos. The client will be using a low budged camera. I am planning to suggest a video format to the client that will suit me best.
In addition I also need to create a section where text articles will be posted by the site owner.
I am a beginner in Actionscript 2.0, and I have Flash 8 installed in my PC.
Can anyone recommend some FLA source files to get me started, and a tutorial? I've seen some tutorials, but they are either too complicated or don't attend my needs.
Many thanks!
[Flash 8] Dynamic Movieclips With Dynamic Movie Clips : Help
Hello, is there a way to:
1. create an empty movieclip (zone1)
2. create a movieclip in zone1 (zone1.contentMC)
3. create an empty mask movieclip in zone1 (zone1.maskMC)
4. draw a filled rectangle into zone1.maskMC
5. set the zone1.maskMC as the mask for zone1.contentMC
6. load content at any time into zone1.contentMC
I just spent 15 minutes putting together a post only to have it say I was not logged in (session timeout I guess).. lost the post data on backspace. Here is the code I'm working with.. as you can see with the comments I've been at this for a while. I want to iterate through zone array.. setup empty movies.. then a contents and mask movie inside each movie, draw a rectangle in the mask movie and then set the mask before I put contents into the content MC.
Code:
stop();
var colorArray:Array = new Array("0xFF0000", "0x0000FF", "0x00FF00");
function drawRec(endX, endY, targetMovie:MovieClip) {
trace("drawing a mask in "+targetMovie+" with "+endX+", "+endY);
rndColor = Math.round(2*Math.random());
targetMovie.beginFill(colorArray[rndColor], 100);
targetMovie.moveTo(0, 0);
targetMovie.lineTo(endX, 0);
targetMovie.lineTo(endX, endY);
targetMovie.lineTo(0, endY);
targetMovie.lineTo(0, 0);
targetMovie.endFill();
}
function makeZones() {
atZone = 0;
for (zones in zoneArray) {
// create zone movie
this.createEmptyMovieClip("zone"+atZone, this.getNextHighestDepth());
// move new zone to it's correct x and y
this["zone"+atZone]._x = zoneArray[zones][0];
this["zone"+atZone]._y = zoneArray[zones][1];
// create contentMC
this["zone"+atZone].createEmptyMovieClip("contentMC",1 );
trace(this["zone"+atZone].contentMC);
// create Mask
this["zone"+atZone].createEmptyMovieClip("maskMC", 2);
trace(this["zone"+atZone].maskMC);
//draw Mask
drawRec(zoneArray[zones][2], zoneArray[zones][3], this["zone"+atZone].maskMC);
contentMC.setMask(maskMC);
loadMovie("images/0.jpg", contentMC);
//set the mask for the zones contentMC
atZone++;
}
}
var zoneArray:Array = new Array();
zoneArray[0] = (Array(0, 0, 250, 250));
zoneArray[1] = (Array(250, 0, 500, 250));
zoneArray[3] = (Array(0, 250, 500, 500));
//trace(zoneArray[0][0]);
makeZones();
Dynamic Length Of Dynamic Of Text Field?
is it possible to set the length of a dynamic text field so that the text flowed into it fits perfectly.
I need this so that I can get the _width of the movie clip it sits in.
help appreciated guys.
Problem With Dynamic Links Attached To Dynamic MC's
My question is a little hard to explain (but I'll do my best) so I have added a link to my source files below for you to look at.
OK, I am working on the logic for a much larger project and I am about 95% of the way there. Basically what I am doing is loading a text file that contains variable information and then breaking that into arrays based on which category the user chooses. Once the user clicks on a category the array for that selection is broken apart and read. It then loads (dynamically) an image (whose name comes from my array) into the "holder" mc, sets it's link to an external HTML page, determines how many sub-buttons (based from the array) are needed and then populates them in their own emptyMovieclips inside another mc called "buttons" and gives each of them a unique link (also generated from the array) that changes the image in the holder "mc". This is where my problem is occurring, for some reason it is assigning the link of the last attached sub-button in the group to all of the other sub-buttons in the "buttons" mc. For the life of me I cannot figure out why, they should each have a unique link. Hopefully some fresh eyes can shed some light on this. Frame 5 is the gut of the code, any help would be greatly appreciated.
Thanks
Here are the source files:
http://www.icandraw.com/source.zip
Dynamic Text Fields In A Dynamic Menu
Anyone can advise how to give names(i.e home,service...) for textfields in a dynamic drop down menu instead of getting the original sequence (ie. text0,text1,text2) or button1,button2,etc...Help please
Dynamic Text Field - Dynamic Size
Hi all
I am trying to do a tooltip that loads a var from database into
a dynamic text field
This I want to customize with a backgrund movie
pls see my illustration!
Because I dont want to have a static size of the background movie
I hope there is a way to make it scale to the textfield
All Ideas welcome
Have a Nice day
Flemming
Dynamic Textbox _y Per Dynamic Line Breaks
I would like to feed variable character lengthed text data to text boxes in my dynamically placed buttons (touch screen kiosk). In my movies i am reading from either xml or db via FSP. I want the text in the text boxes (which label the buttons) to aways be centered in the button graphic, no matter how many lines. I imagine i would set up a conditional and set the _y of the text field per the amount of new line breaks that were dymically created by means of which are still a mystery to me..
Is there a way to achive this without manually adding "
" or whatever your prefered linebreaker is? I've done very similar things, but i've aways had to manually build and associate an array in flash to assure appropriate line breaking. Now i'm dealing with many hundreds of buttons and existing data (such as the strings i would like to label the buttons with)
this is one of, if not the last hurtle for me as far as how dynamic i want my projects to be...! please help!
btw, im using FlashMX
Looping Over Dynamic Variables And Creating Dynamic Mcs
Hello. I have a flash app I'm working on where I'm loading in content from an xml file, then dynamically creating mcs to create an mc for each item in the xml results. Then loading images in to the mcs.
If I don't do a loop and just do it manually, repeating every command but just changing the name of the mcs and variables.. it works.
But when I try to loop over it, its not displaying the mcs. I get no error message. And I've stepped through the code and can't see where its going wrong.
Below is the as for the looping movie that isn't working. If you need me to I can post the as for the non-looping movie if it would help see what I'm doing wrong.
Code:
//---------------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("fplayer_data.xml");
/////////////////////////////////////
p = 0;
dCounter = 1;
this.onEnterFrame = function() {
for(i=0; i < 4; i++) {
picture0.duplicateMovieClip("picture" + dCounter, dCounter);
this[picture + dCounter]._x = this[picture + i]._x + 55;
filesize = picture0.getBytesTotal();
loaded = picture0.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (this[picture add i]._alpha<100) {
this[picture add i]._alpha += 10;
}
}
dCounter++;
}
};
function firstImage() {
for(j=0; j < 4; j++) {
if (loaded == filesize) {
this[picture add j]._alpha = 0;
this[picture add j].loadMovie(image[j], 1);
this[desc_txt add j].text = description[j];
}
}
}
How To Load Dynamic Text According To Dynamic Image?
Hello all,
I want to make this artist portfolio (ie: a slide show) and I have found a tutorial that showed me how to dynamically load images in an empty movie clip.
Now, I'd like to attach a description for each images and I'd like to keep it dynamic. So, I imagine a folder with one text per image, having a name can can be incremented or decremented (description1.txt, description2.txt, and so on)
and I guess it's a matter of having a recognition of which image we're on in order to load the corresponding text...
Also, I was wondering, can I add html tag in the txt file in order to have some sort of formatting to the output text?
Where do I start?
Thanks
p.
Arrrrrrg Dynamic Objec With Dynamic Variable
I'dont know how to sort this out.
I want to create a new dynamicly named Object and set a dynamicly named variable's value into that object, but i don't know how to trace them (this, eval, idontknowwhatelse,...)
this is a little example
Code:
var objectName:String = "Object_number_0";
var varName:String = "var_name_0";
this[objectName] = new Object();
this[objectName].varName = "Value_number_0";///Here is the problem
trace(Object_number_0.var_name_0);///It should trace "Value_number_0" but it doesn't
stop();
Thanx in advance
Dynamic Text; Dynamic Gradient Fill
Wow. Its been a long time since I asked a question here!
I'm trying to re-create a tweened banner with gradient filled (and broken apart ) text with dynamic text.
I'm using this code inside a loop: aTxt is an array of strings populated from an XML object
code:
var fmtText:TextFormat = new TextFormat();
fmtText.font = "TrajanPro";
fmtText.size = 30;
fmtText.color = 0xE3D280;
// ...
// get the width of the textfields
var txtMetrics:Object = fmtText.getTextExtent(aTxt[i]);
this["mv_"+i].createTextField("txt", 2, 0, 4, txtMetrics.textFieldWidth, txtMetrics.textFieldHeight);
this["mv_"+i].txt.text = aTxt[i].toUpperCase();
this["mv_"+i].txt.setTextFormat(fmtText);
I need to use the TextFormat method because thats the only way i can get the width of the newly created text filed, which I use for some maths later.
Is there any way to use a gradient fill instead of the color 0xE3D280? Or must I make the text as a mask for a gardient fill layer?
Dynamic Buttons For A Dynamic Menu - Flash_8
Hello,
I have to prepare a dynamic menu in actionscript that read the name of the button and the colour from a database in Mysql. I used amfphp to achieve the last part.
I would like to generate the button with the text and its colour get from the database. (The background of the button is gray, there is a little vectorial logo and a text that should be of the given colour, i.e. a gray button with the green logo and the green text, a gray button with the red logo and the red text, and so on).
The rollover should be of the same colour of the text, but the logo and text should become white.
Is it possible to create a movie I could change colour parameters (for text, vectorial logo and rollover)? Or may I create the button from scratch using entirely actionscript? Is there a guide or a tutorial for that?
Thank you in advance for all your help!
[F8] Dynamic Drawing And Dynamic Mask Problems
Hi everyone. I've decided to start learning dynamic drawing (I'm using flash 8) and so I'm attempting to create a basic menu using purely actionscript. What I'm working toward is creating a main button that when pressed, it's sub buttons will drop down from behind it, using a mask to make them show up as they drop down.
I'm still at the initial phase of this. Currently I'm just placing the buttons in their final location so I can work the mask issue, which is where I'm having problems. I've got my script to create the buttons in their proper locations, and then to create the mask in it's proper location. The problem is when I try to apply the mask to the sub-buttons, it also masks the main button. I've tried this several different ways but still have not gotten any success.
Could someone take a look and see what you think? Also, if there is a much easier way to do this, please feel free. Thanks.
Here's my code:
Code:
//Set up some starting variables:
//menu position:
menuxoriginal = 100;
menuyoriginal = 100;
menux = menuxoriginal;
menuy = menuyoriginal;
//menu width and height:
w = 100;
h = 25;
//menu separation:
s = 5;
//corner clip off:
clipoff = h*.25;
//number of menu items:
n = 3;
//
//
//Now create the buttons - no labels on them yet.
//
for (i=1; i<n; i++) {
_root.createEmptyMovieClip("btn"+i, i);
with (_root."btn"+i) {
trace(this);
moveTo(menux, menuy);
//shade first box different color than all others:
if (i==0) {
beginFill(0x222222);
} else {
beginFill(0x3377ff);
}
//draw lines (button)
lineTo(menux+w, menuy);
lineTo(menux+w, menuy+h-clipoff);
lineTo(menux+w-clipoff, menuy+h);
lineTo(menux, menuy+h);
endFill();
}
//prep y location for next button (current y value+button height+separation value)
menuy = menuy+h+s;
}
//
//
//For Testing Purposes: place start of mask halfway over so we can see what's going on. Normally will be the original value of 100.
//
menux = 150;
//reset menuy to be the original value plus the height of the first button.
menuy = menuyoriginal+h;
//create the mask to start at bottom of fist button and cover all remaining buttons:
_root.createEmptyMovieClip("mask", 10);
with (_root.mask) {
moveTo(menux, menuy);
beginFill(0x000000);
lineTo(menux+w-clipoff, menuy);
lineTo(menux+w, menuy-clipoff);
lineTo(menux+w, menuy+5+((i-1)*(h+s)));
lineTo(menux, menuy+5+((i-1)*(h+s)));
endFill();
}
//here make the mask clip mask all the bottons except the first:
for (i=1; i<n; i++) {
_root.btn+i.setMask (_root.mask);
}
Creating Dynamic Buttons With Dynamic Behaviours...
Hi!
I am creating dynamic buttons with a instruccion like this:
Code:
for (i=0; i<25; i++) {
_root['room'+i+'_btn'].onRollOver = function() {
trace ("color:"+i)
};
I want every button says a different number. ej: if u push the button 12 (i=12) it says "color:12"
With the code i created it always says "color:24"
any idea???
Thanks!!
Edit Dynamic Text To Dynamic Textfield
Hey all,
I'm sorry for not having a nice summary!
At this moment I'm working on a project, where the staff has the biggest hate created for anything that looks like a scrollbar. Therefore I'm trying to develop a textblock where texts come slide in from the right. Let's say I've three pages of plain text. This text should be chopped in pieces and placed in an array. Piece 1 becomes page 1 in the textblock, piece 2 becomes page 2 in the textblock which will slide in after a click on a button. Et cetera.
At this moment I've made this with the help op PHP. PHP counts a certain amount of words and devides the text into an array. This array is sent to Flash. The problem: depending on the amount of w's and m's, complete lines will not be displayed or pages will be half full. I'm looking for an alternative here.
The only thing I can come up with is Textfield.maxscroll. With maxscroll I can calculate the number of lines that will not be displayed in the textfield. I'm looking for the possibility to cut off the text after this last word in combination maybe with this maxscroll function. .length counts chars, maxscroll counts the lines, I'm looking for the combination!
Any ideas? Thanks in advance!
Dynamic X_ Propert For Dynamic Text Fields
Hello there.
I want to generate a dynamic text field in action scrip, but I want the length to dynamically adjust to suite the load of the external txt file. So when I change the text I won't have to adjust my text fields or action script.
Can this be done and if so, how would I go about doing it?
Thank you,
RSB
Setting Dynamic Text With Dynamic Path's
Hey guys,
I am pulling in this info with XML and trying to pass it thru a loop to plug in all of the news posts...however, for some reason, I cannot get the paths to work while I have a variable in it.
Any ideas?
ActionScript Code:
import flash.net.*;
import flash.events.*;
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
var numz:Number = 0;
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);
xmlLoader.load(new URLRequest("news.xml"));
function LoadXML(e:Event):void {
xmlData = new XML(e.target.data);
ParseBooks2(xmlData);
}
function ParseBooks2(tourInput:XML):void {
var tourList:XMLList = tourInput.Newspost.datez;
for each (var dateElement:XML in tourList) {
// create entries newsTitle_txt
["newsButton"+numz+"_but"]addEventListener(MouseEvent.CLICK,onClick);
function onClick(e:Event):void{
trace(this)
//launch news story
}
// THIS IS WHERE I AM HAVING TROUBLE...ANY IDEAS? It pulls the info in, but I cant set this text using the variables..
var newsTitles:String = "newsButton"+numz+"_but.newsTitle_txt";
trace(this[newsTitles].text);
this[newsTitles].text = tourInput.Newspost.title.text()[numz];
numz++
}
}
this.stop();
Calling Dynamic Content From Another Dynamic Field
Hi ppl
I am new 2 this forum and i am quite week in Action Script !!!!!! I have been posting this 2 almost all forums possible but failed 2 get the apt reply !!!! If any 1 here Knows the sollution plz tell me in a bit lucid way so that i can grasp !!!!!
My question is :
How can v load data into a variable from a text file by clicking on a hyperlink created in HTML!!! In fact my intention is 2 load a text file containing the hyper link, first and then after pressing the link another text file gets loaded !!!! in its place !!!!!! Hope u get me !!!!
Hopefully
JIkku Jose
Jiks
Dynamic Text In Dynamic Movie Clip
I'm having a horrible time referencing the text variable in my dynamically created movie clip. What am I missing?
PHP Code:
// CONSTANTS
TotalRubs = "3";
RubWidth = getProperty("Rub", _width);
//
Label1 = "REPUTATION";
Label2 = "QUALITY";
Label3 = "INNOVATION";
//
//
// DUPLICATION
n = 0;
while (n<Number(TotalRubs)) {
n = n+1;
duplicateMovieClip("Rub", "rub"+n, n*10);
newrub = "rub"+n;
if (n == 1) {
setProperty("rub"+n, _x, getProperty("rub", _x));
} else {
setProperty("rub"+n, _x, getProperty("rub"+(n-1), _x)+RubWidth);
}
_root.newrub.label = eval("label"+n);
}
setProperty("Rub", _visible, "0");
Dynamic Text Under Dynamic Mask W/ MS+ Scroller.......
Hola, everybody. I am stuck. I have some dynamic text under a dynamic mask.....I am using one of the MS+ scrollers (www.mirage-studios.com). This scroller requires the content to be under a mask. Since dynamic text wont show under a regular mask, I decieded to use a dynamic mask. The problem is that this scroller will only scroll up to the end of how big I made the dynamic text. Meaning if I made the dynamic text 500px in height, but the text being dynamically put in it, the scroller will only scroll down to that 500th pixel, rather than to the end of the text. Anyone know what I can do?
Thanks,
Gerard
Dynamic Button With Is Dynamic Code(links)
Hello,
anyone can help me to create dynamic button with its code dynamically.
ex:
from XML file a learn names and links,
and i wanna display name as button and evry clicked button redirect me to its link,HHHHOOOWWW ???
i just began to work witha solution that conciste to deal with a array variables created as number as names.
you can mail me directly in my box mail : amine_youness@hotmail.com
thanks for your help
Dynamic Link Inside Of Dynamic Menu
hello, I am having a problem adding links dynamically inside of a menu that was created dynamically. Look here to see the movie. All of the menus are created dynamically with a for loop iterating through an array. As each menu is created I want the links to be created also. For this i have used nested for loops. My problem is labeling the link text. Here is all of my code.
ActionScript Code:
stop();
function default_location(){
topX = 10;
topY = 5;
bottomX = 10;
bottomY = 590;
bar._x = topX;
bar._y = topY;
}
default_location();
//number of menus
var numMenus = 6;
var menuTop = new Array();
var locationY = 5;
var locationX = 10;
//define the menu headings
var top0 = "New Home Buyer Program";
var top1 = "Franchise Opportunities";
var top2 = "Broker/Realtor Program";
var top3 = "Mortgage Broker Program";
var top4 = "Home Builder Program";
var top5 = "Company Info";
var menu0 = new Array();
//New Home Buyer Program Menu Items
menu0[0] = ["Get the Home of Your Choice Now", "www.nhba.com"];
menu0[1] = ["The NHBA Application Process", "www.nhba.com"];
menu0[2] = ["Find an Office", "www.nhba.com"];
menu0[3] = ["Complete an Application", "www.nhba.com"];
menu0[4] = ["Check the Status of Your Application", "www.nhba.com"];
menu0[5] = ["Available Property Specials", "www.nhba.com"];
//Franchise Opportunity Menu Items
var menu1 = new Array();
menu1[0] = ["The NHBA Franchise Experience", "www.nhba.com"];
menu1[1] = ["NHBA for the Franchisee", "www.nhba.com"];
menu1[2] = ["Exclusive Tools and Technology", "www.nhba.com"];
menu1[3] = ["FAQ's/Resources", "www.nhba.com"];
menu1[4] = ["Franchise Facts", "www.nhba.com"];
menu1[5] = ["Discovery Days Registration", "www.nhba.com"];
menu1[6] = ["Franchise Testamonials", "www.nhba.com"];
menu1[7] = ["Apply to be a Franchsie", "www.nhba.com"];
//Broker/Realtor Program Menu Items
var menu2 = new Array();
menu2[0] = ["What Brokers & Realtors Need to Know", "www.nhba.com"];
menu2[1] = ["NHBA for the Realtor", "www.nhba.com"];
menu2[2] = ["Request Information", "www.nhba.com"];
//Mortgage Broker Program Menu Items
var menu3 = new Array();
menu3[0] = ["What Mortgage Brokers Need to Know", "www.nhba.com"];
menu3[1] = ["NHBA for the Mortgage Broker", "www.nhba.com"];
menu3[2] = ["Request Information", "www.nhba.com"];
//Home Builder Program Menu Items
var menu4 = new Array();
menu4[0] = ["What Homebuilders Need to Know", "www.nhba.com"];
menu4[1] = ["How Lease-to-Own Works for You", "www.nhba.com"];
menu4[2] = ["Request Information", "www.nhba.com"];
//NHBA Company Info Menu Items
var menu5 = new Array();
menu5[0] = ["Company Overview", "www.nhba.com"];
menu5[1] = ["Contact Us", "www.nhba.com"];
menu5[2] = ["Management Team", "www.nhba.com"];
menu5[3] = ["Corporate Media Kit", "www.nhba.com"];
menu5[4] = ["What People are Saying", "www.nhba.com"];
menu5[5] = ["Pride in Partnership", "www.nhba.com"];
menu5[6] = ["Privacy & Security Policies", "www.nhba.com"];
menu5[7] = ["Site Map", "www.nhba.com"];
var numMenusLeft = numMenus;
//Create the Menus
for(i=0; i < numMenus; i++){
bar.duplicateMovieClip("bar"+(i), i+1);
_root["bar"+(i)]._y = locationY; //sets the initial location
locationBottom = bottomY - (28*numMenusLeft); //sets the bottom location
menuTop[i] = [locationY,locationBottom,_root["top"+(i)]];//assigns the menuTop array with the instance info
_root["bar"+(i)].menuName_txt = menuTop[i][2];
_root["bar"+(i)].name = "bar"+(i);
_root["bar"+(i)].id = i; //assigned id as array index (id = 0, 1, 2....)
_root["bar"+(i)].up = true;
locationY += 28; //increment locations for next menu
numMenusLeft-=1;
var len = _root["menu"+(i)].length;
//trace(len);
var linkY = 45;
var obj = new Array();
x = i;
for (j=0; j<len; j++){
//THIS IS THE PART THAT IS NOT WORKING
obj[j] = _root["bar"+(i)].link.duplicateMovieClip("link"+(j), j);
//_root["bar"+(i)].createEmptyMovieClip("mc"+j, j);
//["mc"+(j)].createTextField("txt", j, 0, linkY, 130, 40);
trace(obj[j]);
//IT DOESNT ASSIGN THE TEXT TO THE LINK
obj[j].link_button.link_text.text = _root["menu"+(i)][j][0];
obj[j]._y = linkY;
linkY += 30;
}
_root["bar"+(i)].link._visible = false;
//trace(obj.length);
for (k=0; k<obj.length; k++){
trace("Link:"+k+obj[k]);
}
}
_root.bar._visible = false;
function moveMenus(button_id){ //button id is coming in as the array index (0,1,2...)
//loop through all of the menus
for (i=0;i<=(menuTop.length - 1); i++){
if(i<button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if(i == button_id){
if (_root["bar"+(i)].up == false){
easeUp(i)}
}else if (i>button_id){
if (_root["bar"+(i)].up == true){
easeDown(i)}
}
}
}
/*This is how to use the MX easing tween:
var tabUp = new mx.transitions.Tween(movieClip, "_y", mx.transitions.easing.Bounce.easeOut, beginCordinate, endCordinate, time);
*/
function easeUp(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][1], menuTop[menu][0], 12);
_root["bar"+(menu)].up = true;
}
function easeDown(menu) {
var tabUp = new mx.transitions.Tween(_root["bar"+(menu)], "_y", mx.transitions.easing.Strong.easeOut, menuTop[menu][0], menuTop[menu][1], 24);
_root["bar"+(menu)].up = false;
}
Any help would be MUCH appreciated.
Placing A Dynamic Text Box Just After The First Dynamic Txtbox
hi all,
I would like to know the code, I have to 2 dynamic textboxes, How can I place the 2nd one just after the 1st dynamic box [dynamically not manually]. Means when the screen appears it should the info like My name is [value of the first dynamic box] is xeeschan[secnd dynamic textbox]
thank you
Dynamic Text Feild With Dynamic Scroll Bar
I have a Dynamic Text Feild with a dynamic Scroll bar.
It loads a simple ASCI text file with some html formating.
but I still can not manage to get the text to format.
The biggest problem with the format is a big space between paragraphs.
I am not sure why but I think the Frame must need a var to render to html.
Can anybody help please?
Creating Dynamic Text Fields Within Dynamic Mc
Im using this xml "data.xml":
HTML Code:
<XML>
<salesreps>
<rep>
<firstname value="Jon"/>
<lastname value="Doe"/>
<phone value="(555)999-9999"/>
<email value="jondoe@yahoo.com"/>
<description value="Description for Jon Doe."/>
<photo value="../LandAm/images/wes.bmp"/>
</rep>
<rep>
<firstname value="Jane"/>
<lastname value="Doe"/>
<phone value="(555)555-5555"/>
<email value="janedoe@yahoo.com"/>
<description value="Description for Jane Doe."/>
<photo value="../LandAm/images/robin.jpg"/>
</rep>
<rep>
<firstname value="adfkljasdfl;kj"/>
<lastname value="l;kajglaskdj"/>
<phone value="kdfjgls;dkjg"/>
<email value="dfgkljsdlg;"/>
<description value="kjdgfl;asdkgnl;sakdnglkj"/>
<photo value="../LandAm/images/nophoto.jpg"/>
</rep>
</salesreps>
</XML>
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.
I just need a push in the right direction. Thank you for you time!
Creating Dynamic Tooltip For Dynamic Text
I've been working on a proof of concept and have run into a stumper. What I am trying to do is add tooltips dynamically to dynamic text. Here is what I have so far, http://www.hallmedia.com/client/chop/tooltip.swf
Type in some text including the magic word "dolor" and hit the orange button. Flash will highlight the first instance of dolor wherever it might be in your text. Groovy.
Now I am trying to figure out a way to get the coordinates of the first and last character so I can attach a movie clip covering that area that will invoke a tooltip popup upon rollover. Any ideas?
Dynamic Calling Of Functions With Dynamic Parameters.
Hello all,
I'm pulling info from an XML file. The info corresponds to the properties of buttons that will each have a different behaviour. First of all I wanted to specify in my XML the name of the function to run when the button is pressed. Previously I understand that there was a function called eval() or exec() that would run a string as if it were code. But not any more. It turns out you can do it with dynamic referencing, like this:
Code:
function traceIt():void
{trace("It");}
var funcName:String = "traceIt";
this[funcName]();
Great!
Now the problem is to do with the number of parameters that different functions accept. Say one of the functions required no parameters, and another required 2 - how could I deal with both these situations dynamically? Ok, sure I can put load of if statements in up to a maximum number of parameters, but that's hacky.
Is there a way for example of calling a function using a special kind of array that will map out to the parameters required by a given function? Yeah it's a long shot, but AS3 has had quite a few tricks up its sleeve that have pleasantly surprised me in the past!
Cheers guys!
Banner, Dynamic Text, Dynamic Images.
Wandering if someone here can help me with this banner, I am using dreamweaver2004 and Swish, if that helps any.
I would like to do the same as a banner seen at this website, www.martec.ie .
When looking at the code, you can tell that the images are coming from a folder, and the text is dynamic(from a databse). Also, I would like to be able to edit from a form, I may be able to figure this part if I get the help I need. But the images will be figured from the site, a database and such. Look at each or some pages and you will see what I am wanting to do. The images and text change.
Anyone here know how to do this? Thanks.
Flash Dynamic Menu W/ Dynamic Content
I have been working on this project for school where when you run the flash on a server it uses loadvariables() to open a php file that lists all of the text files of a directory 'pages' in variable format for flash to build a button per text file. To clarify:
/pages
-home.txt
-tuts.txt
-links.txt
flash builds buttons for each of these above files with the button named after the text file name (minus the .txt).
This works just fine but what I want to do now is say, when you click the home button, it will load the contents of pages/home.txt into a dynamic text box. Or when you click the pages/tuts.txt it loads that, etc.
So far, I can get the text box to display the location of the text file based on what button you pushed but i cant get it to display the text that is in the text file. I know that i am inches away from finishing it but I can't seem to figure out where to place what code. I've tried many dynamic text tutorials and none seem to go into detail about stuff like this. They all just talk about a text box and loadvar's in the same frame in the same mc, etc.
If anyone can give me some help, I would greatly appreciate it. Thanks.
Here is my working example. http://mungyun.com/experiments/close/dyn_menu.html
here is a zip file with my work to this point. You need a php enabled server to get this to work.
http://mungyun.com/dynmenu.zip
Dynamic Text In The Dynamic Sense
I wanted to make a dinamic text box that will sinchronize
itself from a text file
I created a dynamic text box and wrote the following command
in the frame:
loadvariables("text.txt",text);(text.txt is the file...)
What's wrong????
thanx
Dynamic Text With Dynamic Size
Background:
I have a Button embeded in a Smart Movie Clip (buttonMC) with many instances of the buttonMC on my stage. I want a separate title (titleMC) to appear next to each instance of the buttonMC when I roll over the button. A dynamic text box that returns the value of a (smart) variable in the buttonMC seems to be the answer for me. This titleMC also needs a background, for which I've made another MC (backgroundMC) which sets it's width acording to the width of the titleMC.
Problem:
I need this dynamic text box to resize acording to it's contents, so that my backgroundMC ends up nicely hugging the text. As it stands I havn't been able to get a Dynamic text box to resize itself dynamically. (Were talking about a one line text box here) When I created the initial box I made sure not to resize it and hence "fix" it's size (square corner). (It still has a circle at it's corner)
Any sudgestions here? Do I need more script and math to judge the size of the text in the box and resize the bacgroundMC from this math? (I was (am) hoping that's not the case.)
Thanks for the thoughts,
Mani
Dynamic Text And Dynamic Image
hi all,
i am trying to make an animation wherein i have a sequence of dynamic text and dynamic images move in and dissappear with the same effect.
what i actually want is, i have an image with a related text.this particular image and text move in with some effect and dissappear.i have many more images with related text and want them to move with the same effect as the first one without drawing them individually in the timeline.
i am seeking for a way in which i can avoid redundancy of making the same effects.i just want to replace the image and text followed with the same effects.
So does anyone know any websites or think they can help me with this problem? any help or advice would be appreciated.
thanx.
The Height Of A Dynamic TextField Dynamic?
Hoi
is there a way to make the height of a dynamic TextField dynamic. Why? Well i what to load text from a data.txt and i what the TF height to fit the text.
just an idea to start from will do.
thanks for the help
Dynamic Sizing Of Dynamic Text Box
Is there any way to have my dynamic text box expand or shrink to fit whatever text is put in it? The problem I run into is having the text cut off if the box isn't physicaly built large enough.
Thanks in advance.
_t
Dynamic Reference To Dynamic Text?
I'm trying to find a way to add code to my LoadVars object that will allow me to retrieve a specific variable in my TXT/DAT file, without going through and hardcoding a switch statement that covers all the possibilities. I have my variables in the TXT/DAT file numbered 1-N, and want to be able to select my text and display it based on a number defined by other buttons. So, I'm looking for something that would sort of accomplish what this would (if it worked)
Code:
textBox = _parent.defHolder.(_parent.defNum //the variable names in the TXT file and defNum are the same)
I'm sure that that's fairly understandable...though it doesn't work. I can't create a _global variable either...well, I can, but it doesn't make any difference. Is there a way to insert a dynamic variable after my LoadVars object, or am I going to just have to go ahead and put the Switch in with a Case for each variable?
Thanks for any help.
|