Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Tricky Dynamic Scroller PHP Flash MX Loading Variables Problem HELP



Okay, here is what I am trying to do

I want to have a field, with a component scrollbar, populated by text which is generated out of a php file (ultimately a database).

I could get the text to load out of the file without scrolling, then I discovered (as I understand it) that you have to be tricky when using the component scrollbar that comes in Flash MX.

I read this articlehttp://www.macromedia.com/support/fl...t_scrollmx.htm

and copied the actionscript as best I could.

To make things extra fun, I want to use buttons to switch between different text content for the textbox (instance for the Dynamic Textbox is "scroller")

to do this I am exploiting a PHP trick that lets you send a variable from flash (in this case "my_func_name") to PHP, which then call a
function in php

$my_func_name(); to call a function and echo text to the screen.
see this tutorial (its where i got the idea)

ok. Still with me ?

Now, the trace thing says that the variables are loading into the movie just fine, but I cannot get them to appear in the text box no matter what I try !

the fla is attached, and the webbased php file link is in the file if you want to have a look at it (plus it is reproduced below).

***************************** PHP CODE *****************************
<?

function news()
{
$message = "&var1=this is the news one<br>
<br>
scrollbar<br><br>
<br>
scrollbar why dont you work for me<br><br>
<br>
scrollbar<br>scrollbar I just want to be free<br><br>
<br>
scrollbar please work and let me go<br><br>
<br>
scroll bar please let me play in the snow<br><br>
<br>
<br>
any solutions to this problem to <a href="mailto:mikeb@blunt.com.au">mikeb@blunt.com .au</a>";
//$output = urlencode($message);
//echo $output;
echo $message;
}

function about_us()
{
$message = "&var1=this is the about us one<br>
<br>
this is scrollable stuff about us apparantly<br>
<br>
<br>
<br>
<br>
scrolling ha, like it will EVER work<br>
because<br>
it<br>
NEVER<br>
EVER<br>
works<br>
for <br>
me<br>
please work!";
//$output = urlencode($message);
//echo $output;
echo $message;
}

if(!$my_func_name)
{
$my_func_name = 'news';
}
$my_func_name();
echo "<br><br><br><br>";
?>********************* END PHP CODE ********************************


******* Action script in a button **********
on (press)
{
myVarsSend = new loadVars();
myVarsSend.my_func_name = "news";

myVarsLoad = new loadVars();

//assign a function which fires when the data is loaded:
myVarsLoad.onLoad = function(success) {
if (success) {
trace("done loading");
//Now that we know the data is loaded,
//set the text content of the Text Field
//with the instance name "scroller" equal to the
//contents of the variable
scroller.html = true;
scroller.text = this.var1;
} else {
trace("not loaded");
}
};
myVarsSend.sendAndLoad("http://www.blunt.com.au/2003/a51/function.php", myVarsLoad, "POST");

}
********************************************

I have read a bunch of other PHP / Flash posts and dynamic scrollbar posts but nothing seems to work ! so if anyone can help me it would be enormously appreciated !

mike



FlashKit > Flash Help > Flash ActionScript
Posted on: 05-10-2003, 10:38 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Flash Mx Popups And Variables, Tricky One?
Hi all,

I'm just wondering if there is a way to send a variable from the main movie to a popup window that contains an swf. I'd appreciate any tips on how to do that preferably without any php or cgi stuff since for now my server doesn't support those applications. Here's the code for what I'm trying:

In the main movie
on (release) {
getURL("javascript:window.open('./large/cantera1a.html','picture','width=800,height=361,to p=20,left=20'); void(0)", "", "POST");
}

In the swf at the popup (in a MC):
onClipEvent (load) {
this.preloader["text" add _global.language]._visible = true;
}


Ta

Loading Ext Variable - Tricky Tricky...
Loading ext variable - tricky tricky...

I have this external txt file that contain some variable that i wanna include in a swf while it is running. The unique part about the variable in the txt file is that they all share the same variable name, but differen value.

In the swf itself, i will have different(say 5) mc, each containing a dynamic field with the same name.

So my problem is as below:
Is there anyway u can strip the infomation/variable in flash so that all the variable of the same name will be place into different mc? Sound confuse? download this dummy structure file to get wat i mean
http://www.chupcreations.com/forum/test.zip

Thanks in advance!
chup

Loading An Ext Swf +text Variables+component Scroller
Ok, this is my problem:

I would like to do a gallery with loaded external swf`s. On the main movie there is already prepared text field and the component scroller. There is also a button which suppose to load the external
swf. The external swf contains several frames with jpgs or whatever, each jpg require a long description which has to be loaded to the textfield on main page.

Im trying to load the variables to the main movie, by puting the following code to the external swf :

--------------------------------------------
loadVarsText = new LoadVars();
loadVarsText.load("text.txt");
loadVarsText.onLoad = function(success) {
if (success) {
my_textfield.html = true;
my_textfield.htmlText = project; //I reckon, here I should put the destination//

} else {
trace("not loaded");
}
};
-----------------------------------------------------

In the attachment there is a clear example.

Please help, i really have to finish whole thing by friday, and i can`t go any further!

Thanx in advance
Slo.

Tricky Coding Dynamic Page W/Flash Object Script
I'm trying to apply the Flash Object script to a dynamically generated menu that was originally coded using standard object & embed tags.
Ok, this is the original coding on the page:

Code:
<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://macromedia.com/cabs/swflash.cab#version=6,0,0,' id='flaMovie2' width='140px' height='22px'>
<param name='movie' value='".THEME."images/mediabong.swf' />
<param name='FlashVars' value='linkname=$link_name&url=$link_url&link_append=$link_append' />
<param name='quality' value='medium' />
<embed src='".THEME."images/mediabong.swf' FlashVars='linkname=$link_name&url=$link_url&link_append=$link_append' width='140px' height='22px' type='application/x-shockwave-flash'>
</embed>
</object>

And I want to make this work with the Flash Object script, what do I need to do? Here is what I have but it is only returning 1 of the 7 dynamically generated buttons.

Code:
<div id='flashcontent1'>
Alternate content here.............
</div>
<script type='text/javascript'>
// <![CDATA[
var fo = new FlashObject('e107_themes/mediabong/mediabong.swf', 'mediabong', '148', '22', '6', '#ffffff');
fo.addParam('FlashVars', 'linkname=$link_name&url=$link_url&link_append=$link_append');
fo.addVariable('linkname', '$link_name');
fo.addVariable('url', '$link_url');
fo.addVariable('link_append', '$link_append');
fo.write('flashcontent1');
// ]]>
</script>


Can't seem to make it return more than 1 of the 7 buttons in my menu.

Any ideas?
Thanks,

Loading Dynamic Text With Scroller
While loading dynamic text (txt files using loadVariablesNum)

how do I get it to work while using the Flash MX scroller?

Loading Text Into A Dynamic Scroller
another dynamic scroller question
is there a way to load text that was created in word into a dynamic scroller or can you only use notepad.
also what would the script be to load the text into the script

Dynamic Loading Of Images Into A Scroller With ASP?
hi,

I wud like to create a scroller movie clip which contains the strip of jpg image files. some 100 jpg files are stored in a folder. Out of which 5 jpg file will be taken out dynamically from the folder. i have written the code in ASP to pick 5 jpg files from the folder. the output text from the asp file is given below.

imgs_src1=C:Inetpubwwwrootpics8.jpg&imgs_src2= C:Inetpubwwwrootpics4.jpg&imgs_src3=C:Inetpub wwwrootpics5.jpg&imgs_src4=C:Inetpubwwwrootp ics7.jpg&imgs_src5=C:Inetpubwwwrootpics6.jpg&

i m trying write Action script code to align the picked files into the movie clip to scroll from left side to right side. can anyone give idea to start and proceed the code... ???

Thanks in advance!!!!

Loading Dynamic Text In Easing Scroller - Problem
sorry for the double post, i posted the message in the wrong section ... QUESTION: i downloaded one of the easing scrolls from the kirupa forum and i need some help on how to load dynamic text into the scrollbar. can anyone give me some ideas on how the script would be modified. i tried to modify the xml with the scroll but by screen turns black and the text/scrollbar don’t work. appreaciate any help. I attached the file here what i downloaded.


Code:
THIS CODE IS IN THE AS FILE

import mx.utils.Delegate;
class Rolagem {
// VARIABLES
// ---
// MCs to be used
private var btnUp:MovieClip;
private var btnDown:MovieClip;
private var dragger:MovieClip;
private var scrollbg:MovieClip;
private var contentMain:MovieClip;
private var contentMask:MovieClip;
// Settings variables
private var moveSpeed:Number = 1;
private var easingSpeed:Number = 7;
private var scrollWheelSpeed:Number = 20;
// General use variables
private var mouseListener:Object;
private var left:Number;
private var top:Number;
private var right:Number;
private var bottom:Number;
private var scrollable:Number;
private var initContentPos:Number;
private var scrollHeight:Number;
private var easing:Number;
// CONSTRUCTOR
// ---
public function Rolagem(easing:Number, btnUp:MovieClip, btnDown:MovieClip, dragger:MovieClip, scrollbg:MovieClip, contentMain:MovieClip, contentMask:MovieClip) {
this.btnUp = btnUp;
this.btnDown = btnDown;
this.dragger = dragger;
this.scrollbg = scrollbg;
this.contentMain = contentMain;
this.contentMask = contentMask;
this.easing = easing;
this.scrollHeight = this.scrollbg._height;
// how much of the movie can be scrolled
this.scrollable = this.contentMain._height - this.contentMask._height;
this.initContentPos = this.contentMain._y;
// the drag positions that are possible for the dragger
this.left = this.scrollbg._x;
this.top = this.scrollbg._y;
this.right = this.scrollbg._x;
this.bottom = this.scrollbg._height - this.dragger._height + this.scrollbg._y;
this.contentMain.setMask(this.contentMask);
// before we do anything make sure the content is even scrollable, if it isn't hide everything and return
if (this.scrollable < 0) {
this.dragger._visible = false;
this.btnUp.enabled = false;
this.btnUp._alpha = 50;
this.btnDown._alpha = 50;
this.scrollbg._alpha = 50;
this.btnDown.enabled = false;
return;
}
this.scrollbg.useHandCursor = this.dragger.useHandCursor = false;
this.scrollbg.onPress = Delegate.create(this, scrollPress);
this.dragger.onPress = Delegate.create(this, dragPress);
this.dragger.onMouseUp = Delegate.create(this, dragMouseUp);
this.btnUp.onPress = Delegate.create(this, btnUpPress);
this.btnUp.onDragOut =
this.btnUp.onRelease = Delegate.create(this, btnUpDeleteEnterFrame); //Delegate.create(this, btnUpDragOut);
this.btnDown.onPress = Delegate.create(this, btnDownPress);
this.btnDown.onDragOut =
this.btnDown.onRelease = Delegate.create(this, btnDownDeleteEnterFrame); //Delegate.create(this, btnDownDragOut);
this.contentMain.onEnterFrame = Delegate.create(this, contentEnterFrame);
// Registering the listener
this.mouseListener = new Object();
Mouse.addListener(this.mouseListener);
this.mouseListener.onMouseWheel = Delegate.create(this, mouseWheel);
updateContentPos();
}
// onEnterFrame of the content
private function contentEnterFrame():Void {
if (!this.easing || this.easing == undefined) {
this.contentMain._y = this.contentMain.newY;
} else {
this.contentMain._y += Math.round((this.contentMain.newY - this.contentMain._y) / this.easingSpeed);
}
}
// Updates the contents position
private function updateContentPos():Void {
var percent_scrolled:Number = (this.dragger._y - this.top) / (this.scrollHeight - this.dragger._height);
// instead of setting the _y property directly, we simple set newY
// that way we can adjust how we handle the new Y coordinate we'd like to move to
this.contentMain.newY = Math.round(this.initContentPos - (percent_scrolled * this.scrollable));
}
// Dragger actions
private function dragPress():Void {
startDrag(this.dragger, false, this.left, this.top, this.right, this.bottom);
this.dragger.onMouseMove = Delegate.create(this, dragMouseMove);
}
private function dragMouseMove():Void {
updateContentPos();
updateAfterEvent();
}
private function dragMouseUp():Void {
this.dragger.stopDrag();
delete this.dragger.onMouseMove;
}
// Background of the Dragger actions
private function scrollPress():Void {
if (this.scrollbg._parent._ymouse > this.scrollbg._y + this.scrollbg._height - this.dragger._height) {
this.dragger._y = this.scrollbg._parent._ymouse;
this.dragger._y = this.scrollbg._y + this.scrollbg._height - this.dragger._height;
} else {
this.dragger._y = this.scrollbg._parent._ymouse;
}
updateContentPos();
}
// Up Arrow actions
private function btnUpPress():Void {
this.btnUp.onEnterFrame = Delegate.create(this, btnUpEnterFrame);
}
private function btnUpEnterFrame():Void {
this.dragger._y = Math.max(this.top, this.dragger._y - this.moveSpeed);
updateContentPos();
}
private function btnUpDeleteEnterFrame():Void {
delete this.btnUp.onEnterFrame;
}
// Down Arrow actions
private function btnDownPress():Void {
this.btnDown.onEnterFrame = Delegate.create(this, btnDownEnterFrame);
}
private function btnDownEnterFrame():Void {
this.dragger._y = Math.min(this.bottom, this.dragger._y + this.moveSpeed);
updateContentPos();
}
private function btnDownDeleteEnterFrame():Void {
delete this.btnDown.onEnterFrame;
}
// Mouse Wheel
private function mouseWheel(delta:Number):Void {
var d:Number;
if (delta > 1)
delta = 1;
if (delta < -1)
delta = -1;
d = -delta * this.scrollWheelSpeed;
trace(d);
if (d > 0)
this.dragger._y = Math.min(this.bottom, this.dragger._y + d);
if (d < 0)
this.dragger._y = Math.max(this.top, this.dragger._y + d);
updateContentPos();
}
}

Code:
THIS CODE IS IN THE FLA

var rolagem:Rolagem = new Rolagem(10, mc_sobe, mc_desce, mc_rolagem, bg_rolagem, mc_conteudo, mc_mascara);

Tricky Question With Posted Variables
Hi everybody,

I have a quite tricky question. I have a swf-file that is dynamically actualised by my customer (by php). So far so good. Now he wants the text, the user of his site is typing into the input textfields, get mailed. I manage to do this with name, message, and email adress. But how can I post the other input textfield entries to his email adress. There are several input textfields like age, profession, nationality and so on. Can you help me?

Thanx in advance

Tricky AS Question - Passing Variable Variables
hey all. i have a prototype function called changeIt that essentially alters any mc property at any rate. the setup looks like this:

MovieClip.prototype.changeIt = function(prop:String, newVal:Number, speed:Number, functionLocation:MovieClip, whenComplete:String, param:Array) {

(ill spare you all of the code because this part works fine). i wanted to add a feature that allows the user to call a SECOND function when the first call is finished. in other words, if one wants to change an mc's _xscale from 50 to 200, then, once the mc is at _xscale=200, bring the _alpha down to 0, etc etc. hence the intended purpose of the last three parameters of the function (functionLocation, whenComplete, and param).

this part works fine, too, so long as the second function that is being called has no parameters. however, im having difficulty with the syntax of calling a function that has parameters. below is my code, which isnt working properly:

[COLOR= darkblue]// ... once the function is completed[/color]
if (functionLocation) {
if (!param) functionLocation[whenComplete](); // works fine
else {
var p:String="";
for (i=0;i<param.length;i++) p+=param[i]+",";
functionLocation[whenComplete](p);
}
}

so, in other words, this call works great:
mc1.changeIt("_xscale",200,5,_root.mc2,"stop");

and this call is totally wrong:
mc1.changeIt("_xscale",200,5,_root.mc2,"moveTo",[15,50]);

this syntax seems to be passing all of the parameters in as a single string (which i realise is clearly wrong), instead of passing them as distinct variables separated by commas. is something like this possible in flash, and if so, how the hell do you do it? any help would be GREATLY appreciated!

cheers

Loading Movie Is Tricky
I have 4 scenes,

1.preloader...which I used to preload the e-card and the two swfs...

2.e-card...which runs normally....

3.
ame...which I want to start from previously being preloaded...

4.age...same as name scene.

......

Is there a way to preload in the preloader two external .swfs but send the .swf to scene 3 and 4...

and if so...how...

and if so...how do I call them at scene 3 and 4.

thanks

HELP Tricky Loading And Unloading MC
I have a long verticle movie clip (Main), made up of four smaller movie clips (sub-Main).

To move between the sections I have this code

curSection = 0;
mySections.onEnterFrame = function() {
this._y -= (this._y-_root.curSection)*1;
};

and my buttons say:

on(press) {_root.curSection = 0;
}
and
on(press) {_root.curSection = -400;
}
etc . . .

In each of the sub-Main movie clips I have an empty movie clip with an instance name. This allows me to load an external .swf file. I use:
this.loadMovie("external.swf");

What I want to do is have these movies load ONLY when they are visible on the stage. That means they must unload too. I am having a problem with it. Any suggestions?

-shotbot

Very Tricky Pre-loading System
Hi everyone

I have a bit of a tricky project and I'm wondering if anyone can help me.

Basicly the webite is a photo gallery for my company which contains hundreds of images of all the products. No actual data is hard-coaded into the movie, it is all loaded dynamically from an XML file which has product data and the URL's for the images.
At the moment I have nine products per page and as you scroll through is loads the next nine images as you need them, this means that there is always a pause between pages. I am looking for a way that I can start downloading as many of l my images as possible as soon as the movie starts so that there will not always be the pause as you scroll through (I would like it to keep on loading in the background as the user is browsing.

I am quite new to flash so the problem is that I dont know where to store these images until they are needed? As I said the number of total images is always changing so I cant have a fixed number of movieclips to load them into. I need some sort of place holder that can hold all these images until needed and then load them into the movie clips on the stage.

Does anyone know of any tricks to handle this sort of thing??? I would greatly appreciate any help.

Thanks for your time

SG

Help With Loading Dynamic Variables
I have really been struggling with this problem and im hoping somebody can point me in the right direction. Im trying to figure out how i can have a user type in their zip code, do a search and match that zip code to one of 13 movies. Is this a big array (13,000 us zips) or am i missing something.
Thanks for the help.

Help With Loading Dynamic Variables
I have a movie that shows a map of the UK, all my customers are represented as a small triangle(button symbol)
when a customer is clicked I loadvariables from an ASP page that queries a db only for that customer and show them on the next frame these are the customers name, address etc about 20 variables then the "showvaribles frame" has a close button which puts me back to the begining of the movie,works great

What happens when I chose another customer, will they variables conflict ie 2 sets of var1?
can i unload the variables? that would be best
can I use var1 to 10 on one customer and 100 to 110 on another ? thats gonna be messy

any help appriciated

Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.

Here's the code:
scrolling = function () {

var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};

scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};


btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};

if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();

Any ideas?

Thanks,
Dave

Convert Movieclip Scroller To Dynamic Text Scroller
I have code I borrowed that is set up to scroll a movie clip image. However, it doesn't work well if I replace the graphics with a text box as the scrolling becomes "jerky" as I think there is too much information for it to process with the complexity of the text. So I was hoping to change the scrolling content from a movie clip image with text to a dynamic textbox. But it will not function when I do that change. In this currrent setup, the movieclip instance name is "contentmain". I tried naming the instance of the dynamic textbox with that name, but no text shows up next to the scroller when I play the movie.

Here's the code:
scrolling = function () {

var scrollHeight:Number = scrollTrac._height;
var contentHeight:Number = contentMain._height;
var scrollFaceHeight:Number = scrollFace._height;
var maskHeight:Number = maskedView._height;
var initPosition:Number = scrollFace._y=scrollTrac._y;
var initContentPos:Number = contentMain._y;
var finalContentPos:Number = maskHeight-contentHeight+initContentPos;
var left:Number = scrollTrac._x;
var top:Number = scrollTrac._y;
var right:Number = scrollTrac._x;
var bottom:Number = scrollTrac._height-scrollFaceHeight+scrollTrac._y;
var dy:Number = 0;
var speed:Number = 10;
var moveVal:Number = (contentHeight-maskHeight)/(scrollHeight-scrollFaceHeight);

// Setup easing event
contentMain.desiredX = contentMain._y;
contentMain.onEnterFrame = function() {
this._y -= (this._y - this.desiredX) / 3;
};

scrollFace.onPress = function() {
var currPos:Number = this._y;
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
dy = Math.abs(initPosition-this._y);
contentMain.desiredX = Math.round(dy*-1*moveVal+initContentPos);
};
};
scrollFace.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};


btnUp.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x+speed<maskedView._x) {
if (scrollFace._x<=left) {
scrollFace._x = left;
} else {
scrollFace._x -= speed/moveVal;
}
contentMain._x += speed;
} else {
scrollFace._x = left;
contentMain._x = maskedView._x;
delete this.onEnterFrame;
}
};
};
btnUp.onDragOut = function() {
delete this.onEnterFrame;
};
btnUp.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onPress = function() {
this.onEnterFrame = function() {
if (contentMain._x-speed>finalContentPos) {
if (scrollFace._x>=right) {
scrollFace._x = right;
} else {
scrollFace._x += speed/moveVal;
}
contentMain._x -= speed;
} else {
scrollFace._x = right;
contentMain._x = finalContentPos;
delete this.onEnterFrame;
}
};
};
btnDown.onRelease = function() {
delete this.onEnterFrame;
};
btnDown.onDragOut = function() {
delete this.onEnterFrame;
};

if (contentHeight<maskHeight) {
scrollFace._visible = false;
btnUp.enabled = false;
btnDown.enabled = false;
} else {
scrollFace._visible = true;
btnUp.enabled = true;
btnDown.enabled = true;
}
};
scrolling();

Any ideas?

Thanks,
Dave

Tricky Characters In Dynamic Textarea
i'm loading a txt file inside an html-enabled textarea. although i'm having problem displaying some characters, like <, +, %, >..
i replaced % with it's escape equivalent (%25) and this woked. the > sign works just fine. the < sign doesn't work at all, even when trying to escape it with <
the plus sign behaves the same as <. i've used its hex equivalent etc but nothing..
can you enlighten me?

Tricky Characters In Dynamic Textarea
i'm loading a txt file inside an html-enabled textarea. although i'm having problem displaying some characters, like <, +, %, >..
i replaced % with it's escape equivalent (%25) and this woked. the > sign works just fine. the < sign doesn't work at all, even when trying to escape it with <
the plus sign behaves the same as <. i've used its hex equivalent etc but nothing..
can you enlighten me?

Tricky Loading Screen Thang...?
As you may guess from the title, its hard for me to explain what I'm after but I'm sure its still classed as a newbie question...

I have a scene with my basic navigation on; 3 buttons, and a screen with a fading out transition on it.

Depending upon which button i press, I want to load the appropriate content into the window. The way I have been doing it is to copy the basic setup into 3 other scenes, each with the appropriate content in. What I was after was a way to do it all on the one scene. I thought i may be able make 3 movieclips and load in the appropriate content corresponding to the button through action scripting?

Any help or a link would be great

thanks for your time
Lev

-= Tricky Dynamic Question Pics + Text : =-
Hey, im in the midst of making my site, and i needed a scroll bar, so i came here.

i used "Small size scroll bar by Marco A. S. Souza" but totally revamped it, so really u couldn't tell.. (graphically)
anyways, the question i have is..
inside the dynamic text box where my text is scrolled, can i put pictures and links/buttons in there? if so.. HOW?

is there a way to do this? that isn't supa hard?

thnx in advance!

Tricky Dynamic Load Target Problems
i'm having troubles targeting my loadclip

i've created a dynamic loader component that will target whatever mc you classify in the "loadTarget" var. i want to target clips relatively.

the script is within the preloader component in an mc titled "loaderScript" -- preloader.loaderScript
the loadTarget var will have the correct path relative to the component, ie _parent._parent.centerStage. the loaderScript is calling to find this path so it can measure its download:

Code:
newMovie = _parent[loadTarget];
movieTotal = newMovie.getBytesTotal();
movieTotal always comes back undefined.

any ideas or explanations?

thanks,
jwt

Tricky - Can Links In Dynamic Text Run Functions?
Any help on this one would be much appreciated - its an interesting problem!

I'm making an interactive timeline in flash - when an event is clicked the appropriate text and images are loaded up dynamically. However - the client wants to be able to click links in the text to go to other events. To do this I would presumably need to be able to have a link in the text run a function in flash... is this possible?

Any other workarounds?

Joe

Flash 8/CS3 Help With Dynamic Scroller
I'm using the dynamic text scroller from kirupa.com found at http://www.kirupa.com/developer/mx/dynamic_scroller.htm

Here's a link to my zipped files too... http://www.fourmileroad.com/WebFiles.zip

1) I can't figure out how to have URL links in the text that loads.

2) How can I make the scroller refresh to allow for new text in the dynamic text area. The content changes alright, but the scroller stays in the same position and if it wasn't needed initially, the scroller disappears and doesn't return on new text.

I can't figure it out myself and would appreciate some help.

Thanks,
Andrew

Loading Mutable Text Files, A Bit Tricky
hey all

well heres my problem. i have go 9 buttons and what i want to do is when the user clicks on a button a txt file loads in to a MC. ok so far so good.

i know how to do that and the code i'm using is

frame 1
stop ();

frame2
loadVariables ("home.txt", "_root.textbox");

frame3 (Loadfile)
if (home.txt ne "") {
gotoAndStop ("endfile");
}

Frame4
gotoAndPlay ("loadfile");

Frame5(endfile)
stop ();

and the button has a play action on it so that the text only loads when the button is clicked

the problem is that if i click say home then i click about us the text loads fine. But if i click home again the text stays the same as the last button i clicked.

any help would be good.

steven

Here's A Tricky One - Loading Images Into Library Dynamically
Ok - I've stumbled upon a tricky situation.

Basically I have Button components that are populated dynamically. The buttons need to each have an icon (using the button.icon property).

The icon however, is retrieved via webservices so all I recieve is a URL to the jpg that needs to be loaded as the icon. When using the icon property, you load an instance of something in your library over the top of your button.

So I was wondering if there was a way to retrieve this url, and load it into the library which would then allow me to use it as an icon???

Any suggestions would be greatly appreciated!

Dynamic Text - Html And Loading Variables...
Hi

I've created a php script (tested it and it works), that takes outputs 8 variables, which are strings. They are 4 dates and 4 comments associated for each date. I want to use these for a mini news section on my website.

I've created a small flash movie that will display this data in a dynamic text field. However, I'm not sure how to format the text field so that it uses the css style sheets - or at least so that it formats each string the way I want it. Could you please point me in the right direction?

Thank you in advance.

[F8] Loading Dynamic Text Variables Through A .TXT File.
I just read a very short Tutorial on how to make a dynamic textfield, "link" it to a variable and then put the varuable value into a .TXT fiel and load it.

It seemed very easy but i didint get it to work, maybe cause i use FLASH 8.

Its a flash 6 (MX) tutorial.
( http://www.visualxtreme.com/flash_tut1.html )

So anyway, what do i do wrong? I make a dynamic tetxbox. In the VAR field i enter the value "text".

On the frame the texbox is in i write:

Code:
loadVariablesNum("textvar.txt", 0);


Then i create a textfile that i put into the same folder as the flash file called textvar.txt. In the text file i write "text= balbalblbalbalbalb"

When i run the SWF nothing happens. Am i close?

Loading Variables From Javascript, Dynamic Banner
I have a site with 50 pages, and for users with Flash I wish to have a flash banner at the top of every page. It comprises of a full colour background image (different for each page), and page title, in a standard location over the top. So I was wondering whether to save doing 50 flash files I could load the image url and text into the same flash file on each page using javascript. Has anyone tried this sort of thing? Example site? What are the speed/performance implications? The banner will be 600 by 200 pixels.

Cheers.

Loading Variables Into A Dynamic Textbox Using A Function
Hi there. I have been developing in flash for a while, and have coded this. What I want it to do is take the defined variables in Frame 1, and parse them into a Dynamic Textbox in the movie. I seem to have a problem, and I cannot figure out what's wrong. The Title and SubheadText display in the box. I have placed trace's in the code in multiple places, but it all comes back correctly, but not in the textbox. I think it may lie in the function. Anyway, here is my code:

// [Frame 1]
Title = "Grand Theft Auto: San Andreas Announced";
SubheadText = "The next installment of the contraversal series due out Oct. 19";
MainBodyText_0 = "Rockstar Games announced today the official title of the next game in the immensely successful GTA series. Although they still have eight months to go until release, they are very proud of what they have accomplished. Look for more news about San Andreas as it develops.";

// [Frame 3]
function displaySplitText(textOutput, variablePrefix)
{
var indexCount = 0;
var currentTextObject = eval(variablePrefix + "_" + indexCount);
if (currentTextObject.length > 0)
{
textOutput = textOutput + "<font size="10">";
while (currentTextObject.length > 0 && indexCount < 50)
{
textOutput = textOutput + currentTextObject;
indexCount++;
currentTextObject = eval(variablePrefix + "_" + indexCount);
} // end while
textOutput = textOutput + "</font>";
} // end if
} // End of the function
NewsStoryText = "<p><font size="12">" + Title.toUpperCase() + "</font></p>";
if (SubheadText.length > 0)
{
NewsStoryText = NewsStoryText + ("<p><font size="10">" + SubheadText + "</font></p>");
} // end if
NewsStoryText = NewsStoryText + "<p></p>";
displaySplitText("NewsStoryText", "MainBodyText");
NewsStoryText = NewsStoryText + "<p></p><p></p><p></p>";

// [Frame 4]
stop();

Loading Variables From Javascript, Dynamic Banner
I have a site with 50 pages, and for users with Flash I wish to have a flash banner at the top of every page. It comprises of a full colour background image (different for each page), and page title, in a standard location over the top. So I was wondering whether to save doing 50 flash files I could load the image url and text into the same flash file on each page. Has anyone tried this sort of thing? Example site? What are the speed/performance implications?

Loading Dynamic Text Variables From Txt File
I have a form with dynamic text fields that are populated by an external text field using LoadVars.

I now would like to add a combo box or list that would specify the name of the external txt file to load into the text boxes.

The current code just loads the text file named in the quotations.
How can I specify to load from a combo box selection?

Loading Multiple Txt Variables Into One Dynamic Textfield?
Hello everyone and happy new year.

I was wondering if I can point to a variable of a .txt file.
My .txt file has four variables:

&main= text here&
&title = title here&
&main2= text2 here&
&title2 = title2 here&


I load the first Variable on my dynamic textfield successfully.What I want to do now is, to display the second variable on the same dynamic textfield when button "next" is clicked.

Actually I am using this code: (where "main" is the first text variable and "title" the second one).


Code:
var myLoadVars:LoadVars = new LoadVars;
myLoadVars.load("mytext.txt");
myLoadVars.onLoad = function (success:Boolean){
if(success){
my_txt.html = true;
my_txt.htmlText = this.main;
title_txt.html = true;
title_txt.htmlText = this.title;
}
};
Any ideas?

Problem Loading Php Variables Into Dynamic Text
I´m trying to load text from a php file into a dynamic text box called introtxt which location is the next:

scene1 > main (movie symbol) > texts (movie symbol) > text (graphic symbol)

As you see the text box is contained by a graphic object inside a movie symbol where is tweened from 0 to 100% alpha values..

Now the point is that I inserted in the first and unique frame of scene1
this code:

Code:


loadText = new LoadVars();
loadText.load("intro.php");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
_root.introtxt.html = true;
_root.introtxt.htmlText = this.myVar;
}
}



This doesn´t work, probably because targeting the text box wrongly. I put _root.introtxt, but maybe is _root.levelX.introtxt, I don´t know how it should be. Could you help me with this?

Otherwise is it possible to load variables into a text box that is inside a graphic symbol at all?

Something Tricky? Dynamic Text Field Bullet Colours
Using the below code I can dynamically change the text to reflect these attributes and this works fine, however ...

The bullet colour defaults to black. Does anyone know how to change the bullet colour dynamically?

ie:
s_bsubpt = new TextFormat();
with (s_bsubpt){
type = "dynamic";
font = "Arial";
size = 17; color = 0x333366;
bullet = true;
}

Any help here would be wonderful.

Dynamic Flash Text Scroller?
Hi, I need to create a text "scroller" for headlines on a website, that moves vertically (up and down) not horizontally (left to right) and brings in text dynamically from a text file. I know that dynamic text can be brought into a flash movie for a scroller horizontally, but can you create a text scroller box that moves Vertically? I can't seem to get it to work. Thanks!

Dynamic Horizontal Scroller - In Flash 4/5
I'm trying to build a horizontal scroller in Flash 5 (hopefully to publish in SWF v4). The file will load the text from an external source, and then simply scroll the information from right-to-left automatically, repeating at the end.

I want a way of doing this smoothly - ie: not running the text through an array, or replacing the letters one by one. I figured the easiest way, would be to load the text into a dynamic field, and then use the following:

setProperty("textBox", _x = [oldvalue + 1]).

My problem is, I am unable to determine the width of the loaded text (pixels, not length)... and therefor I cannot make the dynamic text box the correct size.

Is there any way to do this in earlier versions of Flash? I hope you understand, I haven't explained it very well. Thanks!

Loading External Data Into Dynamic Text Box [variables]
I am able to load the txt document fine but it stops the text wherever there is the symbol "&" .

Example: Get the new design & web package now.

I t gets cut off at: Get the new design

Is flash reading the " & " symbol as code, and if it is how can i get around it. Is there a tag to put around it to read it as text and not code?

help..


thanks

Trouble Loading Variables To Dynamic Text Field
I am trying to display text from a text file named units.txt (stored in the same folder) The swf has a dynamic text box called myText. The swf has buttons with this code:
on (release) {
_level0.myText = Unit1;
}
The first frame of the movie has code like this:
loadVariablesNum("units.txt",0);
(I have tried including the entire url as well as just the folder above)
This works fine when I test the movie. It also works when I test it through the index.html (on my computer). But it does not work on my website.
Does anyone know what I am doing wrong?

Problem Loading Variables Into Dynamic Text Fields
Hi everyone. I'm trying to load some text from a .txt file into a dynamic text field (for use as a "news" section of my site) and it isn't working.

I have the dynamic text field named "newstext" and the text file is called "news.txt". It's always in the same directory as my .swf.

In the text file itself, it says:

&thetext=test!


In frame 1 of the layer that newstext, the text field is on, the actionscript is:

loadVariables("news.txt", _root)
newstext.text = _root.thetext

It just doesn't work. I don't understand. Any suggestions would be greatly appreciated, thanks much.

Noah

Checking If A Frame Exist... After Loading (thta's The Tricky Part)
I'm hoping someone out there knows a way to return the number of frames left until u reach a specific frame based on the frame label.

*** EG ***
(just an example!) Say you have a mc 300 frames long. You have several "frame markers" through the 300 frames having seperate labels for each marker. What I'm wondering is if there is any way to return how many frames you have left to go until you reach that label.

It must be done like this because the clip i'm working with is about 2k frames in length with about 20+ "frame markers".
*** ***

Loading Dynamic Gallery Thumbnail Images Overrides Variables
i think the issue with the following code is one of scope or pathing, but after hours of trial and error, i just can't figure it out:

this._lockroot = true;

//set up variables for loading jpg files
var thumbnailMCL:MovieClipLoader = new MovieClipLoader();
var thumbnailMCL_listener:Object = new Object();
thumbnailMCL.addListener(thumbnailMCL_listener);

thumbnailMCListener.onLoadError = function() {
trace("thumbnailMCL Load Error");
}

thumbnailMCL_listener.onLoadComplete = function() {
assignThumbnailInteractivity(thumbnailAddingIntera ctivity);
_root["thumb" + thumbnailAddingInteractvity].thumbNum = thumbnailAddingInteractivity;
thumbnailAddingInteractivity++;
}

//set up variables for displaying images
var curImageNum:Number = 0;
var oldImageNum:Number = 0;
var curDepth:Number = 1;

var totalImages:Number = 58;
var thumbSize:Number = 75;
var imageSize:Number = 300;

var sliderSetWidth:Number = 500;
var sliderSetHeight:Number = 8;
var sliderSetYPos:Number = 550;

var thumbnailSpacing:Number = 10;
var thumbYPos:Number = sliderSetYPos - thumbSize - Math.round(Stage.height * .05);

var thumbnailFadeSpeed:Number = 1.5;
var mainFadeSpeed:Number = 1;
var alphaDisabled:Number = 30;

var widthOfAllThumbnails:Number = (totalImages * thumbSize) + ((totalImages - 1) * thumbnailSpacing);

var thumbnailAddingInteractivity:Number = 0;


function makeMainImageViewer(depth) {
_root.createEmptyMovieClip("photos", depth);

with(_root.photos) {
enabled = true;
_alpha = 100;
trackAsMenu = true;
visible = true;

_x = (Stage.width - _width) / 2;
_y = Stage.height * .1;

_root.myMCL.loadClip("photos/image0.jpg", _root.photos);
}
}

function createThumbnails(startDepth) {
trace("creating thumbnails......");
for (a = 0; a < totalImages; a++) {
trace("creating thumbnail" + a);
_root.createEmptyMovieClip("thumb" + a, a + startDepth);
//_root["thumb" + a].thumbNum = a;
trace("_root.thumb" + a + ".thumbNum = " + _root["thumb" + a].thumbNum);

with(_root["thumb" + a]) {
enabled = true;
_alpha = alphaDisabled;
trackAsMenu = true;
var thumbNum = a;
}
}
}

function createThumbnailsTwo () {
for (a = 0; a < totalImages; a++) {
_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
//assignThumbnailInteractivity(a);
}
}

function assignThumbnailInteractivity(thumbnailToAddInterac tivityTo:Number) {
//thumbnails load coinciding full sized images into "viewer" when clicked on
trace("assigning interactivity to thumbnail" + thumbnailToAddInteractivityTo);
_root["thumb" + thumbnailToAddInteractivityTo].onPress = function() {
oldImageNum = curImageNum;
curImageNum = this.thumbNum;

trace("oldImageNum = " + oldImageNum);
trace("curImageNum = " + curImageNum);
//trace("this.thumbNum = " + this.thumbNum);
trace("_root.thumb" + thumbnailToAddInteractivityTo + ".thumbNum = " + _root["thumb" + thumbnailToAddInteractivityTo].thumbNum);

_root.enableAllThumbnails();
this.enabled = false;
this._alpha = 100;

fadeUp(_root["thumb" + oldImageNum], 100, alphaDisabled, thumbnailFadeSpeed);

var fadeTween = new mx.transitions.Tween(_root.photos, "_alpha", mx.transitions.easing.Strong.easeOut, 100, 0, _root.mainFadeSpeed, true);
fadeTween.onMotionFinished = function() {
_root.myMCL.loadClip("photos/image" + _root.curImageNum + ".jpg", _root.photos);
fadeDown(_root.photos, 0, 100, _root.mainFadeSpeed);
}
}

//set up fade in/fade out (_alpha change) animations for thumbnails onMouseOver & onMouseOut events
_root["thumb" + thumbnailToAddInteractivityTo].onRollOver = function() {
fadeUp(this, _root.alphaDisabled, 100, _root.thumbnailFadeSpeed);
}

_root["thumb" + thumbnailToAddInteractivityTo].onRollOut = function() {
fadeUp(this, 100, _root.alphaDisabled, _root.thumbnailFadeSpeed);
}
}

makeMainImageViewer(20);
createThumbnails(50);
createThumbnailsTwo();


the problem is that as soon as i click on a thumbnail (w/ an image loaded into it), the trace call in function assignThumbnailInteractivity tells me that this.thumbNum is undefined. However, by commenting out in createThumbnailsTwo() as so:
_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
//assignThumbnailInteractivity(a);
is:
//_root.thumbnailMCL.loadClip("photos/thumb" + a + ".jpg", _root["thumb" + a]);
//_root["thumb" + a].thumbNum = a;
assignThumbnailInteractivity(a);
lets me have all the functions i want with the place holder thumbnails (black squares). the trace call to this.thumbNum in assignThumbnailInteractivity does not get "undefined" and instead operates exactly as i want. i've also tried changing
oldImageNum = curImageNum;
curImageNum = this.thumbNum;
to
_root.oldImageNum = _root.curImageNum;
_root.curImageNum = _root["thumb" + thumbnailToAddInteractivityTo].thumbNum;
to no avail.

so, by process of elimination, obviously something is happening when i load an image that erases my assignment of this.thumbNum. any ideas? or is there actually a function native to flash where i could find out which thumb# i'm inside from inside a function?

should i change how i handle the onLoadComplete MovieClipLoader listener event handler? assigning the onMouseEvent handles w/o waiting for the onLoadComplete would have images load, and disable interactivity, so i guess loading images using MCL overrides any custom variables and event handling functions????

also, i'm betting that i don't need to draw temp images for the thumbnails. but when i take that code out, the thumbnails don't display at all.

any help would be greatly appreciated!

Flash Script - Create A Dynamic Scroller In Flash
This is a dedicated thread for discussing the SitePoint article 'Flash Script - Create a Dynamic Scroller in Flash'

Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!

Does anybody know how to do the following things in Flash MX?

1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.

Can anybody help me, please? This is urgent!

Thanks in advance!

animind

Image+text Scroller, Form Scroller, And Loading External Text Files - Urgent
Hi everybody!

Does anybody know how to do the following things in Flash MX?

1.Make a scroller with text + images in it;
2.Make a scroller with text + a form in it;
3.I followed the tutorial entitled "Scrolling Dynamically Loaded Text", but the text that I tried to load has over 160 lines, and I can only scroll down to about half way of the total lines. Why is that?
4.I also tried to load xml files using the code <?xml version="1.0" encoding="utf-8"?> on the first line of each xml file, but the ', &, and " " don't work.

Can anybody help me, please? This is urgent!

Thanks in advance!

animind

Noob Question About Loading A Kirupa Image Scroller Into An Existing Flash Page ^^
I created a simple flash page for my photography section on my site. Here is a picture of it in my flash workspace:
I had no problems until I started trying to make photo.s load within the movieclip space I set (the white area next to the news space). I followed a couple of nice tutorials, but this one was the one that fit exactly what I wanted -Kirupa image scroller. The problem is that I think the movie scroller is meant as a standalone flash movie and when I tried to imbed it into the movie space in mine it just took precedence and hid the entire flash page I wanted as the base. Basically I think I need to learn how to imbed one flash movie into a parent flash movie to pull this off, or maybe there is a much smarter and more straightforward method I am missing because I am so new to this? Thanks ahead of time for any responses, and I am sorry if this is really simple. I am very new to flash development.

Dynamic Loading Pics And Variables?how To Change Pics Depending On Buttons Or Text
i want to load jpegs into a swf dynamically. I saw a post confirming u can do it w/load movie script. Heres my question:

first off: in the folder w/my movie, i have jpegs labeled
1-9

in the movie, when someone presses a button, var x is changed to the corresponding number, 1-9

what i want is to place this variable inside the loadmovie somehow so depending on the button pressed a new img loads

i dont wanna type out long if then statements seeing as how this will quickly extend to about 1-400.

im kinda brain dead rite now, whats a dynamic way of gettings imgs with relatively short, versatile code

Help Me Change The Variables In Non-button Scroller
I configured this actionscript with the aid of a tutorial and now I need to configure it for a much longer mc than the one originally used and I'm not sure how to determine what numbers to put in. I've attached the file to show you what I mean and the following is the actionscript:

if (_root.pictureClip3._y<-151.7) {
_root.scrollerDirection = "down";
} else if (_root.pictureClip3._y>378) {
_root.scrollerDirection = "up";
}
if (_root._xmouse<99 && _root._xmouse>49) {
if (_root._ymouse>178 && _root._ymouse<198) {
if (_root.pictureClip3._y>378) {
break;
} else {
_root.pictureClip3._y = _root.pictureClip3._y+5;
}
} else if (_root._ymouse>475 && _root._ymouse<495) {
if (_root.pictureClip3._y<298) {
break;
} else {
_root.pictureClip3._y = _root.pictureClip3._y-5;
}
} else if (_root._ymouse<178 or _root._ymouse>495) {
if (_root.scrollerDirection == "down") {
_root.pictureClip3._y = _root.pictureClip3._y+1;
} else if (_root.scrollerDirection == "up") {
_root.pictureClip3._y = _root.pictureClip3._y-1;
}
}
} else if (_root.scrollerDirection == "up") {
_root.pictureClip3._y = _root.pictureClip3._y-1;
} else if (_root.scrollerDirection == "down") {
_root.pictureClip3._y = _root.pictureClip._y+1;
}


----------------------------------------
Thanks!
Furpants

Tricky: Can Flash Do This? How?
General Brainstorming Required please

The scenario is this:

I would like to create a webpage which allows a user to log onto a website, view a plan of a concert hall / seating arrangement and be able to click on a specific seat, book, and pay online for it.

When they have done this ideally i would like this seat that they chose, booked and paid for to change to a different colour (red = booked, green = available).

Does anyone have any suggestions on how this can be done??
any suggestions would be greatly appreciated

Thanks guys,

Floz

Copyright © 2005-08 www.BigResource.com, All rights reserved