Lateral Though Required For “rotation” Conundrum
Hi,
By way of practice I have set a little application that works as follows:
The user enters a time in an input field in 1 – 12 o’ clock format & the hands of a clock then go round to the allotted time, whereupon a little graphic jumps out of bed. (There is also a dynamic text field that confirms the time entered into the input text field.)
I have got the whole thing to work great up until the hands of the clock go past 6 this is because the equation I have used to calculate the rotation of the hands only works up till 180 degrees:
code: sec_mc.onEnterFrame=function(){this._rotation+=1; if (this._rotation > (Number(time)*30)){bed_mc.play(); sec_mc.onEnterFrame=null; //time being the variable name for the input text field.
The problem is after 180 rotation counts down from –180 to 0 which throws my equation totally out of whack! I have tried a few work arounds but get nowhere I think the basic problem is that one equation will not work for both parameters.
Anyone any idea how to get round this?
Cheers
Action script in full
code: lew_txt.backgroundColor=0xFFCC66; time_txt.backgroundColor=0xFFCC66; function clean(){
sec_mc.onEnterFrame=function(){this._rotation+=1; if (this._rotation > (Number(time)*30)){bed_mc.play(); sec_mc.onEnterFrame=null; }
}
lew_txt.text="Lewis has to get up at "+time +" 0'clock"; }
blu_btn.onPress=clean;
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-17-2005, 07:03 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Rotation Menu Help Required:
Hi Guys,
I am currently trying to customize one of the rotation style menus that I d/loaded from the Fla's section. This version loads the array details into a movieclip called "clip" that is scripted directly from the library. "Clip" contains a dynamic text box called txtName and an image of a folder. When the script runs, it duplicates "Clip" the same amount of times as there are entries in the Array and allocates each part of the array (a url and a text entry) to each version.
What I would really like to do is, instead of having the same image for each item in the menu, I would like to load a different jpg for each one.
Am I right to think I would have to edit the "Clip" moveclip, add a blank container movieclip which would have to be named. Then I would have to write another array referencing the images and then target and load that into the container clip inside the "Clip" movie ? Is this the correct way?
How would I target the container inside the "Clip" movie (which is in the library!) and also how would I syncronize the array so that it referenced the correct image with the correct text and link ?
Sorry if this doest make much sense. I have included the code below. Basically, if somebody could suggest a method/script for having a different image for each item in the menu I would be really greatfull!
Huge thank you to anybody that can help me out.
Code:
fscommand("allowscale", "false");
links = new Array();
links[1] = ["http://www.myspace.com/jmarmusic", "J-Mar Music", "01.jpg"];
links[2] = ["http://www.myspace.com/bw2music", "BW2 Music"];
links[3] = ["http://www.myspace.com/templaterecordings", "templateRECORDINGS"];
links[4] = ["http://www.multimedia.de", "JB-PRO"];
links[5] = ["http://www.flashforum.de", "Lucky Devil"];
links[6] = ["http://www.flashmx.de", "templatePRODUCTIONS"];
posX = Stage.width/2;
posY = Stage.height/2;
// Clips Erzeugen
anzahl = links.length-1;
for (var i = 1; i<anzahl+1; i++) {
attachMovie("clip", "clip"+i, i);
}
// Global Signal
_global.signal = true;
this.onEnterFrame = function() {
if (signal) {
mausPos += ((_root._xmouse-posX)/100);
for (var i = 1; i<anzahl+1; i++) {
winkel = ((mausPos+(360/anzahl*i))*Math.PI)/180;
this["clip"+i]._x = posX+(Math.sin(winkel)*300);
this["clip"+i]._y = posY+(Math.cos(winkel)*150);
this["clip"+i]._xscale = 100+(Math.cos(winkel)*50);
this["clip"+i]._yscale = 100+(Math.cos(winkel)*50);
this["clip"+i].swapDepths(1000+(Math.cos(winkel)*100));
this["clip"+i].txtName = links[i][1];
this["clip"+i].url = links[i][0];
this["clip"+i].onRelease = function() {
getURL(this.url, "_target");
signal = false;
};
this["clip"+i].onRollOver = function() {
signal = true;
};
this["clip"+i].onRollOut = function() {
signal = true;
};
}
}
};
planet.swapDepths(999+1);
Help With Lateral Scrolling & OnEnterFrame
Hi,
I just don't know how to fix this problem.
I'm developing a website with the navigability based on horizontal scrolling, if you move your mouse on the left, the website will scroll to the right, and viceversa, quite simple.
Everything is arranged using an onEnterFrame that checks the mouse position and assign a new position to the mc. The problem with the onEnterFrame is that each animation on the stage gets really slow, until I kill the onEnterFrame, and everything seems to work fine.
Any ideas?
Mouse Lateral Movement
baically I have this code on a frame referencing a movie clip:
ActionScript Code:
obj1xi = obj1._x;
obj1yi = obj1._y;
obj2xi = obj2._x;
obj2yi = obj2._y;
//
this.onMouseMove = function() {
posx = _xmouse;
posy = _ymouse;
this.onEnterFrame = function() {
obj1._x += ((obj1xi-posx/2)-obj1._x)/4;
obj1._y += ((obj1yi-posy/2)-obj1._y)/4;
obj2._x += ((obj2xi-posx/14)-obj2._x)/10;
obj2._y += ((obj2yi-posy/14)-obj2._y)/10;
// stop onEnterFrame when done
if (int(obj1._x) == int(obj1xi-posx/2) && int(obj2._x) == int(obj2xi-posx/14) && int(obj1._y) == int(obj1yi-posy/7) && int(obj2._y) == int(obj2yi-posy/14)) {
delete this.onEnterFrame;
}
};
};
problem is I need to get the height and width of the movie clip so that it it can return a maximum scrolling value for the clip.
can anyone point me in the right direction?
Actionscript Pro Required: Syntax Help Required For Button To Initiate Easing
Hi guys I was wondering if any of you actionscript daddio’s could give me 2 minutes of your time and help me write the appropriate syntax to make the below example work on a button release rather than on the MC mouse down state that it currently uses.
http://www.fluid.com/experiments/timecode/mx_time.html
If you click on the geek panel drop down menu, you will see that it generates the appropriate code for the on onMouseDown,, however I want to call the easing from a button.
If someone could give me an example of the correct syntax using the “easeInquad” function that would be brilliant.
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
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.
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
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");
};
}
};
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
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
Bytes Loaded Preloader Conundrum
Hi all - is there any SIMPLE way (sorry I'm a designer not a developer and a bit thick when it comes to high-end action script) you can substitute the bit in a preloader that says "if FramesLoaded = 'x', gotoandPlay 'y' ", with something like " if BytesLoaded = 23453, gotoandPlay Frame 15".... you get the idea. I want to make my percentages more accurate. I'm sure it's perfectly simple but I can't find anything in the help index. Oh yeah and I'm using MX.
Thanks for reading!
(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
Drag & Drop Quiz Conundrum
I've designed a drag n drop app that aims to teach kids how to dress properly (in layers) for winter sports (skiing/snowboarding, etc.). I've got a character waiting to be dressed and various items of gear to be dragged on (as well as an attachmovie action that describes the item with copy).
Here's the link to check out the application (comments welcome) -
My problem is that I'd like to set it up so that once you dress the character correctly, he skis off hootin' & hollerin'. The correct order would be base layer first (when you drag the correct layer to the correct location on the body, the item snaps in place) then Layer 2, and so on. Once the character is dressed correctly and all pieces of gear are in place, the user clicks "GO SKIING" and the character slaps on his gear and skis off.
Thanks very much for any insights & assistance with this. It's for a good cause
Drag & Drop Quiz Conundrum
I've designed a drag n drop app that aims to teach kids how to dress properly (in layers) for winter sports (skiing/snowboarding, etc.). I've got a character waiting to be dressed and various items of gear to be dragged on (as well as an attachmovie action that describes the item with copy).
Here's the link to check out the application (comments welcome) -
http://www.northpoledesign.com/sia/newhowtodress/newhowtodress.htm
My problem is that I'd like to set it up so that once you dress the character correctly, he skis off hootin' & hollerin'. The correct order would be base layer first (when you drag the correct layer to the correct location on the body, the item snaps in place) then Layer 2, and so on. Once the character is dressed correctly and all pieces of gear are in place, the user clicks "GO SKIING" and the character slaps on his gear and skis off.
Any insights as to how to pull this off, I appreciate it very much. Thanks.
Flash/Opera/Javascript Conundrum
I've created an application that launches pop-up windows from links within the application using syntax of the form:
my_as_function(){getURL("javascript:alert(Hello, world');");}
That is to say, clicking on a link launches an actionscript function that in turn launches a javascript function.
This works just dandy in every browser and OS I've tried it with EXCEPT Opera.
The really weird bit is that it DOES work in Opera if I just open the file using the application. When I bung it on the server and try to access it over the internet, though, absolutely NOTHING happens. The javascript just isn't executed, even if it's something basic like an alert.
I've checked all the obvious stuff, like making sure I've got javascript enabled on the browser itself. Other users report the same problem. Any idea what might be going on?
Countdown Conundrum Clock - UK Game Show
Can anyone help to get me started designing the face of an anolog clock which only shows the second hand and counts round to thirty (half-way). Importantly the background color of the clock needs to change color as the hand sweeps round.
Examples of this can be found at the bottom page on the following URL;
http://www.geocities.com/ukquizshow/countg.htm
Many thanks in advance.
ActionScript 3 Conundrum – File Included
Link to see it
If you tooltip to fast over the movie poster the slide-out-wings don’t go back behind the poster. They are controlled by the same function that fades the poster in and out and that works fine. I think it must have something to do with the way I used the Tween class.
I am new to AS3 and I have tried everything I can think of or get this bug to go away.
Thanks for your help
-Joey
Files: http://epicguides.net/mooflataEXP.zip
Rotation Script - Smooth Rotation
I have created a speedometer and on clicking a speed, I can get the needle to rotate around to the speed clicked, using _rotation.
However, the movement is very 'jumpy' and I would like to make it smoother, or better still accelerate/decelerate.
I have tried the following
Quote:
on (release) {
rotation_speed = 0.1;
if (speedo._rotation > -40)
{
do {
rotation_speed = rotation_speed * 1.1;
speedo._rotation = speedo._rotation - rotation_speed;
} while (speedo._rotation > -40);
}
else {
do {
rotation_speed = rotation_speed * 1.1;
speedo._rotation = speedo._rotation + rotation_speed;
} while (speedo._rotation < -40);
}
}
I want to get the needle round to -40, so whilst it is greater rotate is backwards, otherwise rotate forwards, starting with a small rotation and increasing (accelerate).
I found that this was still jumpy. Trying a negative causes Flash warning about script running for too long.
Rotating forwards (else) also overshoots the end position of -40
Any ideas on how to get the needle moving smoothly and finishing on the correct spot??
AS3 - "Nested" Buttons Conundrum
Hello AS3 Wizards,
Need some guidance with a problem that I'm coming up against. Here's the scenario:
I've created a parent MovieClip that, upon rollOver, turns on two MovieClips within its hit area that act as buttons. Imagine a box that you roll over to reveal to clickable options within that box.
So - Obviously the parent box has an event assigned to it. The problem I'm having is that when you rollover the interior buttons - the parent box receives the rollOut event, and the whole thing falls apart! When i set mouseChildren = false, then the interior buttons don't seem to register any events...
Any thoughts on the best way to approach this?
Thanks in advance!
-marshall
|