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




How To Invoke A Function On DynamicTextField Change



Hi all!

Im looking for a way to invoke a function automatically on TextField value change... something like this:


Code:
TextField.prototype.onChanged = function(){
trace("Changed!")
}
_root.createTextField("myTF", _root.getNextHighestDepth(), 10, 10, 100, 40);
myTF.type = "input";
myTF.text = "sdfsdf";
That script working great with Input TextField on keyboard press... i need the same thing but with Dynamic TextField - on TextField value change...

10x for advanced....



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 06-27-2006, 12:54 PM


View Complete Forum Thread with Replies

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

Invoke Function In As3
Hi,

Simple with as2... but i can't with as3..
How can i invoke a function in a parent mc... from one of its childs mc??

I've a child MC with 2 frames... in the second one i want to invoke a funtion mostrarHorario(), that is located in the parent MC of this...

Please... help me
thanks.

Invoke A Global Function From A MC?
Hi,

I know this might be a question for the Newbie forum but here goes anyway -

In MX, I have a function on the main time line, which fades in a MC:

Code:
inertia = 5;

function Fadein(by) {
this._alpha += (by - this._alpha)/_root.inertia;
}
How do I call it from an onClipEvent handler?
Will it even work?
Do I have to target the MC I'm invoking it from?

Arrrggghhhhh help!

I know I'm missing the obvious.

Actually I may have approached it in the wrong way, so this is what I'm trying to do:

I have about sixty movieClips which fade (and eventually spin ,move, etc) in at various times in this projector - I just want to write a global function, so I don't have to re-write all the code in an onClipEvent handler every time.

Cheers in advance for any help.

Stu

Invoke A Function In An External Swf
Okay, I know it has to be possible one way or another...I want to be able to invoke a function in an external file from the host file and vis-a-versa. Here is what I have...three files:

Main Movie
External A
External B

The Main Movie loads in External A. In External A I have a button. On click it tells Main Movie to load in External B. I also want it to tell Main Movie to call a function within External B. Is there anyway to make this happen or really, anything that might help me?

Thanks...

Invoke Function After OnResize
hi.
i'm writing a dynamic scrollbar class and have run into some problems regarding the Stage.onResize function.
resizing itself works very well, though i would like to call a function _after_ (!) the resizing is done, like a callback.

ive been reading, googling and asking round but i cant get it straight.
is it impossible? i mean, come on, there must be workarounds..

i would rather not use an interval or an onEnter here (cpu issues), eventhough i know it can be solved with this..


thanks,
fred

Function Invoke B4 OnPress
Code:
goto = function(where:String) {
getURL("http://esample.com/"+where+".htm","_self");
}

button1.onRelease = goto("home");
when the movie loads, flash immediately 'getURL' BEFORE i press my button1. how come the code execute even before i press it 1st? what's wrong with my code?

thx in advance.

Function Invoke B4 OnPress
Code:
goto = function(where:String) {
getURL("http://esample.com/"+where+".htm","_self");
}

button1.onRelease = goto("home");
when the movie loads, flash immediately 'getURL' BEFORE i press my button1. how come the code execute even before i press it 1st? what's wrong with my code?

thx in advance.

Eval To Invoke A Function
Hello,

I have some functions named like sixtoone() sixtotwo() sixtothree() etc..

I am returning a value from those functions like this;


ActionScript Code:
this.cur = "six" // if this is onetosix() function for example
    return(this.cur)


so what I am doing next is to add this value to invoke the other function on a button action like this;


ActionScript Code:
planning.onRelease = function() {
    gimme = cur+"toone()"
    trace(gimme) // this gives me sixtoone() but it don't invoke the funtion.
   
};
 
so you have already guess, how should I use eval to get this function invoke..
 
thanks in advance.
 
ik

Can I Simply Invoke A Function Every Time A Var Changes?
Say I wanted to do something like this (not possible):
aNumber=99
aNumber.onChange=function(){
dNumber=aNumber
}

How would I do something like this?

Invoke Funtion Inside A Function
Hi,

How can I invoke a function (in the main timeline) from another function in a movieclip timeline?

I set that function as global, but he never goes to that function in the main timeline.

Thanks.

<a Href> Tags That Invoke AS Function
hi everyone,
i need your help on how to call a actionscript function using <a href> tag....is this possible?

i have an example link here http://www.kirupa.com/web/xml/examples/searchbestof.htm
this is supposed to be what i want but i need to load an AS function or load it within flash not URL..

any idea would greatly appreciated...

please help me....

thanks

Invoke An As Function From A Button In An Html Page?
i need to bascally call a function in a flash file from a button in a seperate html page. is this possible?
really need the help!
michael

VB Call To Invoke Level0 Flash Function
Can anyone help me with

Calling from VB to invoke a level0 function in Shockwave Flash.


Thanks


Dynamic Movie Clip Reference, Invoke Function In Mc
Happy new year all!!

I'd like to invoke a function inside a mc from it's parent, but I want to have the reference to the clip be dynamic. When I path the mc directly and invoke the function it works, how would I make that same reference work dynamically.

Here's a sample of what I'm trying to do:

Code:
var myArr:Array = new Array();
myArr[0] = "galleryContainer_mc.eventGallery1_mc.imgContainer_mc";
trace(myArr[0]);

// This works
toggle_btn.onRelease = function() {
galleryContainer_mc.eventGallery1_mc.imgContainer_mc.videoToggle();
}
// But this doesn't work
toggle_btn.onRelease = function() {
myArr[0].videoToggle();
}
I know I'm fried, but that seems like it should work, am I missing something really basic here? Any advice would be really helpful at this point. Thanks!

GotoAndStop(dynamictextfield)
Fingers crossed the subject of this thread alone will explain things.
I have a series of buttons that, when pressed, input info into a dynamic text field.
e.g:

on(release){
TAG1 ="task";
}

This part is fine.
But I also want it so that, after a couple more frames, the animation jumps to a frame label, as defined by TAG1.
e.g:

gotoAndStop(TAG1.text);

This part doesn't work. Can anyone help

(hope this makes sense. I have flu today and my head stopped working long ago)

Invoke Pdf Issue....
var myRPT = [[146, "RPT146.exe"]];

onRelease = function ()
{
for (var i = 0; i< myRPT.length; i++)
{
if (_root._currentframe == myRPT[i][0])
{
fscommand("EXEC", myRPT[i][1]);
break;
}
}
}


I have a dir called fscommand with invoke,proxy, the proxy is called RPT146.
a bat file called RPT146 that has the following line of code - invoke open RPT146.pdf

i have no idea why this will not work

any ideas?

northcode ?

Flash Gods, I Invoke You
in a nutshell:
i'm trying to move the 'playhead' on a timeline i created, thus changing the physical location of the playhead, and changing the values of dynamic text boxes which corrispond with the playhead's location.

(everything is already functional if you Drag the playhead along, but i'm trying to add an additional way to browse the
site, with a button that browses thru one spot on the timeline at a time)

****
this is what i want to do:

access the _x position of a MC called "1" (the playhead), find that number in the possible _x positions that "1" can snap to in an array called "xspot", and append that number's placement in "xspot"(0-9) to the variable "i".

i then add one to "i" (or go back to 0 if we are at the end of the array) and apply this value to the variable "nextstep"

now that i have "nextstep", i know which elements in the arrays "xspot" and another called "who" (both with 10 elements) contain the info for the next playhead position, both for the playhead's _x position "xspot", and the dynamic text's content "who"
****

this code is appended to a button, will that cause a problem?

something isn't working right...

got any clues? or better ideas to approach this oparation?

_____code_________________________________________ _______

on (release) {
// xspot is an array which contains the diff. x positions my MC "1" can snap to/park at
for (var i = 0; i < _parent._parent.xspot.length; i++) {
// i have a feeling there is something funny about this line
if (_parent._parent.1._x == _parent._parent.xspot[i]) {
if (i <= 8) {
_parent._parent.nextstep = i++;
} else if (i == 9) {
_parent._parent.nextstep = 0;
}
break;
}
}
name = _parent._parent.who[_parent._parent.nextstep];
if (name = "billybob") {
_parent._parent.1._x = _parent._parent.xspot[0];
_parent._parent.pictext.scroll = 1;
_parent._parent.pictext = "Text";
_parent._parent.biotext.scroll = 1;
_parent._parent.biotext = "More Text";
// there are many names, each with it's own dynamic text content, and coorisponding playhead position on the timeline

______end of code_________________________________________


please help!!!

quazi

How To Invoke Auto-click In AS
Hello.

Is it possible to code in AS that a button has to be clicked? I have a swf with a button on it. I want in the first frame a code that clicks the button. Does someone know if there is such a code?

Thanx in advance.

Luut.

Can You Invoke Something After A Code Tween Is Done.
Just like animating something on a time line I did it with code. But would like to now if it is possible to do this or not?

I have my code tween here.

Code:
Landing_flying = function(){
var maxNumber_up = 80;
var easeType = mx.transitions.easing.Regular.easeOut;
var begin1 = 50;
var end1 = 180;
var time = 34;
var Body_mc1 = body;
Flying1 = new mx.transitions.Tween(Body_mc1, "_y", easeType, begin1, end1, time, false);
// After tween invoke new function
//stop_flying(); // stops wing animations.
}


Right after it reaches the destination at the end of its tween I would like to invoke a separate function. But only after the tween is done.

If this is possible if so can some one point me in the right direction can some on pint me in the right direction.

[F8] Manual ContextMenu Invoke?
Hi all, quick question -

Is it possible to manually display a context menu at a certain point in time? I'm making an app and would like the user to be able to invoke the right-click context menu I've created when they click on a certain button on the stage. Any ideas? Thanks.

-T

Can I Invoke MouseEvent With ContextMenuEvent?
I’m new to both Flash and AS3 so hopefully I can explain my problem correctly. And if anyone has ideas on how to better approach what I’m trying to accomplish, please offer up some suggestions.

I’m producing some training and have the students click through various ‘hot spots’ on several screen captures to simulate the actual steps. At one point they are required to right click and select an option which just takes them to the subsequent step. I’ve customized my context menu.

I have a showStep function call by MouseEvent.CLICK that advances through an image array and advances the array index. When the image is loaded a function then creates the hot spots. I’ve successfully added the custom menu to the correct hot spot and have an event listener using ContextMenuEvent.MENU_ITEM_SELECT that passes to a function I want to then invoke showStep again.

Here’s where I’m stuck. When I select the right menu item, it activates the contextMenuOwner hot spot that I can then click to advance the image. I want to advance the image by selecting the right menu item which calls the MouseEvent obj via showSteps.

Hopefully all of that made sense. Here are the snippets I think are appropriate.


Code:
//set hit areas
var newHitArea:Sprite;

//from customizingContextMenu
var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
var mainTimeline:MovieClip = this;
mainTimeline.contextMenu = myMenu;

//rc menu to be used with hit area
var newRCMenu:ContextMenu = new ContextMenu();
newRCMenu.hideBuiltInItems();

var createNode:ContextMenuItem = new ContextMenuItem("Create Node");
createNode.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doMenuEvent);

function doMenuEvent(evtObj:ContextMenuEvent):void{
var tgtObj:DisplayObject = evtObj.contextMenuOwner as DisplayObject;
var tgtMenuObj:ContextMenu = evtObj.currentTarget as ContextMenu;
tgtObj.addEventListener(MouseEvent.CLICK, showSteps);
tgtObj.dispatchEvent(new MouseEvent("CLICK"));
}

function showSteps(evtObj:MouseEvent):void{
stepImg.visible = true;
stepImg.load(new URLRequest("../images/"+imgArr[thisStep][0]));
stepImg.x = layerX;
stepImg.y = layerY;
addChild(stepImg);
makeHitArea(thisStep);
thisStep++;
}

function makeHitArea(currStep){
if (newHitArea){
removeChild(newHitArea);
}
newHitArea = new Sprite();
// ... make hit area
hitAreaType = imgArr[currStep][1];
if (hitAreaType == "rc"){
newHitArea.contextMenu = newRCMenu;
newRCMenu.addEventListener(ContextMenuEvent.MENU_SELECT, menuSelectHandler);
}else{
newHitArea.addEventListener(MouseEvent.CLICK, showSteps);
}
addChild(newHitArea);
}

// borrowed from Adobe examples: Custom Context Menus
function menuSelectHandler(evtObj:ContextMenuEvent):void {
var obj:DisplayObject = evtObj.contextMenuOwner as DisplayObject;
var menuObj:ContextMenu = evtObj.currentTarget as ContextMenu;
menuObj.customItems = [];
menuObj.customItems.push(createNode);
}

Can You Invoke Something After A Code Tween Is Done.
Just like animating something on a time line I did it with code. But would like to know if it is possible to do this or not?

I have my code tween here.

ActionScript Code:
Landing_flying = function(){
    var maxNumber_up = 80;
    var easeType = mx.transitions.easing.Regular.easeOut;
    var begin1 = 50;
    var end1 = 180;
    var time = 34;
    var Body_mc1 = body;
    Flying1 = new mx.transitions.Tween(Body_mc1, "_y", easeType, begin1, end1, time, false);
    // After tween invoke new function
    //stop_flying(); // stops wing animations.
}

Right after it reaches the destination at the end of its tween I would like to invoke a separate function. But only after the tween is done.

If this is possible if so can some one point me in the right direction can some on pint me in the right direction.

Frame Names And How To Invoke Them
What would you have to do to have something happen once a movieclip reaches a particular frame?

I already got the answer to that question in a previous topic in case that something has to happen when the movieclip ends, but say you want to have something happen when the playhead reaches frame called, say, _now?

I can think of a way (involving the clculation of the ratio between _currentframe and _totalframes) but, isn't there a simpler -and more precise- way, namely, invoking the frame by its name? How would that be done (if possible)?

NOTE: I am assuming that adding code to the movieclip's timeline (instead of adding it to the main timeline) is a bad practice and should be avoided. Am I right at that?

Can My SWF Invoke A Local .NET Assembly?
Hello,

How do I get my AS2 code to interact with _local_ resources without using XML files? Here's what I mean.

My SWF file needs to be able to query a local SQLite database. But after a lot of searching, I'm convinced that this is not possible with just Flash8/AS2 (I have heard about something called SQLite Connector. But it requires SWF Studio).

As an alternative to having my AS2 code interact with SQLite directly, is there a way for my AS2 code to invoke a function in a .NET assembly or COM object, so that my locally-registered .NET assembly does the work of getting the data out of my
database and somehow return the record into my calling AS2 code?

Can my SWF call a procedure to a local .NET assembly and if so, where can I find out the details?

Thanks,

~McM.

Can My SWF Invoke A Local .NET Assembly?
Hello,

How do I get my AS2 code to interact with _local_ resources without using XML files? Here's what I mean.

My SWF file needs to be able to query a local SQLite database. But after a lot of searching, I'm convinced that this is not possible with just Flash8/AS2 (I have heard about something called SQLite Connector. But it requires SWF Studio).

As an alternative to having my AS2 code interact with SQLite directly, is there a way for my AS2 code to invoke a function in a .NET assembly or COM object, so that my locally-registered .NET assembly does the work of getting the data out of my
database and somehow return the record into my calling AS2 code?

Can my SWF call a procedure to a local .NET assembly and if so, where can I find out the details?

Thanks,

~McM.

Can Flash Invoke Javascript?
Can I implement Flash button so that when clicked, it triggers a Javascript function? That "Javascript" function that is on the HTML page in which the Flash swf is hosted.

How?

How Can I Invoke PHP Forum In The Sub-window Of A
flash
my flash website has a sub-window can load extrenal swf files ,but i also want to load a php forum in this window after i click the relevant button. how can i make it?

Change Key Function?
Hi I am new to this forum and could use some help. I am working for an internship and my boss asked me to try and research and find out actionscript code that can accomplish the following.

We are making a project where the initial flash page will take up the entire screen of the computer. He wants to disable the ESC key from allowing users to escape out of the window and change it to some other key combination of our choosing...

Any help would be greatly appreciated.

How To Change This Function Into AS 2.0?
So i found this function which works for me


ActionScript Code:
function hideAllThumbs() { trace("Hiding all thumbs !!!"); for (var x in contentWeb.thumbsPortfolio) {  if (contentWeb.thumbsPortfolio[x]._name.substr(0, 14) == "thumbContainer") {   removeMovieClip(contentWeb.thumbsPortfolio[x]);  } }}


but i think it's so 2005. How can i make this function more 2008???

regards

Invoke A Button's OnPress With Actionscript?
is it possible to invoke the on(press) code of a button through actionscript such that i can write a command like this elsewhere in the movie:

someMC.someButton.onPress();

I am trying to automate a set of movements and the code is already assigned to a button's onPress so I just want to be able to execute the specific button's onPress rather than take the code out of the buttons? Any ideas?

Thanks in advance,

--pkoanui

Invoke Server Side Application
Hi,

I am an experienced programmer (mainly C++ and Python) but fairly new to web/flash programming. I have a Flash application running on a client side browser which needs to read data from a C application running on the server. I'm told that there should be a library function to invoke the C code and provide me the output via a pipe of some sort. Can anybody elaborate on this?

Also, does anybody know of an online library reference (function descriptions, syntax examples, data structures summaries etc.) for Flash? I find it quite hard to program in a language without such a reference.

Peter

ShowDataTips Invoke ShowDataEffect. How Prevent That?
I have an area chart with showDataTips set to true.
Area series have an SeriesInterpolate effect triggered by showDataEffect event.
All work nice, but when is show some data tips, is invoked and showDataEffect. The graphic become confusing because is moving according with effect SeriesInterpolate.
So how can prevent this behavior?

Using Actionscript To Invoke Other Flash File
I have two flash files : a.swf and b.swf .
I want to make flash c.swf to manage the above flash files.This means c.swf invokes a.swf and b.swf in other time. example a.swf is run in time ( 14h to 16h), b.swf is run in time (15h to17h) .
Please help me.Thanks

How To Invoke Break Apart In Action Script?
Hi eveyone!

I'm new to flash and just found this site. It's really cool. After going thru a few of tutorials, I wish to start my first experimental flash project. Can anyone tell me if it's possible to invoke break apart in action script? Actually does anyone know any tutorial that can guide me thru in the developement of a flash web site (books or url)? Pretty much like one of tutorials here (full site) but more details like starting from site background and ...May be asking to much, anyway thanks in advance.

Using Actionscript To Invoke The Other Flash File
I have two flash files : a.swf and b.swf .
I want to make flash c.swf to manage the above flash files.This means c.swf invokes a.swf and b.swf in other time. example a.swf is run in time ( 14h to 16h), b.swf is run in time (15h to17h) .
Please help me.Thanks

How To Invoke Break Apart In Action Script?
Hi eveyone!

I'm new to flash and just found this site. It's really cool. After going thru a few of tutorials, I wish to start my first experimental flash project. Can anyone tell me if it's possible to invoke break apart in action script? Actually does anyone know any tutorial that can guide me thru in the developement of a flash web site (books or url)? Pretty much like one of tutorials here (full site) but more details like starting from site background and ...May be asking to much, anyway thanks in advance.

When I Invoke External Picture How Can I Add Loadi
when i invoke external picture how can i add loading bar?

I used a MC with the code
loadMovie( "images/image1.jpg","XXX")

invoke external imsges
but i 'd like to add loading bar to show how many percentage of image done at 1st frame ,if 100% done , MC will play 2nd frame
if not ,continue loading
How can i?

Colour Change Function
Hi
I have a colour change function which I need to link to a movie clip('menu')within a movie clip('menu_consultancy').
i.e. _root.menu_consultancy.menu

The only problem is the movie clip is blank up to frame
5. I would have thought it would have just picked up on the instance name, but this appears not to be the case.

- I will try explaining that one again:
Within the movie clip 'menu_consultancy' I have a stop action on frame 1 and another stop action on frame 5. In frame five I have the movie clip that i want to change the colour of) with an instance name called 'menu'.

this is the code for the colour function attached to a buttton on the main time line: -

on (release) {
object = new Color(_root.menu_consultancy.menu);
object.setRGB(0x00659C);


I have tried putting the 'menu' movieclip on the first frame of 'menu_consultancy' and the colour function works fine, but I need the movie clip to be blank on the first frame. What can I do??

Thanks,
Kaan.

Colour Change Function
Hello.
On my main timeline I have serveral buttons that change the colour of serveral movie clips on the screen. So, lets say I change the colour of my movie to blue and then go to a different scene, the colours are converted back to their orginal state for example red.

What I have tried to do is....
- create a verible called 'newColour' within the change colour function.
- on the first frame of the scene I am trying to jump to, I have created
an IF statement that checks if the newColour equals blue then set the colours to blue.
but for some reason the varible is not working how I planned...


here is the code for the main button that changes the colour: -
on (release) {
newColour = "blue";
object = new Color(background);
object.setRGB(0x00659C);
object = new Color(_root.window_final1.title_bar);
object.setRGB(0x00659C);
object = new Color(_root.window_final2.title_bar);
object.setRGB(0x00659C);
object = new Color(_root.window_final3.title_bar);
object.setRGB(0x00659C);
object = new Color(_root.menu_consultancy.menu);
object.setRGB(0x00659C);
ect......

Now here is the code that is on the first frame on the scene that I am trying to jump to: -
if (newColour="blue") {
object = new Color(background);
object.setRGB(0x00659C);
object = new Color(_root.window_final1.title_bar);
object.setRGB(0x00659C);
object = new Color(_root.window_final2.title_bar);
object.setRGB(0x00659C);
object = new Color(_root.window_final3.title_bar);
object.setRGB(0x00659C);
}

Where am I going wrong???

Kaan

Change Variable From Within A Function
I want to change a variable's value from within a function, but the variable has to be itself a parameter of the function.
for example:

Code:
function myFunction(n) {
n = n-1;
trace(n);
}
x = 5;
_root.myButton.onRelease = function() {
myFunction(x);
};

Colour Change Function
trying to build a function that dictates what colour a mc should be on different states.


ActionScript Code:
function setColour(){
    var changeColour:Color = new Color(this);
    changeColour.setRGB(0xFF0000);
}
function setColourOg(){
    var changeColour:Color = new Color(this);
    changeColour.setRGB(0x999966);
}

one_mc.onRollOver= function(){
    setColour();
}
one_mc.onRollOut= function(){
    setColourOg();
}

At the moment it just changes all of the mc's that appear on the stage, I would like to have the function change just the chosen mc i.e one_mc not any other's.

(I know this is the old way of doing colorchange, it is now colorTransform)

Any help would be gratefully appreciated!

Change Button Function?
I have this movie created from a tutorial, but to start it you have to click a button, instead I want it to start automatically, how can I do that. Right now, this is the actionscript used to start it with a button:

on (release) {
call("/subroutines:start");
}

is there some kind of on load function for this?

Trying To Change The Value Of A Variable From A Function
I've been trying to find the answer to my question for about a week now. I've created a variable, what i want to do is change the value of my variable by clicking a specific function. The variable is being used inside an object variable, at least that's how i think i should word it. I've posted the code. I know the object can read the variable because when i make the variable equal 700, it does read it. But if i try to change the variable value through a function, the value doesn't change.


Code:
import com.reflektions.tween.*;

var sy:int = planet.y;
var abc:int;

var tween:Tween = new Tween();

var tobj:Object = {mc:planet,y:sy, dy:abc, r:0,dr:50,xscale:0.5,dxscale:1.0,yscale:0.5,dyscale:1.0};


button_1.addEventListener(MouseEvent.MOUSE_DOWN, move_planet);

function move_planet(event:MouseEvent):void {
abc = 700;
tween.initTween(tobj);
}
As you can see i'm using an external tween library of some kind. I say of some kind because someone else started this project and i'm trying to finish it so i don't really have much of an idea about how the class works.

Change A Function's Function?
Hi guys,

is there a way how I can change a function's
function.
When I call the getURL(), flash should not open
the URL, it should set a Variable to a value.
i.e.

getURL("Hello World");

current ---> open Browser with the document Hello World (wrong)
should ---> set variable "foo" to "Hello World" (thats what I need)

Maybe with some OOP, but I don't no how.

Invoke Javascript Rolloever Code In Flash?
I want to know if it is possible to invoke javascript rolloever code in flash...???

I have an html site that when you go over one image, another image changes... It's created in fireworks...

But one bit of the site I'm going to have to change to flash but still want to keep that rollover....

So I was wondering how to get flash to call a javascript action when you rolover an image in flash to change a static gif image out of the flash movie....

To see what I mean, visit> http://members.lycos.co.uk/niietzshe/pics.html ...

the red bit is going to be in flash and I still want the viewfinder to change...


Hope someone can help with this as I'm having great difficulties...

Invoke Action After Movie Clip Stops?
there is one movie clip on my stage with instance name : "myMC"
i have also 2 buttons: "buttonA" and "buttonB"

i have this code on my first frame:

friction = "0.2";
dif = 0;
targety = 0;
_root.onEnterFrame = function (){
dify = dif - myMC._y;
speedy = dify*friction;
myMC._y = Math.floor(myMC._y+speedy);
dify = int(targety)-myMC._y;
}

this code moves "myMC" up and down depends on value of variables: dif and targety,

actions on the buttons:

on buttonA:
on(release){
dif = 370;
targety = 370;
}

on buttonB:
on(release){
dif = 100;
targety = 100;
}

question: i want to invoke some action but only when myMC will stop,
i'd love to change this code to basically specify final position of myMC by assigning final _y value to the buttons (and than say: if (myMc._y == 100){ do this })
but as long as when i place myMC on postion 0,0 and after pressing buttonB it stops
on 100,0 that after pressing buttonA myMC stops on 366,0 and when i keep adding buttons
final position is not the same every time.

please help.

kooba

Invoke Mouse Events By Action Script
Does anybody know how to invoke Mouse events by actionscript. The deal is that i need to emulate onRelease event without PHYSICALLY RELEASING MOUSE BUTTON.

Thanks

Can't Invoke Scene Play From Within A Movie Clip -- Please Help.
Hi!

I'm having the following problem and I'm desperately looking for help.

Here's the description:
My flash has a single movie clip and 5 buttons in seperate clips.

I want to invoke a gotoAndPlay function of a scene on the release of a button which is part of a clip in that scene (suppose the parent (and only) scene containing the clip (which in turn contains the button) is named Main). Normally this should work:

(Actionscript on the button: )

on(release) { gotoAndPlay("Main", 2) }

but it doesn't. Instead it opens a browser window with two tabs... Go figure...

Any ideas?

P.S. Check http://students.ceid.upatras.gr/~diamanto/vac.fla for the original flash file...

Manually Invoke OnCancel Event For FileReference?
I'm using the FileReference class with PHP to allow users to upload images. I need to be able to restrict the size (pixels not bytes) of the images.

Currently, I have the following PHP script which handles the uploads and checks the width and height of the image before copying it to the server:


PHP Code:



<?php    if ($_FILES['Filedata']['name']) {        list($width, $height, $type, $attr) = getimagesize($_FILES['Filedata']['tmp_name']);        if($width <= 15 && $height <= 15) {            move_uploaded_file($_FILES['Filedata']['tmp_name'], 'uploadedImages/' . basename($_FILES['Filedata']['name']));        }    }?>




This works ok, but it does not provide a method to alert Flash if the image is bigger than the allowed values. It simply doesn't copy the file.

So, is there a way to call the onCancel event for the FileReference object from PHP? Or is there any other way I could alert flash of the status from that PHP file?

Even better than that - is there a way to determine the image size before it is uploaded? The PHP script above still has to wait for the temp image to be uploaded before it can perform the validation.

Cheers.

FLVPlayback Fail To Invoke CallBack OnMetaData
i'm using FLVPlayback in order to load a movie.
i keep getting this error:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=ReferenceError: Error #1069: Property duration not found on Number and there is no default value.

if i get it right, it means that inside built-in onMetaData there is no duration property.
so, i tried adding my own call back function:

//creating a custom client
var customClient:Object = new Object();
customClient.onCuePoint = cuePointHandler;
customClient.onMetaData = onMetaData;
customClient.onPlayStatus = onPlayStatus;

//loading the movie
_flvPlayback.source = url;

//replacing the custom client
_flvPlayback.getVideoPlayer(videoPlayerIndex).netS tream.client = customClient;


private function onMetaData(m:Object):void {
trace("m.duration " + m.duration);
}

and its tracing the duration!!!! >>

m.duration 8.05

and i keep getting the same error.....

any suggestions?...

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