(very) Simple Loop And Variable Conundrum
Hi there
I have a looping timeline where each time the loop occurs
i = i+1;
What i am trying to do is load the variable "quote" appended with the value of i (so quote1, quote2, etc), into a dynamic text box. I am not sure how to reference the textbox variable to this effect.
I am stuck - any help appreciated
thanks! S
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-20-2008, 07:23 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
For Loop Conundrum
Hi all,
I have a problem with using a for loop which I would like your help with.
The problem is as follows :-
I have 10 buttons on the stage, all with instance names of "btn1", "btn2", "btn3", etc etc.....
When a user clicks one of these buttons, I want a corresponding jpg to be opened ("1.jpg", "2.jpg" etc)
I thought the best way to get this to work was to use a for loop to marry up all the duplicate numbers in the instance names and file names.
I wrote the script and tested the movie, and flash detects I am pressing the buttons, but only plays one of the files, not the corresponding "1.jpg" for "btn1"
I have attached the code im using for you to help me.
Many thanks in advance - im intrigued as to the solution!!
Mark
Attach Code
onEnterFrame = function () {
for (i=0; i<=10; i++) {
["btn"+i]onPress = function() {
trace("btn"+i+"pressed");
_parent.startPreload("portfolio/chaosOrder/"+ i +".jpg");
};
}
};
Simple If/else Conundrum
I am building a simple cost calculator based around an text input field for quantity and a dynamic text field for "subtTotal" value. The script I'm using (in frame 1) is this:
itemNum = Number(itemQty);
if (itemNum = 0) {
itemCost = 0;
} else if (itemNum >= 1) {
itemCost = 10;
}
itemTotal = itemNum * itemCost;
subTotal = itemTotal;
...but this doesn't work. If I remove the if/else statement and give "itemCost" a numerical value it works. The MC loops around two frames so that it updates the result if "itemNum" is changed. I'm guessing that I'm making a very basic mistake here, but my Macromedia Actionscripting (Franklin/Makar) book doesn't give me any clues. A pointer in the right diection would be much appreciated.
Variable Take On Content Of A Root Variable And Not Its Path - Simple Please Help
Hi there ok my brain has died and fallen off somewhere , what i am trying to do is this:
l=0
l++
_root.advert= "_root.var" + l ;
then i have a text box on stage , dynamic, etc var: _root.advert
, vars are stored in a text file , vars are called, var1, var2 etc , text box needs to display variable contents, but at the moment it just says "_root.var1" etc and not the content s of var1 this is very simple problem but my brains dead please help.
-arran
[CS3] Simple Image Loop Not So Simple
I'm relatively new to Flash - I can do some basic animations but very little actionscript.
I'm looking for a tutorial to have a set of images scroll across and repeat themselves.
this is what I'd like... example
I can do a continuous loop of a simple background image with the 'goto' function, but I can't even find a tutorial on how to repeat individual images.
Any suggestions?
Thanks,
JTN
Timer Conundrum
I'm trying to build a little application whereby the time taken for a task to be completed is recorded and displayed.
In essence I want to measure the time it takes from rolling over a button (x) to rolling over an other button (y) and then display this time in milliseconds.
I've tried:
on (rollOver) {
startTime = getMilliseconds();
}
for button (x) and:
on (rollOver) {
endTime = getMilliseconds();
}
for button (y) but nothing happens when I try to calculate totalTime = endTime - startTime
Can someone tell me how to do it?
Thanks
A-script Conundrum
aloha folks-
i've reached a personal impasse in the scripting of my new site. while i can make my boxes grow the way i want, i cannot seem to make my fill boxes move where i want. maybe someone can shed some light on my a-script naivity:
stop();
this.createEmptyMovieClip("box1", 3);
box1.beginFill(0x111111, 0);
box1.lineTo(0, 20);
box1.lineTo(20, 20);
box1.lineTo(20, 20);
box1.lineTo(20, 0);
box1.endFill();
this.createEmptyMovieClip("box2", 2);
box2.beginFill(0x111111, 0);
box2.lineTo(0, 20);
box2.lineTo(20, 20);
box2.lineTo(20, 20);
box2.lineTo(20, 0);
box2.endFill();
this.createEmptyMovieClip("box3", 1);
box3.beginFill(0x111111, 0);
box3.lineTo(0, 20);
box3.lineTo(20, 20);
box3.lineTo(20, 20);
box3.lineTo(20, 0);
box3.endFill();
item1.onEnterFrame = function() {
speed = 5;
box = _root.box1;
finalWidth = box._width+0;
finalHeight = box._height+0;
this._width += (finalWidth-this._width)/speed;
this._height += (finalHeight-this._height)/speed;
};
item2.onEnterFrame = function() {
speed = 5;
box = _root.box2;
finalWidth = box._width+0;
finalHeight = box._height+0;
this._width += (finalWidth-this._width)/speed;
this._height += (finalHeight-this._height)/speed;
};
item3.onEnterFrame = function() {
speed = 5;
box = _root.box3;
finalWidth = box._width+0;
finalHeight = box._height+0;
this._width += (finalWidth-this._width)/speed;
this._height += (finalHeight-this._height)/speed;
};
//it is down here that i want to put a set property("_root.box", _x, "value"); but nothing happens.
one.onRelease = function() {
setProperty("_root.box1", _xscale, "500");
setProperty("_root.box1", _yscale, "500");
setProperty("_root.box2", _xscale, "100");
setProperty("_root.box2", _yscale, "100");
setProperty("_root.box3", _xscale, "100");
setProperty("_root.box3", _yscale, "100");
};
two.onRelease = function() {
setProperty("_root.box2", _xscale, "600");
setProperty("_root.box2", _yscale, "600");
setProperty("_root.box1", _xscale, "100");
setProperty("_root.box1", _yscale, "100");
setProperty("_root.box3", _xscale, "100");
setProperty("_root.box3", _yscale, "100");
};
three.onRelease = function() {
setProperty("_root.box3", _xscale, "400");
setProperty("_root.box3", _yscale, "400");
setProperty("_root.box1", _xscale, "100");
setProperty("_root.box1", _yscale, "100");
setProperty("_root.box2", _xscale, "100");
setProperty("_root.box2", _yscale, "100");
};
Actionscripting Conundrum
hello,
i have a page with buttons linking to movie clips on the same page...these movie clips are made visible by the 'set property' action from each button. They are otherwise invisible with a frame 'set property' action.
when a button calls up a movie clip, the mc appears immediately...what i would like is for the movie clip to fade in.
is this possible?
does anyone know some code i could use?
thank you in anticipation,
janice
_currentFrame Conundrum
Hello
I am trying to get the curser to jump forward by a ever decreasing amount reletive to its position when the button is relesed. i've been trying to use the script below, but to no avail;
on (rollOver) {
gotoAndPlay(_currentFrame + 1);
}
on (rollOut) {
gotoAndPlay(_currentFrame + (80 - _currentFrame));
}
Basicly, what i'm trying to do is get a button to change colour according to how long it's pressed, then change back to another colour over a period of time when relesed.
Please help!!!
Thankyou
Help - Button Conundrum
Hi,
Im having an actionscripting problem and its driving me nuts. I thought I had solved it this morning but then I found a flaw (always the way) and was wondering if anyone had any clues. (Flash MX)
I have items on the screen in button form, that you can click on and then they appear in the inventory. The items in the inventory are movie clips. The movie clips are invisible on their first frame and visible on their second. This is an example of the actionscript on the button.
on (release) {
_root.ticket.gotoAndPlay (2) ;
screenticket._visible=false;
}
Which works fine and makes the 'ticket' movie clip appear. Only when the user moves out of the keyframes that contain the button and then back in, the button has reappeared. I was hoping someone might have an idea about a code I could use on the frame rather than the item which makes the button permanently invisible after it has been clicked once.
I have knocked up an example using the code above so the problem is more visible. As im sure i am probably not making any sense! Any help would be really, really appreciated
Thanks
L
Flash 5 Conundrum
2 questions.
in flash 5 how do i publish my site into an html format? what code do i need?
with Flash 5 when i try and give a button action script the "on mouse event" option isnt available ii need this to write on release goto html..... how do i get around or correct this?
thank you
MovieClip Conundrum
Hello,
I am trying to create a flash application embedded into a csharp application. The CSharp will send an event to the flash application with a string containing XML.
The XML will look something like:
<?xml version="1.0"?>
<text>
<word font="Times New Roman" colour="red" size="20" stime="11.1975877" etime="15.1305368">Hello Flashkit.com</word>
<word font="Times New Roman" colour="red" size="20" stime="16.1374531" etime="20.046068">16.1374531 represents 16.137 seconds into the file</word>
<word font="Times New Roman" colour="red" size="20" stime="21.0817363" etime="25.6177479">Thanks for your help</word>
</text>
So basically the end time for the last word will be when the movie finishes. All this of course needs to be done through actionscript and worst of all if I receive A new event I have to clear the current movie, parse the new xml, and start all over again.
If anybody has any advice or a good how-to tutorial please let me know!
Thanks!
David Wells
Graphics Conundrum
Say you had 30 images in a graphics generation program like “CoralDraw” & you wanted to use them all in Flash - you could save them or just copy individually into Flash one at a time but if you copied or saved the whole lot as a group – imported into Flash – break apart - & then use individually are you saving a lot of file size –1 group of 30 images saved & compressed as one graphic against 30 images imported individually?
Another Button Conundrum
Hi All,
I have a menu system whereby a click will move to a new frame label "Shown". I then want the movie to move back to the "Hidden" frame so that the menu disappears when I rollOut(); of the main menu shape (which is a button behind all other menus items, also buttons).
The problem occurs when I roll OVER the button shape, but then roll OVER the actual menu item buttons. The button shape thinks it has been rolled OUT OF, and so disappears.
I tried to create an invisible button item at the top layer of all this, but it stops me from accessing the menu buttons below! Hence I can't click them! Rollout works OK though!!
You can visit this site to see what it looks like - click on the about us button to see the menu appear.
www.lucidnetdesigns.com/ph/index.htm
Thanks,
Nick
Hittest Conundrum
My code
Code:
this.hitTest(_root.vert.horiline )
works OK but if I change it to detect the shapeflag the code doesn't work at all ie this code
Code:
this.hitTest(_root.vert.horiline._x, _root.vert.horiline._y, true )
Is this because my movieclip is within another movieclip? Mc "horiline" is inside the mc "vert". Has anyone experienced this before?
Interface Conundrum
Hi guys,
I'm trying to create a full flash site using 'sliding' menus, however i am completely stumped as to how i can make the stage dynamically adjust to incorporate the loaded content for each subsection.
Probably best illustrated with an image:
The reasons I can't start with a large stage size is because:
a) The scrollbar will always be visible, even when there is very little content on the screen.
b) The amount of content in each section will vary greatly, and will change when updates are neeed.
c) Just seems impractical.
If anyone could help me with this, or just point me in the right direction it would be greatly apperciated.
thanks
The _level Conundrum
Howdy all,
I am a veteran coder but just beginning with Flash and Actionscript. There are lots of "Flashers" here at work, but none with scripting experience. I have one quick question.
(1) Everyone claims that _level0 is a bad place to locate your objects. Ok, they say the solution is to put them in _global instead. My question is how do I do that? When I create the objects, they default to _level0 and I have no idea how to change that?
I apologize if this is a very simple question. Thanks for your help.
JJ
Animation Conundrum
Hello.
I am stuck. I have figured how to animate an object along a path, but what I want to do is animate a path along a stationary object. I am trying to animate a train track from above and want it to appear as though the track snakes around, but tays central to the page. A bit like old school car driving games, where the car stays in the middle of the screen and the track moves. Is this possible in Flash.
Thanks
Sam
Arg - New Clip Conundrum
Hi guys, I've been reading this site for a while now but it's only now that I have a problem that I turn to you guys in the forums for help... stupid unsociable me.
I'm new to ActionScript development, and I've been able to figure out pretty much everything on my own so far, but this particular problem really has me stumped. I'm totally at my wits end here, so maybe one of you smarty folks can help me out.
The following code is a stripped down version of what I'm trying to do with a game-type application. Basically I create some new movie clips, put them in an array, give them each unique attributes, and then refer to those attributes later in another function. When I do this, the attributes for ALL clips have all been set to the attributes of the last clip created! Which in this case means that all the moving elements have the same velocity, when really I want them each to have different ones.
BaseClip is just an already existing clip that I use as a base for the newly created clips.
Code:
var iDesiredClips = 4;
var Clips = new Array(iDesiredClips);
var bSpawnedClips = false;
BaseClip.Velocity = new Array(0, 0);
setInterval(MainGame, 15);
function MainGame()
{
if (!bSpawnedClips)
{
SpawnClips();
bSpawnedClips = true;
}
for (var i = 0; i < iDesiredClips; i++)
{
UpdateClips(Clips[i]);
}
}
function SpawnClips()
{
for (var i = 0; i < iDesiredClips; i++)
{
BaseClip.duplicateMovieClip("clip"+i, i, BaseClip);
Clips[i] = _root["clip"+i];
Clips[i].Velocity[0] = Math.random() * 5;
Clips[i].Velocity[1] = Math.random() * 5;
trace("created " + Clips[i]._name + ": " + Clips[i].Velocity[0] + ", " + Clips[i].Velocity[1]);
}
}
function UpdateClips(Clip)
{
Clip._x += Clip.Velocity[0];
Clip._y += Clip.Velocity[1];
}
Thanks in advance, guys!
Arg - New Clip Conundrum
Hi guys, I've been reading this site for a while now but it's only now that I have a problem that I turn to you guys in the forums for help... stupid unsociable me.
I'm new to ActionScript development, and I've been able to figure out pretty much everything on my own so far, but this particular problem really has me stumped. I'm totally at my wits end here, so maybe one of you smarty folks can help me out.
The following code is a stripped down version of what I'm trying to do with a game-type application. Basically I create some new movie clips, put them in an array, give them each unique attributes, and then refer to those attributes later in another function. When I do this, the attributes for ALL clips have all been set to the attributes of the last clip created! Which in this case means that all the moving elements have the same velocity, when really I want them each to have different ones.
BaseClip is just an already existing clip that I use as a base for the newly created clips.
Code:
var iDesiredClips = 4;
var Clips = new Array(iDesiredClips);
var bSpawnedClips = false;
BaseClip.Velocity = new Array(0, 0);
setInterval(MainGame, 15);
function MainGame()
{
if (!bSpawnedClips)
{
SpawnClips();
bSpawnedClips = true;
}
for (var i = 0; i < iDesiredClips; i++)
{
UpdateClips(Clips[i]);
}
}
function SpawnClips()
{
for (var i = 0; i < iDesiredClips; i++)
{
BaseClip.duplicateMovieClip("clip"+i, i, BaseClip);
Clips[i] = _root["clip"+i];
Clips[i].Velocity[0] = Math.random() * 5;
Clips[i].Velocity[1] = Math.random() * 5;
trace("created " + Clips[i]._name + ": " + Clips[i].Velocity[0] + ", " + Clips[i].Velocity[1]);
}
}
function UpdateClips(Clip)
{
Clip._x += Clip.Velocity[0];
Clip._y += Clip.Velocity[1];
}
Thanks in advance, guys!
Anthology Conundrum
I got the new Flalsh anthology today and wanted to experiment a bit by combining two of the navigation examples the horizontal and vertical nav exmaples i.e. the buttons move and the text scrolls according to which button is hovered over but I cannot for the life of me get the thing to work! the exmaples work fine by themselves but combined, it's HAVOC! ALL the buttong move in unison, the text scrolls but doesn't scroll back to where it's supposed to:
//Global Variables
_global.speedFactor = 0.2;
_global.InfoStartYPos = InfoMC._y;
_global.InfoYPos = InfoStartYPos;
_global.speed = 1.3;
_global.stickiness = 8;
_global.baseX = 5;
_global.finalX = 30;
// Create an array for the positions of the information area
_global.InfoMC_Y = new Array (-200, -490);
//Movement Functions
function InformationSlideTo(number){
InfoYPos = InfoMC_Y[number];
};
function InformationSlideBack(){
InfoYPos = InfoStartYPos;
};
function moveOut(){
this.xStep = 0;
this.onEnterFrame = function ()
{
if (this._x < finalX)
{
difference = finalX - this._x;
this.xStep = (this.xStep + difference * speed) / stickiness;
this._x += this.xStep;
}
if (this._x > finalX)
{
this._x = finalX;
}
};
};
function moveIn(){
this.xStep = 0;
this.onEnterFrame = function ()
{
if (this._x > baseX)
{
difference = finalX - this._x;
this.xStep = (this.xStep + difference * speed) / stickiness;
this._x -= this.xStep;
}
if (this._x < baseX)
{
this._x = baseX;
}
};
};
//Assign event handlers
conSlt.onRollOver = function(){
moveOut;
InformationSlideTo(0);
}
conSlt.onRollOut = function(){
moveIn;
InformationSlideBack;
}
InfoMC.onEnterFrame = function(){
this._y -= (this._y - InfoYPos) * speedFactor;
};
..Where conSlt is a movieclip representing the button and InfoMC is the text movieclip that's supposed to scroll up and down according to what "button" the mouse is hovered over...
Please help.
Conundrum A La Flash
www.intentionallies.co.jp
The cards are the specimens in question. And in particular, the way that you can rotate them based on a dynamic rotation point. This is what I'm trying to do, set a dynamic rotation point. Here's what I've tried....
-----------------------------------------------------------------
I figured out a method to do this without lots of math. You make an MC with another MC inside it. The point is to make the childMC change X and Y positions when the parentMC goes to whatever the mouse X and Y is. You make the childMC appear like it has not moved when in reality it has just moved the opposite direction of the parent.
since the parent dictates rotation, the child will then rotate at the new parent's point.
The only problem is, this only works BEFORE rotation since the position of the child is dependent on the mouse for x and y coordinates...but when you spin the child's container, it gets "disoriented" and the coordinates no longer match because the x and y axises are not parallel.
-----------------------------------------------------------------
Now this basically works except I need a better way to proportion rotation to position. Or any other suggestions are appreciated
SIMPLE LOOP-D-LOOP
I have a tween that is 20 frames long nested in a MC.
Is there a way to set it to loop a specific amount of times and then stop? Similiar to the sound loop option?
Does someone have a little code or something to point me in the right direction?
Thanks!
If Variable=variable Simple Problem
Ok i'm having this problem;i have tried a lot of times to try to find what is wrong but could not;it looks pretty simple though but i'm a newbie;
here is the situation:
I have 2 buttons:
-Next page
-Previous page
a dynamic text box where i load an external text;it is called "contents"(the var).
my "Previous page" button works fine while i'm having problem with my "next page" button.
I use loadVariablesNum("../texts/"+pagenum+".txt", 0);
So that when i press on
next page" button;the pagenum is incremented and it loads 1.txt , 2.txt ,etc...(where in each text; "contents" variable is loaded).
I also use a variable(lastpage) so that to stop the "next page" button to go further than the last page.
I load the lastpage variable value from an external text too.
here is the code the "next page" button:
on (release) {
if (pagenum=lastpage) {
break;
} else {
pagenum = pagenum+1;
loadVariablesNum("../texts/"+pagenum+".txt", 0);
}
}
The "next page" button doesn't stop when pagenum=lastpage.
Any idea why? thanks in advance
If Variable=variable Simple Problem
Ok i'm having this problem;i have tried a lot of times to try to find what is wrong but could not;it looks pretty simple though but i'm a newbie;
here is the situation:
I have 2 buttons:
-Next page
-Previous page
a dynamic text box where i load an external text;it is called "contents"(the var).
my "Previous page" button works fine while i'm having problem with my "next page" button.
I use loadVariablesNum("../texts/"+pagenum+".txt", 0);
So that when i press on
next page" button;the pagenum is incremented and it loads 1.txt , 2.txt ,etc...(where in each text; "contents" variable is loaded).
I also use a variable(lastpage) so that to stop the "next page" button to go further than the last page.
I load the lastpage variable value from an external text too.
here is the code the "next page" button:
on (release) {
if (pagenum=lastpage) {
break;
} else {
pagenum = pagenum+1;
loadVariablesNum("../texts/"+pagenum+".txt", 0);
}
}
The "next page" button doesn't stop when pagenum=lastpage.
Any idea why? thanks in advance
Really Basic Conditional Conundrum
Hi There--
I have a Movieclip called lightWave that has three frames. On the actionscript layer, there's a stop action on frames one and three. I've placed the object, lightWave on frame 2, with another frame extending the keyframe out to frame 3.
Attached to it is the following object action:
onClipEvent (enterFrame){
this._width = (this._width*1.8);
this._height = (this._height*1.8);
}
It's called from the main timeline by a button that has the following code:
on (release){
if (lightWave._currentframe==1){
lightWave.play();
}
}
This works fine.
Yaaaaay!
I would like to put the following conditional on the object in the MC
onClipEvent (enterFrame){
if (this._width>=1400) {
gotoAndStop(1);
}
}
It doesn't work when I put it either in front of or behind the other object action. I have no clue why not.
However, if I remove the stop action on frame three, extend the frames of both layers to 15, and ad a goToAndStop(1) to the actionscript layer on frame 15, I get the effect I want. It grows to cover the stage and resets itself onto frame 1 of the MC.
Yaaaay!
Part of me is overjoyed to have this working at all, but I really feel the geeky need to understand the problem here. Why doesn't the conditional work? What am I doing wrong? I'm sure it's something simple and obvious to someone who really knows their stuff. Can anyone tell me why it doesn't work or how to get it to work with the conditional? I've used conditionals before and had them work; I don't understand what it is about this situation that's causing it not to work now. It's pretty basic and I feel like a ditz not being able to figure it out.
Neurotically yours,
Lee
Key Stroke Conundrum (have Searched)
This question relates to programing the end viewers input options.
I have a flash program with a number of icons which are modifiable according to the viewers commands. Is it possible to have these commands be keystrokes? i.e. When a certain icon is "active", pressing the a key will unmask or change a symbol on the icon.
Thx!
Movieclip Conundrum (Flash MX)
Hey,
Can someone translate the following command into Flash MX actionscript?
If movieclip A should enter frame P,
then have the main movie gotoandplay frame Q.
Is this even possible?
Thanks.
Importing Text Conundrum
question: what would be the best way to send long text strings from a component to another mc for someone on the development end?
to be specific:
i am building a flash app that dynamically loads a product movie where you can view features of it by clicking on icons on the product.
the trick is that i want to build each product "features" section so that designers who are flash illiterate can add icons to their new product movie, and then set the params via custom-built component for the icon buttons.
the components work great, but if i have any text w/ carriage returns, the component cuts off the text obviously at the carriage return. i'd like a cleaner way to export the text.
i'm not nec looking for an exact answer, but i'm brainstorming ideas to make the easiest user interface to modify these icons form the backend. i'm not sure if i was clear enough -- if not, let me know.
thanks,
jwt
Stacked Rollover Conundrum
Pretty simple problem to solve, but I've been unsuccessful thus far... I have a draggable movie clip with the following actions:
Code:
target_mc.onPress = function() {
this.startDrag();
}
target_mc.onRelease = function() {
this.stopDrag();
}
Inside this movie clip (and on top), I have a button to close the window. However, the onRelease action for the button is not being activated. The draggable movie clip is taking precedence and ignoring the button's actions. Is there a way around this problem? I'm scratching my head here...
[F8] Compass Conundrum - Should Be Easy
I made this compass. Motion tween, 360 frames - 1 revolution. Why does it revolve 410 degrees if the tween calls for 1 revolution?
What am I missing?
How can I fix it?
Do I need to calibrate Flash?
I
Xml Tree Conundrum/problem
Hello Everyone. I am an actionscript amateur and need some help in a problem.
Basically i need to attach a comment to an tree node. so that when the tree node is selected and the user types in some comment in a text area and presses the 'submit comment' button. their comment is saved against a tree node. Thus when a user selects that tree node then their comment is displayed (possibly in that text area).
- I have imported an XML file into flash and used the 'TREE' component to display it.
- I have created a text area - the user would type in some sort of comment in there.
- After comment is written when they press a button ("SUBMIT COMMENT") i need that comment to be saved against a tree node.
- Thus when a user clicks on that tree node their comment is displayed.
Do i need to store the comment as a variable? any help or pointers greatly appreciated.
Many thanks for your efforts.
Dynamic Text/xml Conundrum
Hi,
I am having a perplexing issue with loading image captions from an xml file. If I load them into dynamic text boxes on the main timeline they work fine, but if I try to load them into dynamic text boxes in an MC they don't work in spite of altering the path to accommodate the extra path element.
If I use this in a frame on the main timeline it works:
ActionScript Code:
_root.testCaption1.cap1Text.text = text1;
But if I use this to get the text into an MC called "picsMC" on the main timeline it doesn't work:
ActionScript Code:
_root.picsMC.testCaption1.cap1Text.text = text1;
I don't think it's an xml issue as that works fine on the main timeline, but I can't see what the problem with the dynamic text is on this. Any suggestions as to what I'm doing wrong here would be much appreciated.
Many thanks - Zaphod.
Closing Popup Conundrum
Hello,
Trying to deal with this problem that seems to be driving everyone I ask crazy.
I have an application that allows users to make updates to records in a mysql table. Everything works perfectly.
The application is delivered inside a popup window. I want to send a notification email as soon as the popup window is closed assuming the user has changed something.
If I could get rid of the 3 window control buttons that would be great - not gonna happen.
I know I can make an artificial close button, but the chances of users actually using that button are slim to non.
So that leaves me with one question: How on earth can I capture the unload event of a popup window and use it to call a function that sends me mail?
Thanks,
WARD
Disabling Buttons Conundrum
I'm building a site at the mo with pop up that can be activated and covers the main page with a new info page. This popup can be activated at anytime and will cover whatever is in the main page. Trouble is, buttons are still active from the main page when popup is displayed and given the site design the only way to stop this problem is disabling the buttons below. What is a good way of doing this? I was hoping flash keeps some sort of array of mc content and the buttons could be identifed this way but somehow i don't think this is likely!
Scroll Pane Conundrum...
i am using the scroll pane component. i'm duplicating some buttons within the mc specified in the links box. the code is:
projectArray = new Array('site 1', 'site 2','site 3', 'site 4','site 5)
for (i = 0; i <= projectArray.length; i++){
j += 17
duplicateMovieClip("but", 'but' + i, i)
eval("but" + i)._y = j
eval("but" + i).dis = projectArray[i]
}
but the scroll bar on teh pane doesnt scroll. is this because it doesnt think it needs to because it hasnt executed this bit of code yet?
if i just put a massive symbol in teh mc, tehn it does scroll fine.
- liz
Scrollbar Conundrum, Help Needed
dear all.
i have tried to get the scrollbar tutorial (http://www.kirupa.com/developer/flash8/scrollbar.htm) working on my page (http://www.expozure.net).
it is wonderfully written and guides you all the way through it. so even i, being a newbie, managed to get the idea.
it works like a charm with the mask over the movieclip-turned text. names can be scrolled up and down. great.
bummer, though, that every name has a button assigned to it, and this very button is not playing along, i.e. the buttons stay put whilst the names move. so, provided you scroll all the way down and click on the last name you actually click on the name of the last button in the mask'S window and not the last name in your contentMain instance.
difficult to explain with my english, sorry.
you can see the problem here, when you open up "series" ...
http://www.expozure.net/scrollbarfinal1.swf
any help would be appreciated.
happy holidays and thanks for reading
reinhard
Local Connection Conundrum
Hiya, I'm working on some banners and I would like to get them to interact with each other.
I am fine having them interact using Local Connection, the banners may not be running at the same time as some sites rotate their banners. This is fine as I can get the swfs to check if another one is running though a problem may arise if the user opens more than one web page.
Is there a way I can get a swf to check which web page it resides on or is there another way I can check to see that my two swf banners exist on the same web page?
Any suggestions much appreciated.
Cheers!
Dynamic Text Conundrum - Please Help
Hi there
I am trying to do something simple, just doing it wrong:
I have a dynamic text field with the VAR name quotemaker.
I am trying to load the right value into it by doing this
quotemaker = [quote + i];
where quote1, quote2, etc are variables with string values, however all that is returned is "quote1", not the value i set for quote1.
my brian hurts. help.
thanks for any input!
S
Disabling Buttons Conundrum
I'm building a site at the mo with pop up that can be activated and covers the main page with a new info page. This popup can be activated at anytime and will cover whatever is in the main page. Trouble is, buttons are still active from the main page when popup is displayed and given the site design the only way to stop this problem is disabling the buttons below. What is a good way of doing this? I was hoping flash keeps some sort of array of mc content and the buttons could be identifed this way but somehow i don't think this is likely!
_root + Path Conundrum..
Hi, I'm designing a CD-ROM which will run at a show WITHOUT an internet connection. What I want to do is have an about page with my details on it and a button which launch either a copy of my whole website (files on the CD) or my own CD-ROM exe file (also on the CD)..
Is this possible to do in flash with the GETURL action? If so, how do I code it so no matter waht the drive letter on the CD drive is, it will run (ie: _root + path syntax)?
I'm sorry but this is kind of urgent as the CD-ROM must be out by beginning of next week, Any help would be greatly appreciated..
Cheers,
Paul @ basepoint designz LTD..
basepoint designz LTD www.bpdesignz.com
Dynamic Menu Conundrum
Hello again, haven't been around for awhile, but I am back, with a question!
So, I have this portfolio site, starclops.com. You may notice the dynamic menu. I adapted it from a source file (can't recall where from), muddled through the actionscript to customize it, and got it working to a point.
My problem is that the menu was built to only have 9 submenus (not sure why, perhaps it was simpler that way) and I have more then 9 pieces of work. I've tried again and again but I can't figure a way to increase this number. My guess is it's fairly simple, but I don't have the experience to pinpoint it.
I've tried messing with this code that controls the submenus, but no luck:
ActionScript Code:
//initialize submenu by creating and positioning movie clips
for (i=1; i<=_parent.total; ++i) {
//check to see if the item has a submenu
if (_parent["subText"+i]>=1) {
name = "stext"+i;
for (n=1; n<=_parent["subText"+i]; ++n) {
levelTrack += 1;
subMenuMC.duplicateMovieClip(name+n, levelTrack);
this[name+n]._visible = false;
this[name+n].choice = (i*10) + n;
}
It kind of complicated (to me) so:
check out the source file
Thanks in advance for any help.
cheers
owen
Add Up Several Variable With FOR LOOP
Heya,
How can I solve this problem:
I would like to add up the result of several variables (pm1 & pm2 etc..) into a variable called total.
If I use the script below it works. But it's a lot of typing and especially not dynamic. What if a user would like to have 18 input fields instead of 17
total=(Number(pm1))+(Number(pm2))+(Number(pm3))+(N umber(pm4))+(Number(pm5))+(Number(pm6))+(Number(pm 7))+(Number(pm8))+(Number(pm9))+(Number(pm10))+(Nu mber(pm11))+(Number(pm12))+(Number(pm13))+(Number( pm14))+(Number(pm15))+(Number(pm16))+(Number(pm17) )
I think it should look something like this:
pm[Number] = i;
for (i=0; i<17; i++) {
temp = (Number(per_maand[i]));
total = temp+(Number(per_maand[i]));}
maybe you can tell me how it can be done so it will work
Thank you for your time!
Xander
Loop Variable
where the heck is it I can change the loop variable to false and have the movie stop at the end instead of repeating?
Variable Within Loop
I'm generating a variable within a loop. The values come from an array. Each time the loop iterates, the variable stores a movieclip name and a property. For instance:
clipVar = square1._x=100
How do I get the value of the variable to execute within (or outside of) the loop? I don't want to use setProperty as this may be used for objects other than movieclips. I just want to run the above statement.
Help!!!
While Loop Variable
I am trying to make a loop and apply button actions to some movieClips. In Example 1, value of "i" get passed fine. In example "2" "i" get's passed as a value of 6 every time. How can I get around this?
Code:
function imageMenuInit(Void):Void {
var i:Number = 0;
while (i<6) {
// Example 1
this["button"+i+"_mc"].onRelease = function() {
// Example 2
loadLargeImage.loadClip('images/img'+i+'.jpg', container_mc);
};
i++;
}
}
this.imageMenuInit();
Variable In For Loop
Hi all,
Is there a better way to write the below codes?
Currently, I always do this:
for (var i = 0; i < 6 ; i++)
{
_root["my_mc"+i]._visible = false;
}
But this time round, this set of my_mc are within a number of movie clips. If I were to write this way, my line of code would be
_root.firstLevel.secondLevel.thirdLevel.fourthLeve l["my_mc" + i]._visible = false;
which is very very long. Anyone knows of another way to write this? Thanks in advance
Using A Variable In A Loop
what is the proper syntax/method for using the variable "total" in the following loop? And how do I make sure the value of total is a number and not a string of text?
for (i=1; i<=total; ++i){
    var returned = returned+"
"+search["Summary" +i];
}
-steve
Variable In For Loop
Can a variable be used in a FOR loop; If not is there some other way to accomplish the same thing?
This script works
for (i=1; i<6; i++)
This script deoes not work - I assume because of the variable "strVar"+i
for (i=1; i<=_Level0["strVar"+i]; i++)
Simple Loop
Hi there,
well, I'am new in actionscripting and now I try to get started...
But now I've got a little problem...(I know, the solution will be
quiet easy.
I was trying to creat a little loop in actionscript, which allows me to give a variable every time it is recalled a bigger worth. (e.g +1)
How should such a movie look like?
Hope somebody can help me
Thanks
Daniel,
Germany
|