| help launching applications please. |
|
 |
Index ‹ flash-actionscript
|
- Previous
- 1
- Crash on Tweening a TextField with a mask AS3 CS3I have yet to hunt down exactly what it is about this situation that makes it
crash, but when I tween the position of a TextField that has a mask, as soon as
I close the movie window the program crashes, whether it be in the Flash (CS3)
IDE or in a browser.
In detail: I have a movie where I'm creating 1000 instances of a movieclip
(little dots) and when the mouse rolls over one i instantiate another
movieclip, call it box. I then dynamically create a textfield inside the box
and give it a mask (a generated sprite that is just a rectangle half the width
of the box, which is added to the box's display list). Finally, I tween the x
position of the TextField, giving the effect of the text sliding out from the
edge of the box. When I test the movie in Flash this works fine but as soon as
I close the window Flash crashes, in a browser window when I close the window I
get the spinning beach ball of death. If I dont add a mask to the TextField, I
dont have this problem at all. I will test this on a PC tomorrow, but as of yet
can only confirm on a Mac.
Has anyone ever encountered something like this?
I dont have the code in front of me, but it is really what youd imagine, along
the lines of (NOTE: this is not my exact code):
var box:Box = new Box(); //Box is a MovieClip
var txtField = new txtField();
... (format text field) ...
txtField.text = 'foobar';
var textMask:Sprite = new Sprite();
textMask.graphics.beginFill(0xFF0000);
textMask.drawRect(0,0, box.width/2, box.height);
textField.mask = textMask;
box.addChild(textMask);
box.addChild(txtField);
var slideOn:Tween = new Tween(txtField, 'x', Strong.easeOut,
-txtField.textWidth, 0, 1, true);
slideOn.start();
- 1
- Starting, then stopping, then starting, and then stopping...With an onClipEvent, how would make it start and then stop multiple times? For
example, let's say my character moves at this space. A setInterval begins only
once! And when the character moves out of the space, the interval is cleared
(erased). Then lets say he decides to walk on the same space again, then off,
then on, then off, etc.
This is the only code I can think of for this sort of thing:
if(!once ne '') {
//do this
once = 1;
}
else
{
//do this
once = '';
}
- 1
- Need some button helpI'm trying to create this game whereby pressing on a button will add a special
feature to your character. i need to know the code for buttons that will: make
my character quicker for a short time; make my character stronger a short time;
heal the character; change my character's attack for a short time. I'd really
appreciate any help and i apologize if this is on the wrong board (this is my
first post).
- 4
- Duplicate Movie clipHi,
Pls any one can help us
I am developing a Modern puzzle game in FlashMX 2004. In that game loading
sliced images from external resource. Here I am facing a problem.
1. I am having a movie clip in the stage.
2. I am duplicating the movie clip based on number of external sliced images.
and placing the movie clips appropriate position.
3. Using a ?load movie? method, I am loading all sliced images into duplicated
movie clip.
4. Up to this every thing working fine.
5. Here I need to swap the images clicking the source and destination. But it
is not working.
Here I am enclosing the sample.fla file. Pls gone thru my file where I made
mistake.
It is most urgent?
Thanks in advance.
With
Murali J
Maxem India Pvt Ltd.,
- 4
- Making enemies collide with eachotherHi, I've got a function here that spawns an enemy for me (thanks kglad) and I'm
calling it in a loop every few seconds or so so that it creates a new enemy
every second. This all works great. What I want to do though, is to make the
enemies collide with each other. How would I go about doing this? I've tried
using hitTest but it detects that each enemy is hitting itself which is always.
I've attached my code.
enemyA = [];
var enemyCounter:Number = 0;
function createEnemy(cspeed, csprite, crange, clocx, clocy, cname)
{
//attaches the graphic for the enemy to the stage and sets all the variables
enemy = background.attachMovie([csprite], [cname],
background.getNextHighestDepth()+50000, {_x:clocx, _y:clocy});
enemy.espeed = cspeed;
enemy.erange = crange;
enemy.cacheAsBitmap = true;
//adds the enemy to the array
enemyA.push(enemy);
enemyCounter++;
_root.onEnterFrame = function() {
//loops through the enemy array to see where each enemy is in relation to
the
//player and if they are too far away //it moves them towards the players
position
point={x:player._x,y:player._y};
background.globalToLocal(point);
for (var i = 0; i<enemyA.length; i++) {
if (point.x < enemyA[i]._x - enemyA[i].erange)
enemyA[i]._x -= (enemyA[i].espeed+Math.random()*2);
if (point.x > enemyA[i]._x + enemyA[i].erange)
enemyA[i]._x += (enemyA[i].espeed+Math.random()*2);
if (point.y < enemyA[i]._y - enemyA[i].erange)
enemyA[i]._y -= (enemyA[i].espeed+Math.random()*2);
if (point.y > enemyA[i]._y + enemyA[i].erange)
enemyA[i]._y += (enemyA[i].espeed+Math.random()*2);
}
}
}
- 4
- XMLSocket questionI'm creating a new socket, connecting to it and recieving a message from it
(all with success), but when i try socket.send, nothing happens. The socket
server is set up to send back whatever I send it, and since I've already
recieved stuff from it, i know the problem is with the sending. Does anyone
know what could be wrong with the socket.send . In the code, messages is a
textarea. Code attached.
//socket code
_global.socket = new XMLSocket();
socket.onConnect = function(success) {
if(!success) {
messages.text = "Unable to connect to server";
}
}
socket.onClose = function() {
messages.text += "Socket Closed";
}
socket.onXML = function(doc) {
displayRecieved(doc);
}
socket.onData = function(doc) {
displayRecieved(doc);
}
if(socket.connect("www.norcalmusic.net", 5555)) {
socket.send("<?xml version=\"1.0\"?><msg message=\"happyness\" />");
}
//
//buttons
send.addEventListener("click", submit);
reset.addEventListener("click", resetConn);
//listeners
_root.onKeyDown = function() {
if (Key.getCode() == Key.ENTER) {
if (input.text != "") {
submit();
}
}
}
//functions
function submit() {
/*tosend = input.text;
socket.send(tosend);
input.text = "";*/
socket.send("<?xml version=\"1.0\"?><msg message=\"happyness\" />");
}
function resetConn() {
socket.close();
socket.connect("www.norcalmusic.net", 5555);
}
function displayRecieved(doc) {
var xmlData = new XML(doc);
var node = xmlData.firstChild.nodeName;
var atts = xmlData.firstChild.attributes;
if(node == "welcome") {
messages.text += atts.toprint;
}
else if(node == "msg") {
messages.text += "\n"+atts.from+": "+atts.message;
}
messages.vPosition = messages.maxVPosition;
}
- 4
- Dynamic UI ComponentsHello,
I'm looking for help with dyamically attaching UI Components. Currently,
there are only two things you can dynamically attach: 1) a TextInput component,
and 2) a MovieClip instance.
I want to dynamically attach a ComboBox component, so I dragged a ComboBox to
the scene and converted it to a MovieClip called "dropdown". Now that it's in
my library, I deleted the instance on the scene and I can dynamically place a
ComboBox in my movie.
A quick look at the code:
[b]
for (k=0; k<=9; k++ ){
_root.attachMovie("dropdown", "item"+k, k+10);
_root["item"+k]._x = 360;
_root["item"+k]._y = 50 + (k*25);
_root["item"+k].addItem(1,"On");
_root["item"+k].addItem(2,"Off");
}
[/b]
Now my two problems:
1. The _x and _y calls are unreliable. Sometimes, the MovieClip stays in the
0,0 position.
2. The additem calls are not working. I think it's related to the fact that
when I make those two additem statements, the movieclip isn't really finished
initializing. It's not until my script is completely finished, that Flash is
calling some (undocumented) function called onClipEvent(construct), where it
seems to complete the initialization of the movieclip object. I don't seem to
have any way of [b]waiting[/b] until after the construct method is called to
start my additems. All I'm getting are 10 empty ComboBox's.
Your help is greatly appreciated.
TOFletch
- 4
- embeding .swf into html sitejust publish your flash (using publish settings that include a html file) so an html and swf file will be published.
- 8
- button overlap problemHi,
I am creating five buttons that are in close proximity of each other. I want
the selected button (when rolled over) to grow 200% and be on the top layer
(over its neighbors). Right now each selection is overlapped by its neighbors.
I think I have to use duplicateMovieClip, but after reading the support
documentation, I am more confused than when I started.
Please help...
- 8
- function calls did something change in Flash 8Hi everyone,
My question is what has changed from flash mx pro to flash 8 pro when calling
functions.
On frame 1 I have several functions that use to work. Such as
function getRaterRatingData(result)...
and I could call them from that frame or nested movie clips. But, now I have
had to change the functions to
_global.getRaterRatingData = function(result)...
in order for me to call them.
Any ideas as to why this is? I was not getting any errors the previous way, it
was just that the functions were not being called.
- 9
- Help with onRelease event handler inside loop(sorry if this post is a dupe, I tried posting last night but it seems to have
disappeared)
I've been struggling with what ought to be a pretty simple event handler...
I have a Flash file with several buttons (named button1, button2, button3,
etc..); there are an equal number of movieclips (named movieclip1, movieclip2,
movieclip3, etc...). The movieclips start out hidden. When the user clicks on
any button, the corresponding movieclip should appear, and start playing (at
frame 1).
I'm going to have many Flash files, each with a different number of buttons
(and movie clips), so rather than hard-coding it for each instance, I want to
set it up so I can re-use the code, and just enter a variable for the number of
buttons in each .fla.
Simple enough, no? Well, here's how I'm trying to do it, but for reasons
which escape me (but which are probably immediately obvious to others), it
ain't working:
//begin code
number = 5;
// Number of buttons/movie clips. This variable will be different for each
flash file
for (i-1; i<=number; i++) {
["button"+i].onRelease = function () {
["movieclip"+i]._visble = true;
["movieclip"+i].gotoAndPlay(1);
}
}
// end code
I assume that the for loop runs once for each button, and that when you click
on any button, it should reveal the corresponding movieclip and start it
playing....but it's not working.
I seem to be missing something critical here. Can someone point me in the
right direction?
Thanks for your help!
PS: Running Flash MX, not MX 2004, if that matters.
- 9
- loadVariables scopei've been working for 2 hours now trying to figure out scope issues
with loadVariables(), and even working with the most basic script i
still have problems.
here's the deal:
1) i have a 10-byte text file, "vars.txt", which has one line of code:
user=steve
2) i load the variables into frame 1 (the only frame), with the
script:
_root.loadVariables("vars.txt");
3) the next line of actionscript says:
trace(user);
on output, all i get is "undefined".
i have a dynamic text field in the movie in _root that's defined from
the variable "user" and it shows up every time! the text field says
"steve" every single time, so i know that flash is loading the
variable. yet when i try to trace the value of the variable "user",
nothing at all. it's always undefined. but it can't be because it
shows up in that textfield no matter what!!!!
help me end this frustrating nightmare so i can move on.
- 9
- copy/paste a group of loaded mc'si have a program set up where i can drag 'n drop items to build a room. with
some help i managed to have a "grouping" tool where i can grab a bunch of items
and move them together using arrays. basically i want to take that group of
items and duplicate/reload those items creating like a "copy/paste" effect with
the movieclips. if anyone knows how to do this i would appreciate any help
- 11
- Load random movieClip symbols within an .swf?I'm building a reference archive site for a documentary film (you can see a
template example at www.seanmurphydesigns.com/endgame_page.html) and I am
featuring on the page a scroller bar in which random quotes from the film will
scroll through. If you check out the example page, you'll see the bar directly
beneath the masthead graphic, there is a static quote sitting in it now.
I've looked up code that would enable me to randomly scroll .swf's referenced
from outside the file, but I've yet to find anything that suggests a way to
instead load random movieClip symbols from inside the same .swf. Should I
necessarily be using the outside-referenced .swf method? I thought it might be
simpler to just use the random symbols which would already be inside the file.
Any ideas/suggestions? Thanks in advance for any help.
- 12
- MX and MX2004 and embedded fontsask your partner to create the textbox in 2004 and have it embedded, making
sure that he selected scandinavian on the selection box for embedding. In
short have him do the embedding of the textboxes...
|
| Author |
Message |
dannyboy66

|
Posted: 2004-9-30 23:12:54 |
Top |
flash-actionscript, help launching applications please.
Sorry for the bump but need this help quit quick. thanks
|
| |
|
| |
 |
dannyboy66

|
Posted: 2004-10-1 0:48:00 |
Top |
flash-actionscript >> help launching applications please.
I notice that these forums get very busy but can anyone help ?
|
| |
|
| |
 |
softyengin

|
Posted: 2004-10-1 1:10:00 |
Top |
flash-actionscript >> help launching applications please.
I found this...
on (release) {
fscommand ("exec", "start\texplorer.exe");
fscommand ("exec", "cmd\t/c\texplorer.exe");
}
hope it helps...
|
| |
|
| |
 |
softyengin

|
Posted: 2004-10-1 1:13:00 |
Top |
flash-actionscript >> help launching applications please.
...
apparently the app needs to be in the current movies directory
so try creating a shortcut to the app you want to run and place it in the
current dir
ie
on (release) {
fscommand ("exec", "shortcut filename");
}
|
| |
|
| |
 |
| |
 |
Index ‹ flash-actionscript |
- Next
- 1
- Dataset Filtering. Advice needed.PleaseHelpIn the following example, filtering is enabled on the DataSet object named
employee_ds. Suppose that each record in the DataSet collection contains a
field named empType. The following filter function returns true if the empType
field in the current item is set to "management"; otherwise, it returns false.
employee_ds.filtered = true;
employee_ds.filterFunc = function(item:Object) {
// filter out employees who are managers...
return(item.empType != "management");
}
Say the 'item.empType' contains 3 managers and 2 assisstants.Would it be
possible to modify this code to look through the empType node and if it finds
one manager include it.. but filter out the other 2 managers and include 1
assisstant and filter out the other one.Basically what i want to create is a
combobox/datagrid/listbox that lists every type of 'empType' ONCE.
Its for an application that im working on that requires a dynamically
populated XML based menu system. I have no control over the XML file so I need
it to populate this every time the application is loaded.
Anyone know if this can be achieved?? or the best way to achieve this??
I would love any help.. i'm on a tight deadline for this one. Thanks for your
time.
- 2
- Random cloudHi.
I have a beach scene on my stage, i a have a cloud Movie clip
I want this cloud go cross my stage from left to right by code.
And also make this crossing radom in time.
Ex- the cloud just crossed the stage, now it ill return to the orginal place
and after 3 secods wil cross again, the after 1 second another one will
cross...
Can any one send me an FLA with that ? or a link that can solve my problem ?
thank you
- 3
- How to detect keyborad double tap in Flash?Hello everyone,
I have been wondering how can I implement the functionality of double tap
detecting in Flash MX 2004. I searched over the internet (put "implement double
tap Flash" in google search box) but haven't got any luck. I would really
appreciate it if anyone could give me a example or point me to a direction
where I can get relevant information.
Thanks for your time.
- 4
- How do I get a movie to follow the mouse cursorI am fairly new to actionscript but I've seen something on another site that I
would really like to use myself on my site.
Please take a look at http://www.tbwa.com ... The home page has a movie that
follows the mouse cursor and when you click the movie graphic it opens the site
navigation.
All I need to know is how to have the movie float and follow he mouse ??
Sample script and some simple instructions would be gratefully received
Cheers
T:confused;
- 5
- ExternalInterface doesn't work on IE7I'm having problems with ExternalInterface in Flash 8, in IE7, on
Vista. The same code works on Flash 8, IE6, on XP. I looked at
http://groups.google.com/group/macromedia.flash.actionscript/browse_thread/thread/2e0b6b59f538cde1/f08b6fbdd42945f6?lnk=gst&q=IE7&rnum=3#f08b6fbdd42945f6
but that proved to be the same; works in IE6 and not IE7.
Any ideas? I'm stumped.
- Dan
- 6
- textArea.label.selectable = false;It took me 42 years to find out how to disable text selecting in a text area
component. Nothing in help or in these forums about it.
textArea.label.selectable = false; it the key and it works great UNLESS you
load swf containing textarea into another swf. Then when you scroll the text it
will select ALL the text. Why is Flash so buggy when it comes to text. Anyone
have a solution?
- 7
- Preloader Percentage To Count DownHi
Maths isnt my strong point!! How can i get it to count down from 100% to 0%
when its fully loaded? Here's the script i want adjusted. Thanks
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._height = getPercent*100;
_root.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(3);
}
- 8
- .getTransformGreetings,
Why doesn't .getTransform work for me? Am I phrasing it wrong? ...probably,
but I've tried every combination I can think of and nothing works. Below is
what I tink should work... but instead of numbers, the output is [object
Object] . What am I doing wrong?
Regards, Fredy
var new_color = new Color (t);
set_color=
{
rb:sR*2.5
,gb:sG*2.5
,bb:sB*2.5
,aa:100
};
new_color.setTransform(set_color);
trace(new_color.getTransform());
- 9
- ExternalInterface problemI have a movie, with interactivity and plenty of Actionscript 2.0 . Within this
movie, I have defined a function called overrideFault.
It is shown below. I have also exposed this function to JavaScript via
ExternalInterface.addCallback(), also shown below. My problem is that when I
try to call the function with a button's onclick handler in JavaScript, it
doesn't seem to think that I have exposed the function. I am able to use
JavaScript to access the movie's DOM 'id' property, so I know that that part is
right.
Has anyone else encountered this? Or perhaps would like to offer advice?
Many Thanks,
Bob Robertson
function faultOverride(inVar:Number){
setFaultN(inVar);
if (_root._currentframe != 2) {
_root.gotoAndStop(2);
}
}
ExternalInterface.addCallback('overrideFault', _root, overrideFault);
<form>
<input type="button" value="insert 1"
onclick="document.getElementById('ctsC').faultOverride(1);"><br/>
</form>
- 10
- flash component to phpim kinda rusty on flash nowadays and i forgot many things, im trying to get
back again, this is simple i guess, im current creating a form to be submitted
to php, is there any simple way to do that, there are 2 input text and 2 combo
box, i cant seem to get things work, maybe a link or a short tutorial may
help.. thanks!
- 11
- delete classHi Forum
Question. When one deletes a class is there a built in function within the class itself that gets called? Such as the onUnload function in MovieClips?
stephan
- 12
- jumping object, curvehi ng,
im developing a little flash game for long jumping. im stuck by calculating
the "jumping curve" (hope you understand what i mean).
the angle doesnt matter, only the running speed before the jump.
i have a timer (100ms) which should calculate the coordinates for the curve.
so i need a formula which calculates the curve. i was thinking of some kind
of parabola.
maybe theres someone who has done this already, any help would be
appreciated.
regards benni
- 13
- How to cut part of a movieclip at runtime?Hi, there. I'm working on a puzzle game and want to load a jpg file and then to
cut some parts of it into triangles. So the problem is that it seems to me
there's no way of cutting a movieclip at runtime. I know I can create an empty
movieclip at runtime but how to cut a part of some jpg or movieclip and paste
that part somewhere else. I'll apreciate any help.
- 14
- glitch in rollover eventIt appers that your problem is that you have a dynamic hitarea.
You can define the hitArea() (view help "hitArea" in flash) of the MovieClip,
or you can make an invisible movieclip named "hitMask" on top of all MC's.
and use this code:
hitMask.onRollOver = function()
{
_root.monitor_mc.gotoAndPlay("monitorBig");
}
hitMask.onRollOut = function()
{
_root.monitor_mc.gotoAndPlay("monitorSmall");
}
- 15
- Movie refuses to load variables from text fileHi,
I'm sure you can solve my newbie problem in less than 1 minute... :)
I'm pulling my hair out on a template I bought 2 days ago from
templatemonster.com
I am using Flash 8 Pro.
All I want to do is change an existing textfield that is Static to Dynamic and
load variables from a text file.
The Action Script I use to do so comes directly from Macromedia documentation
(see attached)
It works fine when I create a brand new movie, but doesn't do anything when
inserted into the template.
It doesn't even complain about not finding the text file if I rename or delete
it!
Here are the FLA and text file:
http://tom.free.fr/flash/fla_and_text.zip
The textfield I would like to change is in the txt2 symbol.
Here is how I proceed:
When I open HEADER.FLA, Flash tells me I'm missing a font, ok, so I click on
Use Default, I'll deal with this later.
I open up the Movie Explorer, go to Layer 30, go to Frame 75 and click once on
txt2
I name the instance "myMovie_mc" and save (converts from Flash MX to Flash 8)
I double-click on the Movie Clip, select the word "Automobile" on the Stage,
change from Static to Dynamic and call that instance "myText_txt"
Still in the Movie Clip, I create a new layer I call "actions", and in Frame 1
I copy the attached Action Script:
This script works when I create a new flash file, but it does absolutely
nothing in this template.
I know I'm doing something wrong, but I wonder what?
Many thanks to any helping soul!
Ferris.
// Load text as variable and assign it to the
// dynamic text field
var features_lv:LoadVars = new LoadVars();
features_lv.onLoad = onText;
features_lv.load("safetyFeatures.txt");
function onText(success:Boolean) {
if (success) {
myText_txt.text = features_lv.safetyfeatures;
} else {
myText_txt.text = "unable to load text file.";
}
}
|
|
|