Problem with ActionScript
hello I encountered this error while I running an action
script file in flash cs3:
1013: The private attribute may be used only on class property
definitions.
and this is the function that make this error:
private function clickListener(e:MouseEvent):void{
var phase:String;
switch(e.eventPhase){
case EventPhase.CAPTURING_PHASE:
phase = "Capture";
break;
case EventPhase.AT_TARGET:
phase = "Target";
break;
case EventPhase.BUBBLING_PHASE:
phase = "Bubbling";
break;
trace("Current event phase: "+ phase);
thank you very much and I appreciate you .sincerly yours
Mohsena
Hello Kglad ,I tried to send it to two messege:
part 1:
package{
flash.display.Sprite;
public class TestEventPhase extends Sprite{
public function TestEventPhase():void{
var t:TextField = new TextField();
t.text = "click here";
t.autoSize = TextFieldAutoSize.LEFT;
stage.addChild(t);
stage.addEventListener(mouseEvent.CLICK,clickListener,true);
stage.addEventListener(mouseEvent.CLICK,clickListener,false);
Similar Messages
-
Problem with actionscript window in Flash CS3 IDE
The actionscript window doesn't open up for any frames on the
timeline. When I press 'F9' or try to access via context menu the
action window tab appears at the top in minimized form. No matter
how many times I click on it or on the maximize button the window
doesn't open up. I tried reinstalling Flash CS3 but it didn't help.
Any help with this issue is appreciated.
Thanks!Found a solution for this atlast ! Delete the Users/AppData
folder for flash CS3 and things will be back to normal. It seems
the Flash IDE screws somewhere while saving the local users
settings. Clearing these settings restored my action window
! -
Having a problem with Actionscript. Need help
I'm trying to set up the first page in my project so that I capture a person name... and I can use it again later on. I had discussed this in a previous thread with Ned Murphy:
http://forums.adobe.com/message/3319540#3319540
I half way have this working. For some reason when I type in the name, only parts of it appear when I retrieve it.
Here's a look at my actionscript on the first page:
stop();
//Setting Up Name TextInput Field and Variable
var userInput:String="";
//Enter Button Setup
enter_btn.addEventListener(MouseEvent.CLICK, copyText);
function copyText(e:MouseEvent):void
userInput=name_ti.text;
gotoAndPlay(2);
And here's the actionscript on the retrieval page
//Textbox Greeting
greeting_txt.text="Hello "+userInput+(!);
Where am I going wrong?Have you tried embedding the font of your input text area? If you're using Flash CS5 Pro this is very important.
-
Problem With Actionscript Working in Player 7 and Up
Can some one please help me, I have been working with an old
action script file that works in flash player 6 but not any thing
above that. Any help would be great. As a side note the spline
function no longer works either.
onClipEvent (load) {
function x(t) {
var __reg1 = t;
if (__reg1 != 0 && __reg1 != 1) {
xspline = Math.pow(1-__reg1, 3)*x0+3*Math.pow(1-__reg1,
2)*__reg1*x1+3*(1-__reg1)*Math.pow(__reg1, 2)*x2+Math.pow(__reg1,
3)*x3;
if (__reg1 == 0) {
xspline = x0;
if (__reg1 == 1) {
xspline = x3;
return xspline;
function y(t) {
var __reg1 = t;
if (__reg1 != 0 && __reg1 != 1) {
yspline = Math.pow(1-__reg1, 3)*y0+3*Math.pow(1-__reg1,
2)*__reg1*y1+3*(1-__reg1)*Math.pow(__reg1, 2)*y2+Math.pow(__reg1,
3)*y3;
if (__reg1 == 0) {
yspline = y0;
if (__reg1 == 1) {
yspline = y3;
return yspline;
function evalangle(x1, y1, x2, y2, linedist) {
lineangle = Math.asin((y2-y1)/linedist)*180/3.14159;
if (x1-x2>0) {
lineangle = 180-lineangle;
return lineangle;
function drawLine(xp1, yp1, xp2, yp2, linedepth) {
var __reg1 = lineDepth;
_parent;
var __reg3 = xp1;
linedist =
Math.sqrt((xp2-__reg3)*(xp2-__reg3)+(yp2-yp1)*(yp2-yp1));
lineangle = evalangle(__reg3, yp1, xp2, yp2, linedist);
_parent.attachMovie("line","line"+__reg1,__reg1);
_parent["line"+__reg1]._x = __reg3;
_parent["line"+__reg1]._y = yp1;
_parent["line"+__reg1]._rotation = lineangle;
_parent["line"+__reg1]._xscale = 10*linedist;
function drawSpline() {
i = 0;
while (i<nsplinepoints) {
xpspline
= x(t);
ypspline = y(t);
t = t+step;
++i;
i = 0;
while (i<nsplinelines) {
drawLine(xpspline
,ypspline,xpspline[i+1],ypspline[i+1],i);
++i;
var t = 0;
function moveflower() {
_parent;
var crdzx = _parent._xmouse;
if (_parent._ymouse<0) {
var crdzy = _parent._ymouse;
if (crdzx>crdx) {
crdx = crdx+(crdzx-crdx)/20;
if (crdzx<crdx) {
crdx = crdx-(crdx-crdzx)/20;
if (crdzy>crdy) {
crdy = crdy+(crdzy-crdy)/20;
if (crdzy<crdy) {
crdy = crdy-(crdy-crdzy)/20;
if (crdx == 0) {
crdx = 1;
if (crdy == 0) {
crdy = 1;
distance = Math.sqrt(crdx*crdx+crdy*crdy);
angle = Math.asin(crdx/distance)*180/3.14159;
x3 = radius*crdx/distance;
y3 = radius*crdy/distance;
_parent.dragme._rotation = angle;
_parent.dragme._x = x3;
_parent.dragme._y = y3;
var nsplinepoints = 11;
var nsplinelines = nsplinepoints-1;
var step = 1/nsplinelines;
var t = 0;
var x0 = 0;
var x1 = 0;
var x2 = 0;
var y0 = 50;
var y1 = 33;
var y2 = 0;
var radius = 40;
var xpspline = [];
var ypspline = [];
onClipEvent (enterFrame) {
moveflower();
drawspline();OK. I was replying to you being a smart *** first. Because
you have posted 31000 comments you rule the forums? When last I
posted on this forum there was no attach code function. Im sure
your good but don't get full of yourself because some where there
are a dozens of kids that grew up with this stuff and can beat the
pants off both you and I. Im sure there is no less than 10,000
other people that can help me most likely better than you. So
thanks for being a smart *** first but like I said before I will
wait for some one else.
Thanks
Jahue -
Problem with textboxes in Flash CS5
Hi, I am currently a Flash CS4 user and am trying Flash CS5 currently to see if it is worth it to pay for the upgrade. I currently have a problem with the use of textboxes in CS5 comparing with the previous version. When I try to change the texts of a text box using the following command in actionscript:
showlmytext.text = "My string: " +String(somevariable);
I would get weird misaligned text outputted in my textbox, which exact same code did not cause this problem on Flash CS4.
Can somebody please tell me what is the problem and how can I fix it?
ThanksHi Mario,
I hope you are well. My name is Sandi Langlotz.
At my job at greenidea.com, here in SF; I am having difficulty with using Hebrew in the trial download of CS5 Flash. Russ Mumford my boss has also contacted you regarding our problem.
Flash has a new TLF (Text Layout Format tool). My difficulty has to do with text boxes that are formatted for Right to Left text, with Hebrew selected as the Locale. We are pasting from Microsoft Word.
I hope that you may have a suggestion, a referral or a possible work around for me to try.
I have tried Adobe Customer Service several times to no avail.
Problem 1.
The first sentence below, (in blue) is correct format for Hebrew. Hebrew reads from R to Left.
When I paste the Hebrew text into the Flash animation, one of two things can happen;
the punctuation is cut off of the left side completely; or it is pasted in to the Right side of the Text box, (at the wrong end of the sentence).
I have tried to click the cursor into the left in order to insert the punctuation mark; this works sometimes but often I am unable to click in to manually correct the problem. I don't understand why it is cutting it off, or why I am sometimes unable to click into the left side and insert the punctuation.
Problem 2
In the second paste (the 2nd bold sentence), .CSO on the left side of the sentence is correct, as is the rest of the sentence.
When I paste the text into Flash from Word, Flash puts it in as reversed order. the word CSO. has the punctuation switched to the right (CSO.) Flash reverses the order of the other characters in the sentence also (like in the 2nd black sentence).
שולחן נקי הוא שולחן מאובטח.
שולחן נקי הוא שולחן מאובטח
מבוסס על רעיון ממגזיןCSO .
.CSOןיזגממ ןויער לע ססובמ
Adobe says it supports Right to Left text, but I can find no info on these two buggy problems. Do you have any idea what is wrong?
Thank you ahead of time for any info or referrals you may suggest.
Sandi Langlotz
שולחן נקי הוא שולחן מאובטח.
שולחן נקי הוא שולחן מאובטח
מבוסס על רעיון ממגזיןCSO .
.CSOןיזגממ ןויער לע ססובמ -
I have a problem with my XML setup here
i use Tab key to aligh up info in the xml text for aligned
display in the program
hoever i tested on several computers and get different
resolts.
how can i fix this.
Please view the linked Image
http://img129.imageshack.us/img129/8394/flashtextproblemti4.jpg
this is what happenes even thow all run xp and all run same
latest flash version.
Anyone got an ideer how i can solve this.
BTW the font is verdana.
This is my actionscript ....
// Function to parse an address
f_parseAddress = function () {
// Set the text
_root.stageholder.textfield.htmlText =
this.firstChild.firstChild.firstChild.nodeValue;
// Create the XML object
XML_address = new XML();
// Set up the XML object
XML_address.ignoreWhite = true;
// Add the handlers
XML_address.onLoad = f_parseAddress;
// Load the XML file
XML_address.load("./Data/xml/kontakt.xml");
This is my XML file
<?xml version="1.0" encoding="iso-8859-1"?>
<text>
<address>
<![CDATA[
<font size="20">Company name</font>
Company name
address
address
Dir. tlf. + xx xx xx xx xx
+ xx xx xx xx xx
Mobil + xx xx xx xx xx
+ xx xx xx xx xx
web: <a href="
http://www.xxxxxxxxxxxxx.xx"><b>www.xxxxxxxxxxxxx.xx</b></a>
E-mail: <a
href="mailto:[email protected]"><b>[email protected]</b></a>
]]>
</address>
</text>
If anyone got a solution on how i can get my text to allign
corect
i would like to hear about it
Best reguards
Misalrighty then try this xml structure.
Note: formatting information like b, or linkage tags should
not be part of the xml.
The XML format is a universal format for data, if you fill it
with style information this is not good practive (in general, there
are of course scenarios where it makes sense, also since (x)html IS
also XML).
In your case you want to put the information about multiple
companies in a xml file, but you let the flash decide how to
display format this information.
so if you use the sugested XMl structure you will have full
control of the layout within flash, because you can grab every
piece of information from the xml and place it jsut where you want
in flash and format it within flash.
Of course this process is more coding work than your previous
attempt, but it pays of when you have a lot of data to process and
when you want to have full control of the final layout.
But maybe its overkill for your application (I don't know how
many companies will be stored in your xml and how complex the rest
of the app is). -
Problems with Safari to download and save pdf files
I used to download pdf with no problems at all, right now the download window does not open at all and tha option Save as is acting like the file is being saved but no pdf file appears in the downloads folder or in any other folder select. I am new in safari, and I am not a very well internet instructed person, please help.
Hi,
Please go through following links..this will help you:
http://lucamezzalira.com/2009/02/28/create-pdf-in-runtime-with-actionscript-3-alivepdf-zin c-or-air-flex-or-flash/
http://forums.adobe.com/thread/753959
http://blog.unthinkmedia.com/2008/09/05/exporting-pdfs-in-flex-using-alivepdf/
Thanks and Regards,
Vibhuti Gosavi | [email protected] | www.infocepts.com -
SWF movie export on frame-by-frame basis WITH actionscript
Hi there,
I know they're two ways of exporting flash movies:
Export the whole timeline. This only allows timeline animations and gets messy because you have to cram up everything on the main timeline.
Realtime-Export via Quicktime. This is a "full blown" export, but heavily dependent on CPU power or speed of harddrive, depending on resolution.
I also work a lot with music programs and there is an option called "mixdown". This will render the whole song - as fast as the processor is capable - to a WAV-file. So time doesn't matter anymore, notes don't get skipped, etc.
I would like to see something like this in flash, too. WITH actionscript.
I just want flash to export one frame for each "onEnterFrame" event, NOT when the timer tells you, it's time for a "next frame". So this would mean not to trigger the onEnterEvent when the appropiate time has passed, but to trigger it, when the next frame can be exported.
Libraries like "TweenLite/Max" are capable of doing frame-based animations, independent from the timer, so everything on that end is pretty fine.
Would be so great if that was possible in any way.
Is it already in CS5? Or maybe an option in CS6... argh, so many years to wait...
until then, I have to measure the fps, look out for the lowest number, export at THAT framerate (in most of the cases just 4 or 5 fps, even on a very fast computer - just because 2 or 3 frames happen to render slower than the other 200) and afterwarts set it to 25 again (I use Blender to do this)Greg-
Good Lead - Thanks.
I learned that having skinned components (which this uses)
keeps this preloader from working properly. The results were
unstable. It looks like a great little preloader for other things
though.
I also learned that it's a problem that others have
encountered and that hasnt been solved yet...
...."hello Adobe?"
Thanks again for helping me understand this.
JL -
FileReference problem with IE (6.0.2900 and 8 maybe)
Hi! I've got a problem I've been stuck with for a long time and I seem to solve it by installing the Adobe Flash CS3 trial...
It's like this: I'm doing an exam work in mostly ActionScript 3. It's near the end and everything is working fine, I've tested it on all the computers and web-browsers at my university but my customer gets a error when he's uploading files. In short my program uploads files from a database with AMFPHP (everything works there, my customer can see all the files) and one of the functions is to upload new files. My code for that part looks almost exactly like the final example in the FileReference livedocs here:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/net/FileReference.html
I've made it print a TextField for all the events but none are showing up with the error, what's happening is that you can click the button to upload files, get a file-browser window, mark a file and click open and then nothing happens. The program doesn't freeze, and it is hard to tell where the problem is because (and I'll explain more later) every time I've installed Adobe Flash CS3-trial to check my error the problem have gone away so I can't make more traces.
In short AMFPHP have a "on result"-function, where you set the actions to take after you've changed the database which I do in the completeHandler-function, which prints the new files I've uploaded. It doesn't redraw anthing if nothing was changed in the database (which there isn't) so I guess it simply goes by it and waits for other events, which it appears to be doing since it can respond to events after that.
Ok, here're my "solutions": I originally discovered the error myself on a 32-bit Windows XP only with IE 8 and all versions with IETester (program to simulate older versions of IE). Note that on all computers there have been no problems with Mozilla and Firefox. I wanted to debug so I installed Adobe Flash CS3-trial, the debugger wanted me to set "Global Settings Manager" to accept, I did and it worked on all versions of IE. I hoped that was the problem, because I think the computers I had tested it with where all XP 64-bit and Vista 32-bit (the problem being XP 32-bit and old IE version-related). However it made no change for my customer.
Then I found the error again on a my own old 32-bit XP computer with IE 6.0.2900 (same version as my customer), sadly didn't think of my final suggestion to the customer, and installed Flash CS3-trial to debug again. It worked but this time I thought Flash CS3-trial installed the latest version of Flash Player so I asked my customer to try that but it didn't do anything. Then I tried to uninstall Flash Player to check for myself but it didn't do any difference, I even did a system restoration with the Windows command to a point where I had that problem but it was gone. Though the problem is far from random, it never appears on the fixed computers and once it's fixed I can't get it to come back.
I'm not sure what to look for anymore, except a second hand shop that sells old computers and hope it've got a old version of IE and without whatever fixes my problem. Note, I've run the older versions with IETester and it always works for those versions on computers where it works on a later or latest version. On all computers it've worked with Firefox and Mozilla. The problem is always solved after I install Adobe Flash CS3-trial, I might be in the wrong forum but I mostly came to this site (tried on actionscript.org without any luck) to ask this: Is Adobe Flash CS3-trial installing some Flash-related drivers you don't get with the Adobe Flash Player? Even if I would ask my customer if I could install Flash CS3-trial on his computer it's still nothing I can do for all of his customers that will be using the program. Other than that any advice on what I could do or check?
Sorry if this got a little long, if this line catches your eyefirst I think that second to last paragraph is a good summary. Thanks for any replyNever mind, scratch this or I'll just mark it as solved. I had another error so it wasn't easy to check, but now I got the older versions of Flash Player and indeed on the Flash Player 9 and below I got that original error. I installed a older version and then installed the one I had linked to my customer and it still didn't work. All I had to do was to restart my web-browser and it works, and I've been able to switch back and forth between the versions and make the error appear and reappear so I know it's it. Thanks anyway if soemone accidently read this
-
Hi. I'm making a form for work for people to book places on
training courses. Having an annoying problem with variables that
i'm hoping has a simple solution. Any help with this will be much
appreciated.
All the info is held in an external text file which looks
like this (but much longer):
&totalcourses=2&
&course0=Please choose a course&
&course1=my course one&
&totaldates1=3&
&c1date0=Select a date...&
&c1date1=15 September 2006&
&c1time1=Time: 10:00 to 16:00&
&c1date2=23 January 2006&
&c1time2=Time: 11:00 to 16:00&
&c1date3=28 February 2007&
&c1time3=Time: 12:00 to 16:00&
&course2=my course 2&
&totaldates2=3&
&c2date0=Select a date...&
&c2date1=15 September 2006&
&c2time1=Time: 11:00 to 16:00&
&c2date2=08 January 2007&
&c2time2=Time: 9:00 to 16:00 &
&c2date3=15 February 2007
&c2time3=Time: 12:00 to 16:00&
The course titles are loaded into an array and then into a
combobox. When a course is chosen a second combobox loads the
relevant dates array for that course. When a date is chosen the
time is shown in a dynamic text box.
Problem is - if more than one course is on the same date it
will show the time for the latest course with that date. For
example - course 1 is on 15 sept at time 10:00 to 16:00, course 2
is also on 15 sept at time 11:00 to 16:00. When 15 Sept is chosen
for course one it displays the time for course 2 on this date -
presumably because it comes later in the text file.
I've attached the actionscript for this - Can anyone help me
sort this out??Hi. I'm making a form for work for people to book places on
training courses. Having an annoying problem with variables that
i'm hoping has a simple solution. Any help with this will be much
appreciated.
All the info is held in an external text file which looks
like this (but much longer):
&totalcourses=2&
&course0=Please choose a course&
&course1=my course one&
&totaldates1=3&
&c1date0=Select a date...&
&c1date1=15 September 2006&
&c1time1=Time: 10:00 to 16:00&
&c1date2=23 January 2006&
&c1time2=Time: 11:00 to 16:00&
&c1date3=28 February 2007&
&c1time3=Time: 12:00 to 16:00&
&course2=my course 2&
&totaldates2=3&
&c2date0=Select a date...&
&c2date1=15 September 2006&
&c2time1=Time: 11:00 to 16:00&
&c2date2=08 January 2007&
&c2time2=Time: 9:00 to 16:00 &
&c2date3=15 February 2007
&c2time3=Time: 12:00 to 16:00&
The course titles are loaded into an array and then into a
combobox. When a course is chosen a second combobox loads the
relevant dates array for that course. When a date is chosen the
time is shown in a dynamic text box.
Problem is - if more than one course is on the same date it
will show the time for the latest course with that date. For
example - course 1 is on 15 sept at time 10:00 to 16:00, course 2
is also on 15 sept at time 11:00 to 16:00. When 15 Sept is chosen
for course one it displays the time for course 2 on this date -
presumably because it comes later in the text file.
I've attached the actionscript for this - Can anyone help me
sort this out?? -
Problem with TLF - floating an inline image
I am running the latest version of Flash Builder 4 (4.0.1). The problem that I having:
When I use an InlineGraphicsElement if aTextFlow (in a RichEditableText component), if I set a value for the "float" attribute of an <img> element; the image is not visible. Without the float attribute, I see the image.
Is this a version problem with TLF? How do I know which version of TLF that I'm using? How do I install the correct version of TLF?
Thanks for the help.
Oz
Some code fragments:
The TextFlow string with "float":
<div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
<p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do: once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
<p>
<img float="left" width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
<span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
</div>
Without "float":
<div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
<p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do: once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
<p>
<img width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
<span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
</div>
A bit of MXML code:
<s:Group id="myGroup" width="100%" height="100%">
<s:RichEditableText id="myRichText" lineBreak="toFit">
</s:RichEditableText>
<!--- Do not set the height of the RichEditableText - since it seems to prevent the appearance of the vertical scroll bars -->
</s:Group>
And some Actionscript that adds components:
scroller = new SxScroller();
scroller.dx = dxScroller;
scroller.dy = dyScroller;
scroller.addEventListener(FlexEvent.CREATION_COMPLETE,scrollerEvent);
scroller.addEventListener(FlexEvent.UPDATE_COMPLETE,scrollerEvent);
richText = scroller.richText;
richText.editable = false; // textCharacter.enableEdit; // probably false. TODO: support true???
richText.selectable = true; // required
richText.width = dxRichText;
And finally the import of a TextFlow string:
richText.textFlow = TextFlowUtil.importFromString(textFlowString, WhiteSpaceCollapse.PRESERVE);On the TextFlow forum I found the answer:
Use Flash Builder Hero, since it support TLF 2.0 out-of-the-box. The InlineGraphics support several valuable attributes, including float="left" etc.
Beautiful. -
Hi,
I've got a problem with Flash CS3 and Actionscript 2.
I want to create an animation of a movieclip. This animation
should start with the click on a button. A repeated click on this
button should stop the animation. So I created a button and a
movieclip and declarated them. Additionally I defined the IDs of
all this elements. But the problem is, that nothing happens if I
click the button.
But at first I should show my code:
//declaration
var myButton_btn:Button;
var myMC:MovieClip;
var isHighlighted:Boolean = false;
//code
myButton_btn.onRelease = function () {
if(isHighlighted) {
myMC.gotoAndStop (1);
isHighlighted = false;
else {
myMC.play();
isHighlighted=true;
The boolean shows if the animation is already running.
The button, the movieclip and the code are located in
different layers, but they all are under the root element.
The debugger shows, that on a click event the function on
myButton isn't called.
May someone have an idea what's my fault?
Thanks and best regards,
RobertHi again,
I think I figured out the problem. For testing I created a
new scene. There I created a folder and a layer in this folder. All
actionscript code is located in a root layer at the beginning of
the scene.
The hierarchy looks like this:
_root
-> code_layer
-> test_layer
-> BUTTON_FOLDER
-> -> button_layer
If the button is located in the "test_layer" all works fine.
But if I move the button to the button_layer, the script isn't
working.
Now my question is, how should the path to the button look
like?
I tried some combinations (
_root.BUTTON_FOLDER.button_layer.myButto n and so on) but nothing
works.
Thanks again for help,
best regards,
Robert -
Hey everyone,
I am having a problem using embedded fonts within my movie and no matter what i try I cannot get it to work. I have a font embedded which is set to be exported for actionscript and exported in the first frame. It has an identifier of myfontid. The following code works fine and displays a text box using Arial:
Actionscript Code:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there";
var myTextFormat = new TextFormat();
myTextFormat.font = "Arial";
target.newText.setTextFormat(myTextFormat);
However the following doesn't work at all:
Actionscript Code:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there";
var myTextFormat = new TextFormat();
myTextFormat.font = "myfontid";
target.newText.setTextFormat(myTextFormat);
target.newText.embedFonts=true;
I have been toying with this for ages now and read everything I can about it but am still having problems. It works when I use similar code within an empty flv
file just not within my main movie. This is being run within an onLoadComplete method for after the image that it sits on finishes loading, i suspect there must be some issue with this but i can't see what it is given it works without embedded fonts.
Thanks so much for your help on this, it's driving me crazy!!
DaveThis is driving me nuts When i copy the embed code across into a blank flv file (with the embedded font) and replace target with this then it works perfectly but it will not work no matter what i do within my main swf. The exact code i'm using is:
target.createTextField("newText",target.getNextHighestDepth(),50,50,100,300);
target.newText.text="hi there1";
var myTextFormat = new TextFormat();
myTextFormat.font = "fontid";
myTextFormat.color = "0xFFFFFF";
target.newText.setTextFormat(myTextFormat);
target.newText.embedFonts=true;
I just don't even know what to try anymore, i would think there's maybe a problem with running it all within an onloadcomplete statement or something like that however it works perfectly when i use standard non embedded fonts. Also when i debug the movie i can see the textfield newText and it has the correct variable and is has embedFonts set to true but still nothing shows up.
Any other suggestions would be massively appreciated as i really don't know what to try any more....
Thank you so much for your help,
Dave -
Fustrating problem with self-made 5-state button
Hey guys, just wondering if you could help me, i don't have
much knowledge with actionscript and i created my own 5 state
button using a movie clip and a little bit of actionscript by
following a tutorial online. (
http://www.sanctifiedstudios.com/advanced-five-state-buttons/)
Basically, when rolled over, the button slides out, and when
rolled off, the button slides back in. The problem is, while the
button is rolling back in, if you flick your mouse onto the button
again quickly, instead of restarting the roll-out animation, the
button just flickers quickly between the in position and the out
position.
You can see it for yourself here: www.everlightmusic.com <
hover your mouse over the buttons on the right, move your mouse
off, and then while its rolling back in, quickly move your mouse
back onto it.
The actionscript for the buttons is this:
quote:
this.onRollOver = function(){
this.gotoAndPlay(20);
this.onRollOut = function(){
this.gotoAndPlay(30);
this.onPress = function(){
this.gotoAndStop(29);
this.onRelease = function(){
this.gotoAndStop(29);
this.onReleaseOutside = function(){
this.gotoAndPlay(40);
this.onRelease = function(){
_parent.gotoAndPlay(31)
And here is a screenshot of the movie clip timeline:
Click
Any help with this would be greatly appreciated :)yeah this is typical when using a timeline based button
action. two things you could do:
1) control the state change by using a variable to indicate
when the motion is complete (or not) like 'isOpen' - you'd need to
do this for each button in combination with a condition in the
handler that 'reads' the var and determines the course of action -
of course the next problem is that if you 'rollout' while the
motion is happening and the handler fires previous to the setting
of the var to it's 'new' state it won't close because the condition
would only be fired once - the only way around that would be to
include a loop that runs until the condition is satisfied.
2) much better than the above method (which would get messy
fast) is to simply use the 'tween' class to create you motions, you
can then 'open' or 'close' from what ever the current position of
the clip is at the moment the handler is fired. you've got your
code on the timeline of the 'button' MC (good job) so you could
change it to something like this: -
Item renderer in datagrid with actionscript
Hi
I want to implement a datagrid similar to the one given int
the starting flex examples but in actionscript. I am having a
problem with the itemRenderer. I can't figure it out how I cam
create a imagerender in a datagridcolumn.
My code is:
var dataG:DataGrid = new DataGrid();
dataG.dataProvider = xmlList;
var coluna:DataGridColumn = new DataGridColumn();
coluna.dataField="nome";
coluna.headerText="Title";
var coluna2:DataGridColumn = new DataGridColumn();
coluna2.dataField="thumbnail";
coluna2.headerText="Title";
var imagem:Image = new Image();
imagem.height = 75;
imagem.source = "../tb/"+instrumentos.thumbnail+".jpg";
//HERE RELIES MY PROBLEM -HOW TO ASSOCIATE AN IMAGE TO THE
ITEM RENDERER
coluna2.itemRenderer = new ClassFactory(imagem);
var lalala:Array = new Array();
lalala.push(coluna);
lalala.push(coluna2);
dataG.columns = lalala;
thanks in advance"jahh_drum" <[email protected]> wrote in
message
news:ghcs5u$p2d$[email protected]..
> Hi
>
> I want to implement a datagrid similar to the one given
int the starting
> flex
> examples but in actionscript. I am having a problem with
the itemRenderer.
> I
> can't figure it out how I cam create a imagerender in a
datagridcolumn.
>
> My code is:
>
> var dataG:DataGrid = new DataGrid();
> dataG.dataProvider = xmlList;
>
> var coluna:DataGridColumn = new DataGridColumn();
> coluna.dataField="nome";
> coluna.headerText="Title";
>
> var coluna2:DataGridColumn = new DataGridColumn();
> coluna2.dataField="thumbnail";
> coluna2.headerText="Title";
>
>
> var imagem:Image = new Image();
> imagem.height = 75;
> imagem.source = "../tb/"+instrumentos.thumbnail+".jpg";
>
> //HERE RELIES MY PROBLEM -HOW TO ASSOCIATE AN IMAGE TO
THE ITEM
> RENDERER
> coluna2.itemRenderer = new ClassFactory(imagem);
>
> var lalala:Array = new Array();
> lalala.push(coluna);
> lalala.push(coluna2);
>
> dataG.columns = lalala;
ClassFactory takes a class, not an instance.
Try something like:
foo:ClassFactory = new ClassFactory(Image)
foo.properties= {height=75,
source:"../tb/"+instrumentos.thumbnail+".jpg"};
coluna2.itemRenderer = foo;
Note that using a ClassFactory this way will give you the
same image in
every renderer to start out with. However, I believe that
image
itemRenderers by default will take their source from the data
property when
that gets set.
HTH;
Amy
Maybe you are looking for
-
I was attempting to make an App store purchase and the App Store required verification of my computer. The information the App Sotre - and ITunes require is the expiration date [ mm / yyyy ] and the security code off the back of my registered credit
-
Spinning wheel of death while surfing internet
I have owned my Macbook Pro for several years and have had no issues. Recently, however, I get the spinning wheel of death when I'm surfing the internet. I am able to get to a site fast enough (at least as fast as my "high speed" DSL allows) but on
-
ITunes for windows 7 32-bit/64-bit???
I'm trying to download iTunes for my new computer, but it says 'This installer is intended for 32-bit versions of windows. Please obtain 64-bit installer from www.apple.com/support/downloads/bonjourforwindows.html' So i followed that link and downloa
-
Why "Warranty" Tab does not exist when picking
Dear friends, Below is my issue When picking against a SO, After assignment the batch number , go to header "Extras" >serial numbers> Assign Serial number Then double click check box of "Eqpt"..there is no Warranty tab exist..Where did I miss? Your
-
REReplaceNoCase to surround FQDN with anchor tag
Hey, everyone. Getting ready to head home, for the day, but want to get this out there before I leave. I'm trying to alter a LOT of PDF files. Need to make it so that all FQDNs in the PDF will be automatically surrounded by anchor tags so they can b